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 396
396
GCC_THUMB_SUPPORT = NO;
397
397
GCC_VERSION = "";
398
398
INFOPLIST_FILE = "CordovaDemo/CordovaDemo-Info.plist";
399
- IPHONEOS_DEPLOYMENT_TARGET = 9 .0;
399
+ IPHONEOS_DEPLOYMENT_TARGET = 10 .0;
400
400
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
401
401
PRODUCT_NAME = CordovaDemo;
402
402
};
420
420
GCC_THUMB_SUPPORT = NO;
421
421
GCC_VERSION = "";
422
422
INFOPLIST_FILE = "CordovaDemo/CordovaDemo-Info.plist";
423
- IPHONEOS_DEPLOYMENT_TARGET = 9 .0;
423
+ IPHONEOS_DEPLOYMENT_TARGET = 10 .0;
424
424
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
425
425
PRODUCT_NAME = CordovaDemo;
426
426
};
Original file line number Diff line number Diff line change @@ -410,6 +410,11 @@ - (NSURL *)pdfFileURLWithPath:(NSString *)path
410
410
return nil ;
411
411
}
412
412
413
+ - (BOOL )isImagePath : (NSString *)path {
414
+ NSString *pathExtension = path.pathExtension .lowercaseString ;
415
+ return [pathExtension isEqualToString: @" png" ] || [pathExtension isEqualToString: @" jpeg" ] || [pathExtension isEqualToString: @" jpg" ];
416
+ }
417
+
413
418
- (NSInteger )enumValueForKey : (NSString *)key ofType : (NSString *)type withDefault : (int )defaultValue
414
419
{
415
420
NSNumber *number = key? [self enumValuesOfType: type][key]: nil ;
@@ -1010,7 +1015,12 @@ - (void)present:(CDVInvokedUrlCommand *)command {
1010
1015
if (path) {
1011
1016
// configure document
1012
1017
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
+ }
1014
1024
[self setOptions: newOptions forObject: _pdfDocument animated: NO ];
1015
1025
}
1016
1026
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " pspdfkit-cordova-ios" ,
3
- "version" : " 1.2.2 " ,
3
+ "version" : " 1.2.3 " ,
4
4
"description" : " PSPDFKit Cordova Plugin for iOS" ,
5
5
"cordova" : {
6
6
"id" : " pspdfkit-cordova-ios" ,
Original file line number Diff line number Diff line change 1
1
<?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" >
3
3
<engines >
4
4
<engine name =" cordova" version =" >=6.3.1" />
5
5
</engines >
You can’t perform that action at this time.
0 commit comments