Download PDF in UIImage or UIImageView?

This is my first stackoverflow question.

I am trying to upload a PDF file stored in Resources to a UIImage / UIImageView object in the iPhone SDK. Is this possible without converting PDF to image? If not, what are the member functions for converting PDF to PNG? I would prefer to keep the PDF, if at all pssoible.

Many thanks for the help!

+4
source share
3 answers

PDF files can be downloaded using UIWebView. If you need more control, you can use Quartz 2D to render PDF files: Quartz2D

+5
source

Now, maybe I'm using iOS 8+. If you put the pdf file in your asset directory and then upload the pdf file to UIImage using [UIImage imageNamed:] , it will display the first pdf page in UIImage.

+7
source

You can check out this UIImage-PDF category on GitHub: https://github.com/mindbrix/UIImage-PDF

+6
source

Source: https://habr.com/ru/post/1302801/


All Articles