Revision: 3937
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3937&view=rev
Author:   hofman
Date:     2008-05-30 05:14:32 -0700 (Fri, 30 May 2008)

Log Message:
-----------
Use global default paper size for printing. Only set orientation if necessary.

Modified Paths:
--------------
    trunk/SKPDFDocument.m

Modified: trunk/SKPDFDocument.m
===================================================================
--- trunk/SKPDFDocument.m       2008-05-29 17:23:19 UTC (rev 3936)
+++ trunk/SKPDFDocument.m       2008-05-30 12:14:32 UTC (rev 3937)
@@ -149,13 +149,12 @@
         PDFPage *page = [pdfDocument pageAtIndex:0];
         NSPrintInfo *printInfo = [self printInfo];
         NSSize pageSize = [page boundsForBox:kPDFDisplayBoxMediaBox].size;
+        BOOL isLandscape = [page rotation] % 180 == 90 ? pageSize.height > 
pageSize.width : pageSize.width > pageSize.height;
         
         printInfo = [printInfo copy];
-        [printInfo setValue:[NSNumber numberWithBool:autoRotate] 
forKeyPath:@"dictionary.PDFPrintAutoRotate"];
-        if ([page rotation] % 180 == 90)
-            pageSize = NSMakeSize(pageSize.height, pageSize.width);
-        if (NO == NSEqualSizes(pageSize, [printInfo paperSize]))
-            [printInfo setPaperSize:pageSize];
+        [[printInfo dictionary] setValue:[NSNumber numberWithBool:autoRotate] 
forKey:@"PDFPrintAutoRotate"];
+        if (isLandscape)
+            [printInfo setOrientation:NSLandscapeOrientation];
         [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 2008.
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

Reply via email to