Search code examples
iphonepdfpdf-generationquartz-2d

Reduce the size of PDF file generated with Quartz2D


I'm looking for a way to reduce PDF size that I generate with Quartz. I'm drawing images with CGContextDrawImage in a CGPDFContext. What I'm afraid of is that the images are saved as Bitmap and not JPEG. Is there a way to check for that and a way to control that when writing the PDF?

I also tried reducing downscaling the image before writing it to the PDF context but I end up with an even larger file (although the page size in pixels is smaller).

Thanks!


Solution

  • There is no public API for setting CGPDFContext's image compression settings.