From 783cc42613d4c88b7976c5993fc89da784d3032a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Katzer?= Date: Thu, 24 Jan 2019 12:08:38 +0100 Subject: [PATCH] Support for maxPages to be able to skip possible empty last pages --- src/ios/APPPrinterRenderer.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ios/APPPrinterRenderer.m b/src/ios/APPPrinterRenderer.m index a0e0133..8edbe8b 100644 --- a/src/ios/APPPrinterRenderer.m +++ b/src/ios/APPPrinterRenderer.m @@ -66,6 +66,14 @@ return self; } +- (NSInteger) numberOfPages +{ + NSInteger num = [super numberOfPages]; + id maxPages = _settings[@"maxPages"]; + + return maxPages ? MIN(num, [maxPages longValue]) : num; +} + #pragma mark - #pragma mark Callbacks