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: CHANGELOG.md
+14-2
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,28 @@
1
1
## Newest Release
2
2
3
+
### 3.8.0 - 06 Feb 2024
4
+
- Adds Flutter for Web support. (#42151)
5
+
- Replaces configuration `Map` with a dedicated `PdfConfiguration` class. (#42191)
6
+
- Deprecates imports for `package:pspdfkit_flutter/widgets/pspdfkit_widget.dart` and `package:pspdfkit_flutter/widgets/pspdfkit_widget_controller.dart`.
7
+
Use `package:pspdfkit_flutter/pspdfkit.dart` instead. (#43254)
8
+
- Updates for PSPDFKit 2024.1.0 for Android. (#43305)
9
+
- Updates for PSPDFKit 13.3.0 for iOS. (#43305)
10
+
- Compile SDK version 34 is now required on Android. (#43305)
11
+
12
+
## Previous Releases
13
+
3
14
### 3.7.2 - 12 Jan 2024
4
15
5
16
- Adds `flutterPdfFragmentAdded` callback for Android. (#42631)
6
17
- Updates FlutterAppCompatActivity to Support Flutter 3.16.0. (#42767)
7
18
8
-
## Previous Releases
9
-
10
19
### 3.7.1 - 18 Oct 2023
11
20
12
21
- Fixes issue where iOS Appstore upload fails due to PSPDFKit Flutter missing "CFBundleShortVersionString" key. (#42166)
13
22
- Fixes issue where Plugin returned "Document is missing or invalid" during pdfViewControllerWillDismiss events. (#42255)
23
+
- Upgrades compileSDKVersion to 34. (#42293)
24
+
- Upgrades Android Gradle Plugin to 8.1.2. (#42293)
Copy file name to clipboardexpand all lines: README.md
+123-127
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,55 @@ Platform specific README exists for [Android](android/) and [iOS](ios/).
23
23
24
24
## Integration into a New Flutter App
25
25
26
+
### Install PSPDFKit Flutter Plugin
27
+
28
+
1. Open `pubspec.yaml`:
29
+
30
+
```bash
31
+
open pubspec.yaml
32
+
```
33
+
34
+
2. Add the PSPDFKit dependency in`pubspec.yaml`:
35
+
36
+
```diff
37
+
dependencies:
38
+
flutter:
39
+
sdk: flutter
40
+
+ pspdfkit_flutter: any
41
+
```
42
+
43
+
44
+
3. 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.
45
+
46
+
4. Add the PDF document you want to display in your project’s `assets` directory.
47
+
- First create a `PDFs` directory:
48
+
49
+
```bash
50
+
mkdir PDFs
51
+
```
52
+
53
+
- Move a [sample document](example/PDFs/PSPDFKit.pdf) into the newly created `PDFs` directory, and rename it as `Document.pdf`:
54
+
55
+
```bash
56
+
cp ~/Downloads/PSPDFKit.pdf PDFs/Document.pdf
57
+
```
58
+
59
+
5. Specify the `assets` directory in`pubspec.yaml`:
60
+
61
+
```diff
62
+
# The following section is specific to Flutter.
63
+
flutter:
64
+
+ assets:
65
+
+ - PDFs/
66
+
...
67
+
```
68
+
69
+
6. From the terminal app, run the following command to get all the packages:
70
+
71
+
```bash
72
+
flutter pub get
73
+
```
74
+
26
75
### Android
27
76
28
77
#### Requirements
@@ -45,118 +94,79 @@ Platform specific README exists for [Android](android/) and [iOS](ios/).
45
94
```bash
46
95
cd pspdfkit_demo
47
96
```
48
-
3. Open the project’s main activity class, `android/app/src/main/kotlin/com/example/pspdfkit_demo/pspdfkit_demo/MainActivity.kt`:
49
97
50
-
```bash
51
-
open android/app/src/main/kotlin/com/example/pspdfkit_demo/pspdfkit_demo/MainActivity.kt
52
-
```
53
-
54
-
4. Modify the base from `FlutterActivity` to `FlutterFragmentActivity`:
11. From the terminal app, run the following command to get all the packages:
127
+
6. Open the project’s main activity class, `android/app/src/main/kotlin/com/example/pspdfkit_demo/pspdfkit_demo/MainActivity.kt`:
121
128
122
129
```bash
123
-
flutter pub get
130
+
open android/app/src/main/kotlin/com/example/pspdfkit_demo/pspdfkit_demo/MainActivity.kt
124
131
```
125
132
126
-
12. Then run the command below to upgrade the dependencies:
133
+
7. Change the base `Activity` to extend `FlutterAppCompatActivity`:
127
134
128
-
```bash
129
-
flutter pub upgrade
130
-
```
131
-
132
-
13. 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.
133
-
134
-
14. Add the PDF document you want to display in your project’s `assets` directory.
**NOTE:**<code>FlutterAppCompatActivity</code> isn’t an official part of the Flutter SDK. It’s a custom <code>Activity</code> that extends <code>AppCompatActivity</code> from the AndroidX AppCompat library, and it’s necessary to use PSPDFKit forAndroid with Flutter. You can read more about thisin the [AppCompatActivity Migration][] guide.
146
158
147
-
15. Specify the `assets` directory in`pubspec.yaml`:
159
+
8. Update the theme in`android/app/src/main/res/values/styles.xml` to use `PSPDFKit.Theme.default` as the parent:
This is to customize the theme of the PSPDFKit UI. You can read more about this in the [appearance styling][] guide.
156
166
157
-
16. [Start your Android emulator][start-the-emulator], or connect a device.
167
+
9. [Start your Android emulator][start-the-emulator], or connect a device.
158
168
159
-
17. Run the app with:
169
+
10. Run the app with:
160
170
161
171
```bash
162
172
flutter run
@@ -198,34 +208,13 @@ Platform specific README exists for [Android](android/) and [iOS](ios/).
198
208
199
209

200
210
201
-
6. Add the PSPDFKit dependency in`pubspec.yaml`:
202
-
203
-
```diff
204
-
dependencies:
205
-
flutter:
206
-
sdk: flutter
207
-
+ pspdfkit_flutter:
208
-
```
209
-
210
-
7. From the terminal app, run the following command to get all the packages:
211
-
212
-
```bash
213
-
flutter pub get
214
-
```
215
-
216
-
8. Then run the command below to upgrade the dependencies:
217
-
218
-
```bash
219
-
flutter pub upgrade
220
-
```
221
-
222
-
9. Open your project’s Podfile in a text editor:
211
+
6. Open your project’s Podfile in a text editor:
223
212
224
213
```bash
225
214
open ios/Podfile
226
215
```
227
216
228
-
10. Update the platform to iOS 15 and add the PSPDFKit Podspec:
217
+
7. Update the platform to iOS 15 and add the PSPDFKit Podspec:
229
218
230
219
```diff
231
220
-# platform :ios, '9.0'
@@ -240,34 +229,38 @@ Platform specific README exists for [Android](android/) and [iOS](ios/).
240
229
end
241
230
```
242
231
243
-
11. 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.
232
+
8. Run `flutter emulators --launch apple_ios_simulator` to launch the iOS Simulator.
244
233
245
-
12. Add the PDF document you want to display in your project’s `assets` directory.
246
-
- First create a `PDFs` directory:
234
+
9. Run the app with:
247
235
248
-
```bash
249
-
mkdir PDFs
250
-
```
236
+
```bash
237
+
flutter run
238
+
```
251
239
252
-
- Move a [sample document](example/PDFs/PSPDFKit.pdf) into the newly created `PDFs` directory, and rename it as `Document.pdf`:
240
+
### Web
253
241
254
-
```bash
255
-
cp ~/Downloads/PSPDFKit.pdf PDFs/Document.pdf
256
-
```
242
+
#### Requirements
257
243
258
-
13. Specify the `assets` directory in`pubspec.yaml`:
244
+
- The [latest stable version of Chrome][chrome]
259
245
260
-
```diff
261
-
# The following section is specific to Flutter.
262
-
flutter:
263
-
+ assets:
264
-
+ - PDFs/
265
-
...
266
-
```
246
+
#### Getting Started
247
+
248
+
PSPDFKit for Web library files are distributed as an archive that can be extracted manually.
249
+
250
+
1. <a href="https://my.pspdfkit.com/download/web/latest" target="_blank" rel="noreferrer">Download the framework here</a>. The download will start immediately and will save a `.tar.gz` archive like `PSPDFKit-Web-binary-<%= latest_version(:web) %>.tar.gz` to your computer.
267
251
268
-
14. Run `flutter emulators --launch apple_ios_simulator`to launch the iOS Simulator.
252
+
2. Once the download is complete, extract the archive and copy the **entire** contents of its `dist` folder to your project’s `web/assets` folder or any other folder of your choice inside the web subfolder.
269
253
270
-
15. Run the app with:
254
+
3. Make sure your `assets` folder contains the `pspdfkit.js` file and a `pspdfkit-lib` directory with the library assets.
255
+
256
+
4. Make sure your server has the `Content-Type: application/wasm` MIME typeset. Read more about this in the [Troubleshooting][] section.
257
+
258
+
5. Include the PSPDFKit library in your `index.html` file:
259
+
260
+
```html
261
+
<script src="assets/pspdfkit.js"></script>
262
+
```
263
+
6. Run the app with:
271
264
272
265
```bash
273
266
flutter run
@@ -280,7 +273,7 @@ To see PSPDFKit for Flutter in action check out our [Flutter example app](exampl
280
273
Showing a PDF document inside your Flutter app is as simple as this:
0 commit comments