Scaling CGPDFPageRefs
Scaling CGPDFPageRefs
- Subject: Scaling CGPDFPageRefs
- From: "Maryanna Rogers" <email@hidden>
- Date: Thu, 24 Jan 2008 11:15:31 -0500
Hi,
I'm trying to load a pdf file, scale some portion of it (zoom in, for
example), and draw this scaled result to a CGBitmapContext.
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);
I'm not comfortable with the transformations I've done here, but it's
all I've been able to find in the Apple documentation.
Again, what I would like to do, is have an existing bitmap context of
a given size (128 x 128, for example), and draw scaled subregions of a
given PDF document page into that bitmap context. Is there a simple
way to do this?
Thanks!
~m
_______________________________________________
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