Skip to content

Commit 84f8b59

Browse files
author
PSPDFKit
committed
Release 3.8.0
1 parent 2d8f16d commit 84f8b59

File tree

125 files changed

+5842
-2484
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+5842
-2484
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,4 @@ unlinked_spec.ds
9090
/example/ios/Flutter/flutter_export_environment.sh
9191
/example/ios/Flutter/Flutter.podspec
9292
/example/.flutter-plugins-dependencies
93+
/example/web/assets/

ACKNOWLEDGEMENTS.md

+660-454
Large diffs are not rendered by default.

CHANGELOG.md

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
11
## Newest Release
22

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+
314
### 3.7.2 - 12 Jan 2024
415

516
- Adds `flutterPdfFragmentAdded` callback for Android. (#42631)
617
- Updates FlutterAppCompatActivity to Support Flutter 3.16.0. (#42767)
718

8-
## Previous Releases
9-
1019
### 3.7.1 - 18 Oct 2023
1120

1221
- Fixes issue where iOS Appstore upload fails due to PSPDFKit Flutter missing "CFBundleShortVersionString" key. (#42166)
1322
- 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)
25+
- Upgrades to Java 17 for Android. (#42293)
1426

1527
### 3.7.0 - 07 Sep 2023
1628

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
All items and source code Copyright © 2010-2023 PSPDFKit GmbH.
1+
All items and source code Copyright © 2010-2024 PSPDFKit GmbH.
22

33
PSPDFKit is a commercial product and requires a license to be used.
44

README.md

+123-127
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,55 @@ Platform specific README exists for [Android](android/) and [iOS](ios/).
2323

2424
## Integration into a New Flutter App
2525

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+
2675
### Android
2776

2877
#### Requirements
@@ -45,118 +94,79 @@ Platform specific README exists for [Android](android/) and [iOS](ios/).
4594
```bash
4695
cd pspdfkit_demo
4796
```
48-
3. Open the project’s main activity class, `android/app/src/main/kotlin/com/example/pspdfkit_demo/pspdfkit_demo/MainActivity.kt`:
4997

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`:
55-
56-
```diff
57-
package com.example.pspdfkit_demo.pspdfkit_demo
58-
59-
-import io.flutter.embedding.android.FlutterActivity
60-
+import io.flutter.embedding.android.FlutterFragmentActivity
61-
62-
-class MainActivity: FlutterActivity() {
63-
+class MainActivity: FlutterFragmentActivity() {
64-
}
65-
```
66-
67-
5. Open the project’s Gradle build file, `android/build.gradle`:
68-
69-
```bash
70-
open android/build.gradle
71-
```
72-
73-
6. Modify the Kotlin version inside the `buildscript` section:
74-
75-
```diff
76-
buildscript {
77-
- ext.kotlin_version = '1.3.50'
78-
+ ext.kotlin_version = '1.5.31'
79-
repositories {
80-
google()
81-
mavenCentral()
82-
}
83-
...
84-
```
85-
86-
7. Open the app’s Gradle build file, `android/app/build.gradle`:
98+
3. Open the app’s Gradle build file, `android/app/build.gradle`:
8799

88100
```bash
89101
open android/app/build.gradle
90102
```
91103

92-
8. Modify the minimum SDK version, and enable `multidex`. All this is done inside the `android` section:
104+
4. Modify the compile SDK version and the minimum SDK version:
93105

94106
```diff
95-
android {
96-
defaultConfig {
107+
android {
108+
- compileSdkVersion flutter.compileSdkVersion
109+
+ compileSdkVersion 34
110+
...
111+
defaultConfig {
97112
- minSdkVersion flutter.minSdkVersion
98113
+ minSdkVersion 21
99-
...
100-
+ multiDexEnabled true
101-
}
102-
}
114+
...
115+
}
116+
}
103117
```
104118

105-
9. Open `pubspec.yaml`:
106-
107-
```bash
108-
open pubspec.yaml
109-
```
110-
111-
10. Add the PSPDFKit dependency in `pubspec.yaml`:
119+
5. Add the AppCompat AndroidX library to your `android/app/build.gradle` file:
112120

113121
```diff
114-
dependencies:
115-
flutter:
116-
sdk: flutter
117-
+ pspdfkit_flutter: any
122+
dependencies {
123+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
124+
+ implementation 'androidx.appcompat:appcompat:1.4.0'
125+
}
118126
```
119-
120-
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`:
121128

122129
```bash
123-
flutter pub get
130+
open android/app/src/main/kotlin/com/example/pspdfkit_demo/pspdfkit_demo/MainActivity.kt
124131
```
125132

126-
12. Then run the command below to upgrade the dependencies:
133+
7. Change the base `Activity` to extend `FlutterAppCompatActivity`:
127134

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.
135-
- First create a `PDFs` directory:
135+
```diff
136+
- import io.flutter.embedding.android.FlutterActivity;
137+
+ import io.flutter.embedding.android.FlutterAppCompatActivity;
136138
137-
```bash
138-
mkdir PDFs
139-
```
139+
- public class MainActivity extends FlutterActivity {
140+
+ public class MainActivity extends FlutterAppCompatActivity {
141+
}
142+
```
140143
141-
- Move a [sample document](example/PDFs/PSPDFKit.pdf) into the newly created `PDFs` directory, and rename it as `Document.pdf`:
144+
Alternatively you can update the `AndroidManifest.xml` file to use `FlutterAppCompatActivity` as the launcher activity:
142145
143-
```bash
144-
cp ~/Downloads/PSPDFKit.pdf PDFs/Document.pdf
145-
```
146+
```diff
147+
<activity
148+
- android:name=".MainActivity"
149+
+ android:name="io.flutter.embedding.android.FlutterAppCompatActivity"
150+
android:launchMode="singleTop"
151+
android:theme="@style/LaunchTheme"
152+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
153+
android:hardwareAccelerated="true"
154+
android:windowSoftInputMode="adjustResize"
155+
android:exported="true">
156+
```
157+
**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 for Android with Flutter. You can read more about this in the [AppCompatActivity Migration][] guide.
146158
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:
148160
149161
```diff
150-
# The following section is specific to Flutter.
151-
flutter:
152-
+ assets:
153-
+ - PDFs/
154-
...
162+
- <style name="NormalTheme" parent="Theme.AppCompat.Light.NoActionBar">
163+
+ <style name="NormalTheme" parent="PSPDFKit.Theme.Default">
155164
```
165+
This is to customize the theme of the PSPDFKit UI. You can read more about this in the [appearance styling][] guide.
156166
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.
158168
159-
17. Run the app with:
169+
10. Run the app with:
160170
161171
```bash
162172
flutter run
@@ -198,34 +208,13 @@ Platform specific README exists for [Android](android/) and [iOS](ios/).
198208
199209
![iOS View controller-based status bar appearance](screenshots/ios-info-plist-statusbarappearance.png)
200210
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:
223212
224213
```bash
225214
open ios/Podfile
226215
```
227216
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:
229218
230219
```diff
231220
-# platform :ios, '9.0'
@@ -240,34 +229,38 @@ Platform specific README exists for [Android](android/) and [iOS](ios/).
240229
end
241230
```
242231
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.
244233
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:
247235
248-
```bash
249-
mkdir PDFs
250-
```
236+
```bash
237+
flutter run
238+
```
251239
252-
- Move a [sample document](example/PDFs/PSPDFKit.pdf) into the newly created `PDFs` directory, and rename it as `Document.pdf`:
240+
### Web
253241
254-
```bash
255-
cp ~/Downloads/PSPDFKit.pdf PDFs/Document.pdf
256-
```
242+
#### Requirements
257243
258-
13. Specify the `assets` directory in `pubspec.yaml`:
244+
- The [latest stable version of Chrome][chrome]
259245
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.
267251
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.
269253
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:
271264
272265
```bash
273266
flutter run
@@ -280,7 +273,7 @@ To see PSPDFKit for Flutter in action check out our [Flutter example app](exampl
280273
Showing a PDF document inside your Flutter app is as simple as this:
281274
282275
```dart
283-
Pspdfkit.present('file:///path/to/Document.pdf');
276+
PspdfkitWidget(documentPath: 'file:///path/to/Documentpdf')
284277
```
285278
286279
# Upgrading to a Full PSPDFKit License Key
@@ -322,3 +315,6 @@ For Troubleshooting common issues you might encounter when setting up PSPDFKit f
322315
[start-the-emulator]: https://developer.android.com/studio/run/emulator#runningemulator
323316
[flutter upgrade]: https://pspdfkit.com/guides/flutter/upgrade/
324317
[troubleshooting]: https://pspdfkit.com/guides/flutter/troubleshoot/
318+
[appcompatactivity migration]: https://pspdfkit.com/guides/flutter/troubleshooting/pspdfkit-widget-appcompat-activity-issue/
319+
[appearance styling]: /guides/android/customizing-the-interface/appearance-styling
320+
[chrome]: https://www.google.com/chrome/

analysis_options.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright © 2019-2023 PSPDFKit GmbH. All rights reserved.
1+
# Copyright © 2019-2024 PSPDFKit GmbH. All rights reserved.
22
#
33
# THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
44
# AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.

0 commit comments

Comments
 (0)