Set number of copies for iOS

This commit is contained in:
Sebastián Katzer 2019-01-03 16:52:10 +01:00
parent c19cec7415
commit 7905b71feb
2 changed files with 4 additions and 4 deletions

View File

@ -337,6 +337,7 @@
UIPrintInfoOrientation orientation = UIPrintInfoOrientationPortrait; UIPrintInfoOrientation orientation = UIPrintInfoOrientationPortrait;
UIPrintInfoOutputType outputType = UIPrintInfoOutputGeneral; UIPrintInfoOutputType outputType = UIPrintInfoOutputGeneral;
UIPrintInfoDuplex duplexMode = UIPrintInfoDuplexNone; UIPrintInfoDuplex duplexMode = UIPrintInfoDuplexNone;
long copies = MAX([settings[@"copies"] longValue], 1);
if ([settings[@"landscape"] boolValue]) { if ([settings[@"landscape"] boolValue]) {
orientation = UIPrintInfoOrientationLandscape; orientation = UIPrintInfoOrientationLandscape;
@ -355,11 +356,12 @@
duplexMode = UIPrintInfoDuplexShortEdge; duplexMode = UIPrintInfoDuplexShortEdge;
} }
[printInfo setValue:[NSNumber numberWithLong:copies] forKey:@"_copies"];
printInfo.outputType = outputType; printInfo.outputType = outputType;
printInfo.orientation = orientation; printInfo.orientation = orientation;
printInfo.duplex = duplexMode; printInfo.duplex = duplexMode;
printInfo.jobName = settings[@"name"]; printInfo.jobName = settings[@"name"];
controller.printInfo = printInfo; controller.printInfo = printInfo;
controller.showsNumberOfCopies = ![settings[@"hideNumberOfCopies"] boolValue]; controller.showsNumberOfCopies = ![settings[@"hideNumberOfCopies"] boolValue];

View File

@ -28,16 +28,14 @@ var exec = require('cordova/exec');
*/ */
exports.getDefaults = function () { exports.getDefaults = function () {
return { return {
// Platform independent
name: 'unknown', name: 'unknown',
duplex: 'none', duplex: 'none',
landscape: false, landscape: false,
graystyle: false, graystyle: false,
// iOS specific
border: true, border: true,
copies: 1,
hideNumberOfCopies: false, hideNumberOfCopies: false,
hidePaperFormat: false, hidePaperFormat: false,
// iPad specific
bounds: [40, 30, 0, 0] bounds: [40, 30, 0, 0]
}; };
}; };