You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+43-36Lines changed: 43 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,8 @@ Platform specific README exists for [Android](android/) and [iOS](ios/).
26
26
- The [Android NDK][install ndk]
27
27
- An [Android Virtual Device][managing avds] or a hardware device
28
28
29
+
#### Getting Started
30
+
29
31
1. Create a Flutter project called `pspdfkit_demo` with the `flutter` CLI:
30
32
31
33
```bash
@@ -47,19 +49,19 @@ Platform specific README exists for [Android](android/) and [iOS](ios/).
47
49
4. Modify the minimum SDK version, enable`multidex`, and set the Java compatibility to Java 8 to enable desugaring. All this is done inside the `android` section:
48
50
49
51
```diff
50
-
android {
51
-
defaultConfig {
52
+
android {
53
+
defaultConfig {
52
54
- minSdkVersion 16
53
55
+ minSdkVersion 21
54
-
...
56
+
...
55
57
+ multiDexEnabled true
56
-
...
58
+
}
59
+
57
60
+ compileOptions {
58
61
+ sourceCompatibility 1.8
59
62
+ targetCompatibility 1.8
60
63
+ }
61
-
...
62
-
}
64
+
}
63
65
```
64
66
65
67
5. Open `pubspec.yaml`:
@@ -71,9 +73,9 @@ Platform specific README exists for [Android](android/) and [iOS](ios/).
71
73
6. Add the PSPDFKit and `path_provider` dependencies in`pubspec.yaml`:
72
74
73
75
```diff
74
-
dependencies:
75
-
flutter:
76
-
sdk: flutter
76
+
dependencies:
77
+
flutter:
78
+
sdk: flutter
77
79
+ pspdfkit_flutter:
78
80
+ path_provider: ^0.4.1
79
81
```
@@ -92,9 +94,7 @@ Platform specific README exists for [Android](android/) and [iOS](ios/).
92
94
93
95
9. Open `lib/main.dart` and replace the entire content with the contents of [demo_project_main.dart.txt](doc/demo_project_main.dart.txt). This simple example will load a PDF document from local device filesystem.
94
96
95
-
10. In `lib/main.dart` replace `YOUR_LICENSE_KEY_GOES_HERE` with your PSPDFKit license key.
96
-
97
-
11. Add the PDF document you want to display in your project’s `assets` directory.
97
+
10. Add the PDF document you want to display in your project’s `assets` directory.
98
98
- First create a `PDFs` directory:
99
99
100
100
```bash
@@ -107,19 +107,19 @@ Platform specific README exists for [Android](android/) and [iOS](ios/).
107
107
cp ~/Downloads/Document.pdf PDFs/Document.pdf
108
108
```
109
109
110
-
12. Specify the `assets` directory in`pubspec.yaml`:
110
+
11. Specify the `assets` directory in`pubspec.yaml`:
111
111
112
112
```diff
113
-
# The following section is specific to Flutter.
114
-
flutter:
113
+
# The following section is specific to Flutter.
114
+
flutter:
115
115
+ assets:
116
116
+ - PDFs/
117
-
...
117
+
...
118
118
```
119
119
120
-
13. [Start your Android emulator][start-the-emulator], or connect a device.
120
+
12. [Start your Android emulator][start-the-emulator], or connect a device.
121
121
122
-
14. Run the app with:
122
+
13. Run the app with:
123
123
124
124
```bash
125
125
flutter run
@@ -164,9 +164,9 @@ Platform specific README exists for [Android](android/) and [iOS](ios/).
164
164
6. Add the PSPDFKit and `path_provider` dependencies in`pubspec.yaml`:
165
165
166
166
```diff
167
-
dependencies:
168
-
flutter:
169
-
sdk: flutter
167
+
dependencies:
168
+
flutter:
169
+
sdk: flutter
170
170
+ pspdfkit_flutter:
171
171
+ path_provider: ^0.4.1
172
172
```
@@ -194,17 +194,15 @@ Platform specific README exists for [Android](android/) and [iOS](ios/).
+ pod 'PSPDFKit', podspec:'https://customers.pspdfkit.com/pspdfkit-ios/latest.podspec'
200
-
end
200
+
end
201
201
```
202
202
203
203
11. Open `lib/main.dart` and replace the entire content with the contents of [demo_project_main.dart](doc/demo_project_main.dart). This simple example will load a PDF document from local device filesystem.
204
204
205
-
12. In `lib/main.dart` replace `YOUR_LICENSE_KEY_GOES_HERE` with your PSPDFKit license key.
206
-
207
-
13. Add the PDF document you want to display in your project’s `assets` directory.
205
+
12. Add the PDF document you want to display in your project’s `assets` directory.
208
206
- First create a `PDFs` directory:
209
207
210
208
```bash
@@ -217,25 +215,25 @@ Platform specific README exists for [Android](android/) and [iOS](ios/).
217
215
cp ~/Downloads/Document.pdf PDFs/Document.pdf
218
216
```
219
217
220
-
14. Specify the `assets` directory in`pubspec.yaml`:
218
+
13. Specify the `assets` directory in`pubspec.yaml`:
221
219
222
220
```diff
223
-
# The following section is specific to Flutter.
224
-
flutter:
221
+
# The following section is specific to Flutter.
222
+
flutter:
225
223
+ assets:
226
224
+ - PDFs/
227
-
...
225
+
...
228
226
```
229
227
230
-
15. Run `flutter emulators --launch apple_ios_simulator` to launch the iOS Simulator.
228
+
14. Run `flutter emulators --launch apple_ios_simulator` to launch the iOS Simulator.
231
229
232
-
16. Run the app with:
230
+
15. Run the app with:
233
231
234
232
```bash
235
233
flutter run
236
234
```
237
235
238
-
# Example
236
+
# Example App
239
237
240
238
To see PSPDFKit Flutter in action check out our [Flutter example app](example/).
241
239
@@ -245,6 +243,15 @@ Showing a PDF document inside your Flutter app is as simple as this:
245
243
Pspdfkit.present('file:///path/to/Document.pdf');
246
244
```
247
245
246
+
# Upgrading to a Full PSPDFKit License Key
247
+
248
+
PSPDFKit is a commercial product and requires the purchase of a license key when used in production. By default, this library will
249
+
initialize in demo mode, placing a watermark on each PDF and limiting usage to 60 minutes.
250
+
251
+
To purchase a license for production use, please reach out to us via https://pspdfkit.com/sales/form/.
252
+
253
+
To initialize PSPDFKit using a license key, call `Pspdfkit.setLicenseKey("...")` before using any other PSPDFKit APIs or features.
254
+
248
255
# Contributing
249
256
250
257
Please ensure [you signed our CLA](https://pspdfkit.com/guides/web/current/miscellaneous/contributing/) so we can accept your contributions.
@@ -279,8 +286,8 @@ FAILURE: Build failed with an exception.
279
286
A: If you were using version [1.10.3](https://github.com/PSPDFKit/pspdfkit-flutter/releases/tag/1.10.3) or earlier, you will need to update the imports in your Dart files like so:
0 commit comments