Reduce the size of the PDF file generated by Quartz2D

I am looking for a way to reduce the size of a PDF that I create using Quartz. I draw images using CGContextDrawImage in CGPDFContext. I am afraid that images are saved as bitmap rather than JPEG. Is there a way to check this and a way to control this when writing a PDF?

I also tried to reduce the zoom out before writing it to the PDF context, but in the end I got an even larger file (although the page size in pixels is smaller).

Thanks!

+6
iphone pdf pdf-generation quartz-2d
source share
2 answers

There is no public API for configuring CGPDFContext compression CGPDFContext .

+1
source share

I would not be surprised if you need to reduce PDF on iPhone or if you need to reduce them on PC / Mac.

On a PC / Mac, Adobe Acrobat Pro (a commercial product that cannot be mistaken with Adobe Reader) PDF Optimizer. Adaptation Menu> PDF Optimizer ... This can reduce images, fonts, etc. There is also a command line interface (using AutoBatch) . It is not cheap, but it is probably the best PDF compressor.

0
source share

All Articles