Re: Scaling CGPDFPageRefs
Re: Scaling CGPDFPageRefs
- Subject: Re: Scaling CGPDFPageRefs
- From: John Calhoun <email@hidden>
- Date: Thu, 24 Jan 2008 14:47:55 -0800
On Jan 24, 2008, at 8:15 AM, Maryanna Rogers wrote:
I've tried things like the following, with no luck:
CGPDFPageRef page = CGPDFDocumentGetPage(doc, 1);
CGAffineTransform m = CGPDFPageGetDrawingTransform (page,
kCGPDFMediaBox, CGRectMake(0, 0, 50, 50), 0, true);
CGContextConcatCTM (myPDFContext, m);
CGContextClipToRect (myPDFContext, CGRectMake(0, 0, 4, 4));
CGContextDrawPDFPage(myBitmapContext, page);
That looks close. When you say "no luck" what do you mean? No pixels?
On Jan 24, 2008, at 9:48 AM, David Duncan wrote:
Do what you would do for any other content you wanted to scale, just
add an additional scaling transform. For example, if you wanted to
scale to 200%, you would also call "CGContextScaleCTM(context, 2.0,
2.0)" before you draw the image.
I think call to CGPDFPageGetDrawingTransform() takes care of the scale
since a destination rectangle is passed in.
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