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

View File

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