Re: PDFKit guidance
Re: PDFKit guidance
- Subject: Re: PDFKit guidance
- From: John Calhoun <email@hidden>
- Date: Fri, 20 Jun 2008 12:53:20 -0700
On Jun 20, 2008, at 5:21 AM, Adam R. Maxwell wrote:
If you want to draw in memory, I think you have to drop down to
Quartz; using PDFKit would likely be easier, but it looks like you
can only specify a Quartz filter when saving to a file?.
I think there may be some confusion with regards to drawing....
Antonio is correct that PDFPage has a -[drawWithBox:] method that is
used not simply for displaying to screen but also for rendering into a
PDF context for saving to file as well. So, you can still use
PDFPage, override -[drawWithBox:] in an app that has no intention of
displaying the PDF to screen.
The saving method is in PDFDocument. When called it walks through
each PDFPage in the document and calls it to render into a PDF
context. (Printing within PDF Kit does something similar, BTW.)
Optionally too, you can pass a QuartzFilter to the save method in
PDFDocument and get, for example, grayscale output.
You can also do something similar in Quartz with CGPDFDocumentRefs and
CGPDFPageRefs. The QuartzFilter stuff should work for CGContexts as
well.
There is I think a perception that PDF Kit is only for displaying
PDF's and I like to try to dispell that when I can. :-)
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