Re: How can I create a multipage PDF?
Re: How can I create a multipage PDF?
- Subject: Re: How can I create a multipage PDF?
- From: Antonio Nunes <email@hidden>
- Date: Tue, 11 Dec 2007 20:29:47 +0000
On Dec 11, 2007, at 3:06 PM, Jerry LeVan wrote:
How can I reduce the size of the pdf generated by the following code ?
From PDFDocument.h:
// 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.
So I guess you could adjust your code to pass in a quartz filter that
reduces the file size:
[myBook writeToFile:@"/Users/jerry/Desktop/Book.pdf"
withOptions:optionsDictWithQuartzFilter];
I know next to nothing about Quartz filters, all I can say is that the
following seems to work:
NSArray *filters = [QuartzFilterManager filtersInDomains:[NSArray
arrayWithObject:@"QuartzFilterPDFWorkflowDomain"]];
QuartzFilter *f = [filters objectAtIndex:6];
[optionsDictWithQuartzFilter setObject:f forKey:@"QuartzFilter"];
But I'd be surprised if this is the best - or even a good - way to get
at the Reduce File Size filter. (This filter works by downsampling
images in a PDF file and turning them into jpg, if I am not mistaken,
so it should produce good results with the files you are targeting. Of
course, the image quality will suffer.
-António
-----------------------------------------
Forgiveness is not an occasional act;
it is a permanent attitude.
--Martin Luther King, Jr
-----------------------------------------
_______________________________________________
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