From 59f848b293548fd4dc2dc14677ae0d07b1f07daf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Katzer?= Date: Sun, 13 Jul 2014 13:09:42 +0200 Subject: [PATCH] Update iOS a bit --- src/ios/APPPrinter.m | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/ios/APPPrinter.m b/src/ios/APPPrinter.m index 00dbce6..2ce5ddd 100755 --- a/src/ios/APPPrinter.m +++ b/src/ios/APPPrinter.m @@ -104,7 +104,8 @@ { UIPrintInfo* printInfo = [UIPrintInfo printInfo]; - printInfo.outputType = UIPrintInfoOutputGeneral; + printInfo.outputType = UIPrintInfoOutputGeneral; + printInfo.orientation = UIPrintInfoOrientationPortrait; controller.printInfo = printInfo; controller.showsPageRange = YES; @@ -134,9 +135,14 @@ // Get formatter for web (note: margin not required - done in web page) UIViewPrintFormatter* formatter = [webPage viewPrintFormatter]; + formatter.contentInsets = UIEdgeInsetsMake(0.0f, 0.0f, 0.0f, 0.0f); - controller.printFormatter = formatter; - controller.showsPageRange = YES; + UIPrintPageRenderer* renderer = [[UIPrintPageRenderer alloc] init]; + renderer.headerHeight = -30.0f; + renderer.footerHeight = -30.0f; + [renderer addPrintFormatter:formatter startingAtPageAtIndex:0]; + + controller.printPageRenderer = renderer; } /** @@ -148,9 +154,7 @@ */ - (void) openPrintController:(UIPrintInteractionController*)controller { - //[self.commandDelegate runInBackground:^{ - [controller presentAnimated:YES completionHandler:NULL]; - //}]; + [controller presentAnimated:YES completionHandler:NULL]; } /**