2
Следующий код преобразует PDF-страницу в JPEG. Он работает, как ожидалось на Snow Leopard:Можно ли сохранить изображение с помощью Core Graphics на iPhone?
...
//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, так как версия iPhone от Core Graphics не включает CGImageDestinationRef
. Есть ли способ сохранить CFImageRef
в jpeg, используя собственные фреймворки и библиотеки iPhone? Единственная альтернатива, о которой я могу думать, - это вырезать Core Graphics и использовать ImageMagick.