I'm trying to convert a pdf file to an image with this solution :
CFURLRef urlRef = (CFURLRef)[NSURL fileURLWithPath:@"http://uat.okitoo.fr/document/document/s595_506cb1811852f/o_specimen-page-seule.pdf"];
CGImageSourceRef src = CGImageSourceCreateWithURL(urlRef, NULL);
NSDictionary* options = [NSDictionary dictionaryWithObject:(id)[NSNumber numberWithInt:500] forKey:(id)kCGImageSourceThumbnailMaxPixelSize];
CGImageRef firstPage = CGImageSourceCreateImageAtIndex(src, 0, (CFDictionaryRef)options);
UIImage* imagePDF = [UIImage imageWithCGImage:firstPage];
CGImageRelease(firstPage);
My pdf file is ok but when I try this code, the image doesn't appear and I have this message : ": ImageIO: CGImageSourceCreateImageAtIndex image source parameter is nil". I can't understand..
I tried with other links but I have the same problem..
Any ideas ? Is there an other way to convert my pdf file to an image ?
Thanks a lot !