From ea404a0acdac0d1f13c3c5f8e481a0b7d63c7e4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Katzer?= Date: Sat, 23 Jul 2016 14:06:59 +0200 Subject: [PATCH] Several iOS specific options (closes #59) --- CHANGELOG.md | 1 + src/ios/APPPrinter.m | 5 ++++- www/printer.js | 6 ++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a71a0f8..7578f04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - [enhancement:] `print` returns bool value to indicate the result - [enhancement:] Added missing `duplex` support (Android) - [__change__:] `duplex` requires a string (`none`, `long` or `short`) +- [enhancement:] Support for `hidePageRange`, `hideNumberOfCopies` and `hidePaperFormat` (iOS specific) #### Version 0.7.1 (23.04.2015) diff --git a/src/ios/APPPrinter.m b/src/ios/APPPrinter.m index 6318ebc..e741994 100755 --- a/src/ios/APPPrinter.m +++ b/src/ios/APPPrinter.m @@ -140,7 +140,10 @@ printInfo.jobName = [settings objectForKey:@"name"]; controller.printInfo = printInfo; - controller.showsPageRange = NO; + + controller.showsPageRange = ![[settings objectForKey:@"hidePageRange"] boolValue]; + controller.showsNumberOfCopies = ![[settings objectForKey:@"hideNumberOfCopies"] boolValue]; + controller.showsPaperSelectionForLoadedPapers = ![[settings objectForKey:@"hidePaperFormat"] boolValue]; return controller; } diff --git a/www/printer.js b/www/printer.js index b3fd318..dcd8ca6 100755 --- a/www/printer.js +++ b/www/printer.js @@ -28,10 +28,16 @@ var exec = require('cordova/exec'); */ exports.getDefaults = function () { return { + // Platform independent name: 'unknown', duplex: 'none', landscape: false, graystyle: false, + // iOS specific + hidePageRange: false, + hideNumberOfCopies: false, + hidePaperFormat: false, + // iPad specific bounds: [40, 30, 0, 0] }; };