Re: PDFKit guidance
Re: PDFKit guidance
- Subject: Re: PDFKit guidance
- From: "Adam R. Maxwell" <email@hidden>
- Date: Fri, 20 Jun 2008 08:21:04 -0400
On Jun 20, 2008, at 7:47 AM, Torsten Curdt wrote:
On Jun 20, 2008, at 13:09, Antonio Nunes wrote:
On 20 Jun 2008, at 11:07, Torsten Curdt wrote:
you can't go wrong by reading the "Cocoa
Drawing Guide."
Surely will read through that. Because frankly speaking I didn't
think this was Quartz related.
Well, you need to know how to generally draw in Cocoa, and you need
to know how to take advantage of PDFKit, so both John Calhoun and
Joel Norvell provided useful pointers.
The scaling is done when a PDFPage needs to be drawn, so you need
to implement it in your subclass's drawWithBox: method. Use an
affine transform set up to serve your needs and apply it to the
current graphics context within the drawWithBox: method before
drawing the page.
Right. The point though is - I don't really want to display it. So I
did not look into the drawing side of things. But I guess I just
read up on the Quartz stuff and then get back to you guys (if
needed). I assume one could also draw in memory - without
displaying. Just didn't know that's the right direction.
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?.
You should be able to create your own CGPDFContext with
kCGPDFXDestinationOutputProfile set to an ICC-based grayscale
colorspace, then draw your PDF pages into that context. If you use
CGPDFDocument, be careful when you use CGContextDrawPDFPage, since it
only scales down, not up; you'll need to add an appropriate scale
transform to the context (and deal with rotated pages).
--
Adam
_______________________________________________
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