duplex accepts an string now instead of boolean

This commit is contained in:
Sebastián Katzer
2016-07-23 13:48:24 +02:00
parent 43c325317a
commit 031f4b385a
3 changed files with 20 additions and 11 deletions

View File

@@ -117,6 +117,7 @@
UIPrintInfo* printInfo = [UIPrintInfo printInfo];
UIPrintInfoOrientation orientation = UIPrintInfoOrientationPortrait;
UIPrintInfoOutputType outputType = UIPrintInfoOutputGeneral;
UIPrintInfoDuplex duplexMode = UIPrintInfoDuplexNone;
if ([[settings objectForKey:@"landscape"] boolValue]) {
orientation = UIPrintInfoOrientationLandscape;
@@ -126,10 +127,17 @@
outputType = UIPrintInfoOutputGrayscale;
}
if ([[settings objectForKey:@"duplex"] isEqualToString:@"long"]) {
duplexMode = UIPrintInfoDuplexLongEdge;
} else
if ([[settings objectForKey:@"duplex"] isEqualToString:@"short"]) {
duplexMode = UIPrintInfoDuplexShortEdge;
}
printInfo.outputType = outputType;
printInfo.orientation = orientation;
printInfo.duplex = duplexMode;
printInfo.jobName = [settings objectForKey:@"name"];
printInfo.duplex = [[settings objectForKey:@"duplex"] boolValue];
controller.printInfo = printInfo;
controller.showsPageRange = NO;