このソリューションでpdfファイルを画像に変換しようとしています:
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);
私のpdfファイルは問題ありませんが、このコードを試してみると、画像が表示されず、次のメッセージが表示されます: ": ImageIO: CGImageSourceCreateImageAtIndex image source parameter is nil". 理解できません..
他のリンクで試しましたが、同じ問題があります..
何か案は ?私のpdfファイルを画像に変換する他の方法はありますか?
どうもありがとう !