• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How can I create a multipage PDF?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >How can I create a multipage PDF? (From: Jerry LeVan <email@hidden>)
 >Re: How can I create a multipage PDF? (From: Antonio Nunes <email@hidden>)

  • Prev by Date: Re: NSStatusItem position problem
  • Next by Date: Overriding NSTextView's toggleAutomaticQuoteSubstitution, special considerations?
  • Previous by thread: Re: How can I create a multipage PDF?
  • Next by thread: Making sure my code will run on Tiger 10.4 when I'm compiling on Leopard 10.5.
  • Index(es):
    • Date
    • Thread