Revision: 2663
http://skim-app.svn.sourceforge.net/skim-app/?rev=2663&view=rev
Author: hofman
Date: 2007-08-15 10:36:38 -0700 (Wed, 15 Aug 2007)
Log Message:
-----------
Always set the print orientation, as the user may have landscape set as
default.
Modified Paths:
--------------
trunk/SKDocument.m
Modified: trunk/SKDocument.m
===================================================================
--- trunk/SKDocument.m 2007-08-15 13:13:44 UTC (rev 2662)
+++ trunk/SKDocument.m 2007-08-15 17:36:38 UTC (rev 2663)
@@ -112,13 +112,14 @@
if ([pdfDocument pageCount]) {
PDFPage *page = [pdfDocument pageAtIndex:0];
NSPrintInfo *printInfo = [self printInfo];
- NSSize paperSize = [printInfo paperSize];
NSSize pageSize = [page boundsForBox:kPDFDisplayBoxMediaBox].size;
+ BOOL isWide = pageSize.width > pageSize.height;
BOOL isRotated = [page rotation] % 180 == 90;
- BOOL isWide = (pageSize.width > pageSize.height) != (paperSize.width >
paperSize.height);
- if (isRotated != isWide) {
+ NSPrintingOrientation requiredOrientation = isWide == isRotated ?
NSPortraitOrientation : NSLandscapeOrientation;
+ NSPrintingOrientation currentOrientation = [printInfo orientation];
+ if (requiredOrientation != currentOrientation) {
printInfo = [printInfo copy];
- [printInfo setOrientation:NSLandscapeOrientation];
+ [printInfo setOrientation:requiredOrientation];
[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: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit