FROM : Maryanna Rogers
DATE : Thu Jan 24 17:15:31 2008
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
DATE : Thu Jan 24 17:15:31 2008
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
| Related mails | Author | Date |
|---|---|---|
| Maryanna Rogers | Jan 24, 17:15 | |
| David Duncan | Jan 24, 18:48 | |
| John Calhoun | Jan 24, 23:47 | |
| David Duncan | Jan 25, 00:40 |






Cocoa mail archive

