Revision: 6994
          http://skim-app.svn.sourceforge.net/skim-app/?rev=6994&view=rev
Author:   hofman
Date:     2010-12-20 00:06:56 +0000 (Mon, 20 Dec 2010)

Log Message:
-----------
override print operation method so printing from application scripting works

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

Modified: trunk/SKMainDocument.m
===================================================================
--- trunk/SKMainDocument.m      2010-12-19 22:34:39 UTC (rev 6993)
+++ trunk/SKMainDocument.m      2010-12-20 00:06:56 UTC (rev 6994)
@@ -880,6 +880,18 @@
     [[self pdfView] printWithInfo:[self printInfo] autoRotate:autoRotate 
pageScaling:pageScaling];
 }
 
+- (NSPrintOperation *)printOperationWithSettings:(NSDictionary *)printSettings 
error:(NSError **)outError {
+    NSPrintOperation *printOperation = nil;
+    SKPDFDocument *pdfDoc = (SKPDFDocument *)[self pdfDocument];
+    NSPrintInfo *printInfo = [[[self printInfo] copy] autorelease];
+    BOOL autoRotate = [[printInfo 
valueForKeyPath:@"dictionary.PDFPrintAutoRotate"] boolValue];
+    [[printInfo dictionary] addEntriesFromDictionary:printSettings];
+    printOperation = [pdfDoc getPrintOperationForPrintInfo:printInfo 
autoRotate:autoRotate];
+    if (printOperation == nil)
+        printOperation = [super printOperationWithSettings:printSettings 
error:outError];
+    return printOperation;
+}
+
 - (void)readNotesFromURL:(NSURL *)notesURL replace:(BOOL)replace {
     NSString *extension = [[notesURL path] pathExtension];
     NSArray *array = nil;

Modified: trunk/SKPDFDocument.h
===================================================================
--- trunk/SKPDFDocument.h       2010-12-19 22:34:39 UTC (rev 6993)
+++ trunk/SKPDFDocument.h       2010-12-20 00:06:56 UTC (rev 6994)
@@ -42,6 +42,7 @@
 extern NSString *SKSuppressPrintPanel;
 
 @interface SKPDFDocument : PDFDocument
+- (NSPrintOperation *)getPrintOperationForPrintInfo:(NSPrintInfo *)printInfo 
autoRotate:(BOOL)autoRotate;
 @end
 
 @interface NSObject (SKPDFDocumentDelegate)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to