Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
710
Monotouch Grid to PDF
posted

Hi,

It's possible export a Grid to PDF? any example?

 

thanks

Parents
  • 40030
    Verified Answer
    Offline posted

    Hi!

    Technically it should be possible, although it would be a bit of work. 

    Apple has documentation that describes how to create a PDF using their API:

    http://developer.apple.com/library/ios/#documentation/2ddrawing/conceptual/drawingprintingios/GeneratingPDF/GeneratingPDF.html

    You can use this information and draw screen shots of the IGGridView into the context of a PDF page. However, the IGGridVIew only renders whats currently on screen. So you have 2 options. 

    1. When you create your PDF, create another grid, that is is the full size of it's content. And take a screen shot of it. 

    2. Take multiple screen shots of the grid, while you change it's content offset, so that it's displaying all of your data. 

    To take a screen shot, you can actually take a look at a blog post that i wrote a while back:

    http://ko.infragistics.com/community/blogs/stevez/archive/2012/12/13/uiimage-tips-and-tricks-for-ios.aspx

    Basically the code looks like this (in objective-c)

    -(UIImage*)screenShotOf:(UIView*)view
    {
       UIGraphicsBeginImageContext(view.frame.size);

       CGContextRef context = UIGraphicsGetCurrentContext();

       [view.layer renderInContext:context];

       UIImage * img = UIGraphicsGetImageFromCurrentImageContext();

       UIGraphicsEndImageContext();

       return img;
    }

    You can also make a request for this feature for a future release here: 

    http://ideas.infragistics.com/forums/211525-nuclios

    I know this is kind of vague, but i'd be happy to help guide you through this feature. If you have any questions, please don't hesitate to ask. 

    -SteveZ

Reply Children
No Data