Reputation: 61
I have one problem, that is how to convert pdf pages into images natively. I tried this link https://github.com/mindbrix/UIImage-PDF but want to know do we have any default functions in Objective c
Please suggest any solution.
Upvotes: 1
Views: 4060
Reputation: 897
It's simple to use this library. You must make sure you have path of PDF
, convert into URL, then simply add on UIImage
on that URL.
Import the Library File: Download from here
import "UIImage+PDF.h"
NSURL *url = [NSURL fileURLWithPath:pdfFilePath];
UIImage *img = [ UIImage imageWithPDFURL:url atSize:CGSizeMake( 60, 60 ) atPage:1 ];
Upvotes: 1
Reputation: 181
If your assets are in pdf format then you don't need to convert it to images. You just add these pdf file in asset and refer to these file as we do for .png/jpeg.
Upvotes: 1