Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CGPDFPageGetDrawingTransform refuses to upscale



At 9:28 -0800 31/3/05, Derek Clegg wrote:
On Mar 31, 2005, at 5:02 AM, David Niemeijer wrote:

Hi,

I  am drawing a PDF page like this:

pageRef = CGPDFDocumentGetPage(inPDFDoc, 1) ;
pageTransform = CGPDFPageGetDrawingTransform (pageRef, kCGPDFArtBox, inRect, 0, true) ;
CGContextConcatCTM (inContext, pageTransform);
CGContextDrawPDFPage (inContext, pageRef);


What I am seeing is that the image scales as long as inRect is smaller than the artBox of the PDF, but as soon as inRect is larger than the artBox of the PDF no scaling occurs. So I can effectively downscale my image to fit a smaller inRect, but not upscale it to fit a larger inRect. This is on 10.3.8.

Am I doing something wrong? Should I use another method for drawing? Is there something I need to do to get upscaling or is this a bug?

For good or for ill, what you are seeing is the correct behavior.
For upscaling, the "easiest" thing to do is to scale the context yourself before using the drawing transform.

That surprises me. So basically, I should first look at my rectangle versus the artBox and if my rect is bigger I should manually scale the context to make up for the difference and then proceed as before? And, if my rect is smaller I should do what I have always done.


Why was this chosen as the correct behavior, it seems to make life more complex for developers?

Thanks,

david.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartz-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartz-dev/email@hidden

This email sent to email@hidden
References: 
 >CGPDFPageGetDrawingTransform refuses to upscale (From: David Niemeijer <email@hidden>)
 >Re: CGPDFPageGetDrawingTransform refuses to upscale (From: Derek Clegg <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.