File tree Expand file tree Collapse file tree 4 files changed +13
-3
lines changed
Expand file tree Collapse file tree 4 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 396396 GCC_THUMB_SUPPORT = NO;
397397 GCC_VERSION = "";
398398 INFOPLIST_FILE = "CordovaDemo/CordovaDemo-Info.plist";
399- IPHONEOS_DEPLOYMENT_TARGET = 9 .0;
399+ IPHONEOS_DEPLOYMENT_TARGET = 10 .0;
400400 LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
401401 PRODUCT_NAME = CordovaDemo;
402402 };
420420 GCC_THUMB_SUPPORT = NO;
421421 GCC_VERSION = "";
422422 INFOPLIST_FILE = "CordovaDemo/CordovaDemo-Info.plist";
423- IPHONEOS_DEPLOYMENT_TARGET = 9 .0;
423+ IPHONEOS_DEPLOYMENT_TARGET = 10 .0;
424424 LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
425425 PRODUCT_NAME = CordovaDemo;
426426 };
Original file line number Diff line number Diff line change @@ -410,6 +410,11 @@ - (NSURL *)pdfFileURLWithPath:(NSString *)path
410410 return nil ;
411411}
412412
413+ - (BOOL )isImagePath : (NSString *)path {
414+ NSString *pathExtension = path.pathExtension .lowercaseString ;
415+ return [pathExtension isEqualToString: @" png" ] || [pathExtension isEqualToString: @" jpeg" ] || [pathExtension isEqualToString: @" jpg" ];
416+ }
417+
413418- (NSInteger )enumValueForKey : (NSString *)key ofType : (NSString *)type withDefault : (int )defaultValue
414419{
415420 NSNumber *number = key? [self enumValuesOfType: type][key]: nil ;
@@ -1010,7 +1015,12 @@ - (void)present:(CDVInvokedUrlCommand *)command {
10101015 if (path) {
10111016 // configure document
10121017 NSURL *url = [self pdfFileURLWithPath: path];
1013- _pdfDocument = [[PSPDFDocument alloc ] initWithURL: url];
1018+ if ([self isImagePath: path]) {
1019+ _pdfDocument = [[PSPDFImageDocument alloc ] initWithImageURL: url];
1020+ }
1021+ else {
1022+ _pdfDocument = [[PSPDFDocument alloc ] initWithURL: url];
1023+ }
10141024 [self setOptions: newOptions forObject: _pdfDocument animated: NO ];
10151025 }
10161026
You can’t perform that action at this time.
0 commit comments