次のコードは、PDFページをJPEGに変換します。SnowLeopardでは期待どおりに動作します。
...
//get the image from the bitmap context
CGImageRef image = CGBitmapContextCreateImage(outContext);
//create the output destination
CGImageDestinationRef outfile = CGImageDestinationCreateWithURL(fileUrl, kUTTypeJPEG, 1, NULL);
//add the image to the output file
CGImageDestinationAddImage(outfile, image, NULL);
CGImageDestinationFinalize(outfile);
...
iPhoneバージョンのCoreGraphicsにはが含まれていないため、iPhone用にコンパイルするとこのコードは失敗しますCGImageDestinationRef
。CFImageRef
ネイティブのiPhoneフレームワークとライブラリを使用してjpegに保存する方法はありますか?私が考えることができる唯一の選択肢は、コアグラフィックスを捨ててImageMagickを使用することです。