Load PDF into UIImage or UIImageView?

Peter Hajas picture Peter Hajas · Mar 1, 2010 · Viewed 18.4k times · Source

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!

Answer

LightMan picture LightMan · Oct 27, 2015

Now it is possible, I am using iOS 8+. If you put a pdf in your assets catalog, and then load the pdf in a UIImage using [UIImage imageNamed:] it renders the first page of the pdf into the UIImage.