Revision: 3229
http://skim-app.svn.sourceforge.net/skim-app/?rev=3229&view=rev
Author: hofman
Date: 2007-11-20 17:01:33 -0800 (Tue, 20 Nov 2007)
Log Message:
-----------
Set paperSize of print info. This automatically sets the orientation as well.
Modified Paths:
--------------
trunk/SKDocument.m
Modified: trunk/SKDocument.m
===================================================================
--- trunk/SKDocument.m 2007-11-20 16:21:44 UTC (rev 3228)
+++ trunk/SKDocument.m 2007-11-21 01:01:33 UTC (rev 3229)
@@ -142,13 +142,11 @@
PDFPage *page = [pdfDocument pageAtIndex:0];
NSPrintInfo *printInfo = [self printInfo];
NSSize pageSize = [page boundsForBox:kPDFDisplayBoxMediaBox].size;
- BOOL isWide = pageSize.width > pageSize.height;
- BOOL isRotated = [page rotation] % 180 == 90;
- NSPrintingOrientation requiredOrientation = isWide == isRotated ?
NSPortraitOrientation : NSLandscapeOrientation;
- NSPrintingOrientation currentOrientation = [printInfo orientation];
- if (requiredOrientation != currentOrientation) {
+ if ([page rotation] % 180 == 90)
+ pageSize = NSMakeSize(pageSize.height, pageSize.width);
+ if (NO == NSEqualSizes(pageSize, [printInfo paperSize])) {
printInfo = [printInfo copy];
- [printInfo setOrientation:requiredOrientation];
+ [printInfo setPaperSize:pageSize];
[self setPrintInfo:printInfo];
[printInfo release];
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit