문제

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!

도움이 되었습니까?

해결책

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

다른 팁

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.

You may want to check out this UIImage-PDF category over on GitHub: https://github.com/mindbrix/UIImage-PDF

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top