Re: Compress PDF
Re: Compress PDF
- Subject: Re: Compress PDF
- From: John Calhoun <email@hidden>
- Date: Mon, 30 Jul 2007 13:26:00 -0700
On Jul 29, 2007, at 9:03 AM, Dominik Pich wrote:
Now I want to take the generated PDF and resave it as a compressed
PDF. (like automator can do)
How can I do that?
I looked into PDFKit and read about CGPdfContext but didnt find
anything.
If this is Leopard, it is pretty straightforward. You need to create a
QuatzFilter that does the compression (look in Quartz.framework/
Frameworks/QuartzFilters/ for the headers).
You can pass this QuartzFilter in a dictionary to -[PDFDocument
writeFile/URL: withOptions:] (a class in PDF Kit). I think the header
file for PDFDocument on Leopard has some comments to this effect. Here:
// Methods to record the current state of the PDFDocument as data or a
file. Passing a QuartzFilter object in the
// options dictionary with the key @"QuartzFilter" will allow you to
have the filter applied when saving the PDF.
- (NSData *) dataRepresentation;
- (BOOL) writeToFile: (NSString *) path;
- (BOOL) writeToFile: (NSString *) path withOptions: (NSDictionary *)
options;
- (BOOL) writeToURL: (NSURL *) url;
- (BOOL) writeToURL: (NSURL *) url withOptions: (NSDictionary *)
options;
john calhoun—_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >Compress PDF (From: Dominik Pich <email@hidden>) |