Revision: 2603 http://skim-app.svn.sourceforge.net/skim-app/?rev=2603&view=rev Author: hofman Date: 2007-08-03 09:40:12 -0700 (Fri, 03 Aug 2007)
Log Message: ----------- Take page rotation into account to decide for prinitng landscape. Modified Paths: -------------- trunk/SKDocument.m Modified: trunk/SKDocument.m =================================================================== --- trunk/SKDocument.m 2007-08-02 08:50:10 UTC (rev 2602) +++ trunk/SKDocument.m 2007-08-03 16:40:12 UTC (rev 2603) @@ -108,11 +108,13 @@ SKMainWindowController *mainController = (SKMainWindowController *)aController; if ([pdfDocument pageCount]) { + PDFPage *page = [pdfDocument pageAtIndex:0]; NSPrintInfo *printInfo = [self printInfo]; NSSize paperSize = [printInfo paperSize]; - NSSize pageSize = [[pdfDocument pageAtIndex:0] boundsForBox:kPDFDisplayBoxMediaBox].size; - if ((pageSize.width > pageSize.height) != (paperSize.width > paperSize.height)) - [printInfo setOrientation:NSLandscapeOrientation]; + NSSize pageSize = [page boundsForBox:kPDFDisplayBoxMediaBox].size; + BOOL isRotated = [page rotation] % 180 == 90; + BOOL isWide = (pageSize.width > pageSize.height) != (paperSize.width > paperSize.height); + [printInfo setOrientation:isRotated == isWide ? NSPortraitOrientation : NSLandscapeOrientation]; } [mainController setPdfDocument:pdfDocument]; 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 Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit