File tree Expand file tree Collapse file tree 6 files changed +15
-5
lines changed
Expand file tree Collapse file tree 6 files changed +15
-5
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
Original file line number Diff line number Diff line change 11{
22 "name" : " pspdfkit-cordova-ios" ,
3- "version" : " 1.2.2 " ,
3+ "version" : " 1.2.3 " ,
44 "description" : " PSPDFKit Cordova Plugin for iOS" ,
55 "cordova" : {
66 "id" : " pspdfkit-cordova-ios" ,
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
2- <plugin id =" pspdfkit-cordova-ios" version =" 1.2.2 " xmlns =" http://apache.org/cordova/ns/plugins/1.0" xmlns : android =" http://schemas.android.com/apk/res/android" >
2+ <plugin id =" pspdfkit-cordova-ios" version =" 1.2.3 " xmlns =" http://apache.org/cordova/ns/plugins/1.0" xmlns : android =" http://schemas.android.com/apk/res/android" >
33 <engines >
44 <engine name =" cordova" version =" >=6.3.1" />
55 </engines >
You can’t perform that action at this time.
0 commit comments