views:

1026

answers:

1

Hi everybody! This is my first ever question on stackoverflow.

I'm trying to load a PDF file stored in Resources into a UIImage/UIImageView object in the iPhone SDK. Is this at all possible without converting the PDF to an image? If not, what are the member functions for converting a PDF into a PNG? I would really prefer to preserve the PDF if at all pssoible.

Thanks so much for the help!

+5  A: 

PDFs can be loaded by UIWebView. If you need more control you can use Quartz 2D to render PDFs: Quartz2D

Hua-Ying
Are there any built in functions to translate a PDF document into a PNG?
Peter Hajas
I haven't tried it but you could try using quartz 2d to CGImageRef then create a UIImage with that ref then try using UIImagePNGRepresentation. Again, never tried it.
Hua-Ying