Skip to content

Commit a68ddbe

Browse files
authored
Merge pull request #75 from PSPDFKit/rad/image-documents
Add the ability to present Image Documents
2 parents 5fa6f7a + 0760b7b commit a68ddbe

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ The [PSPDFKit SDK](https://pspdfkit.com/) is a framework that allows you to view
1919

2020
#### Requirements
2121

22-
- Xcode 9.4
23-
- PSPDFKit 7.6 for iOS or later
22+
- Xcode 9.4.1
23+
- PSPDFKit 7.6.1 for iOS or later
2424
- react-native >= 0.55.4
2525

2626
#### Getting Started

ios/RCTPSPDFKit/Converters/RCTConvert+PSPDFDocument.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@ + (PSPDFDocument *)PSPDFDocument:(NSString *)string {
2020
url = [NSBundle.mainBundle URLForResource:string withExtension:nil];
2121
}
2222

23-
return [[PSPDFDocument alloc] initWithURL:url];
23+
NSString *fileExtension = url.pathExtension.lowercaseString;
24+
BOOL isImageFile = [fileExtension isEqualToString:@"png"] || [fileExtension isEqualToString:@"jpeg"] || [fileExtension isEqualToString:@"jpg"];
25+
if (isImageFile) {
26+
return [[PSPDFImageDocument alloc] initWithImageURL:url];
27+
} else {
28+
return [[PSPDFDocument alloc] initWithURL:url];
29+
}
2430
}
2531

2632
@end

ios/cocoapods.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
### CocoaPods integration
44

55
#### Requirements
6-
- Xcode 9
7-
- PSPDFKit >=7.0.2
8-
- react-native >= 0.48.4
9-
- CocoaPods >= 1.3.1
6+
- Xcode 9.4.1
7+
- PSPDFKit 7.6.1 for iOS or later
8+
- react-native >= 0.55.4
9+
- CocoaPods >= 1.5.3
1010

1111
#### Getting Started
1212

@@ -19,7 +19,7 @@ Lets create a simple app that integrates PSPDFKit using CocoaPods.
1919
5. IMPORTANT: Do not link module react-native-pspdfkit: Do not use react-native link react-native-pspdfkit
2020
6. Create the folder `ios/PSPDFKit` and copy `PSPDFKit.framework` and `PSPDFKitUI.framework` into it.
2121
7. Open ios/YourApp.xcodeproj in Xcode: open ios/YourApp.xcodeproj
22-
8. Make sure the deployment target is set to 9.0 or higher:
22+
8. Make sure the deployment target is set to 10.0 or higher:
2323
![Deployment Target](../screenshots/deployment-target.png)
2424
9. Change "View controller-based status bar appearance" to YES in Info.plist:
2525
deployment-target.png

0 commit comments

Comments
 (0)