I've been having a problem with my application sometimes (but not always) 
printing the full page, but it appears VERY small in the lower-left corner of 
the page.

I was having trouble reproducing it, but finally received a sample document 
from one of my users that let me reproduce it.
Still, sometimes it prints correctly filling the page, other times, it prints 
scaled down in the lower-left corner of the page.

I am using NSPrintOperation from an NSDocument to handle the printing 
operations.

When trying to debug this issue, I examined the transformation from my view's 
drawRect method using CGContextGetCTM.
I discovered something interesting:
- When the printout appears scaled down, the transformation structure is the 
same as it is when the print preview image is rendered.
- When the printout appears full-sized, the transformation structure is the 
identity matrix (ie. scale = 100%)


Since the scale of the CGContext is the same when rendering the print preview 
as it is when rendering the full-sized page, this explains why my printouts are 
appearing very small in my output.

Values 'a' and 'd' in the CGAffineTransformation structure indicate the scaling 
factor and for the print preview, it makes sense that it is scaled down for the 
print preview. But somehow, the transformation is not being set back to 100% 
scaling for the actual printing.

I've looked for unbalanced CGContextSaveGState/CGContextRestoreGState calls, 
but they are all balanced.

I've spent too much time trying to debug this. If anyone can give any ideas why 
my printouts are appearing scaled down, I would appreciate any help.
Thanks.

-- 
gbeg...@gmail.com       http://www.GerrysCuppaTea.org/

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to