Skip to content

Commit

Permalink
Release 3.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
PSPDFKit committed Feb 6, 2024
1 parent 2d8f16d commit 84f8b59
Show file tree
Hide file tree
Showing 125 changed files with 5,842 additions and 2,484 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,4 @@ unlinked_spec.ds
/example/ios/Flutter/flutter_export_environment.sh
/example/ios/Flutter/Flutter.podspec
/example/.flutter-plugins-dependencies
/example/web/assets/
1,114 changes: 660 additions & 454 deletions ACKNOWLEDGEMENTS.md

Large diffs are not rendered by default.

16 changes: 14 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
## Newest Release

### 3.8.0 - 06 Feb 2024
- Adds Flutter for Web support. (#42151)
- Replaces configuration `Map` with a dedicated `PdfConfiguration` class. (#42191)
- Deprecates imports for `package:pspdfkit_flutter/widgets/pspdfkit_widget.dart` and `package:pspdfkit_flutter/widgets/pspdfkit_widget_controller.dart`.
Use `package:pspdfkit_flutter/pspdfkit.dart` instead. (#43254)
- Updates for PSPDFKit 2024.1.0 for Android. (#43305)
- Updates for PSPDFKit 13.3.0 for iOS. (#43305)
- Compile SDK version 34 is now required on Android. (#43305)

## Previous Releases

### 3.7.2 - 12 Jan 2024

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

## Previous Releases

### 3.7.1 - 18 Oct 2023

- Fixes issue where iOS Appstore upload fails due to PSPDFKit Flutter missing "CFBundleShortVersionString" key. (#42166)
- Fixes issue where Plugin returned "Document is missing or invalid" during pdfViewControllerWillDismiss events. (#42255)
- Upgrades compileSDKVersion to 34. (#42293)
- Upgrades Android Gradle Plugin to 8.1.2. (#42293)
- Upgrades to Java 17 for Android. (#42293)

### 3.7.0 - 07 Sep 2023

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
All items and source code Copyright © 2010-2023 PSPDFKit GmbH.
All items and source code Copyright © 2010-2024 PSPDFKit GmbH.

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

Expand Down
250 changes: 123 additions & 127 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,55 @@ Platform specific README exists for [Android](android/) and [iOS](ios/).

## Integration into a New Flutter App

### Install PSPDFKit Flutter Plugin

1. Open `pubspec.yaml`:

```bash
open pubspec.yaml
```

2. Add the PSPDFKit dependency in `pubspec.yaml`:

```diff
dependencies:
flutter:
sdk: flutter
+ pspdfkit_flutter: any
```


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.

4. Add the PDF document you want to display in your project’s `assets` directory.
- First create a `PDFs` directory:

```bash
mkdir PDFs
```

- Move a [sample document](example/PDFs/PSPDFKit.pdf) into the newly created `PDFs` directory, and rename it as `Document.pdf`:

```bash
cp ~/Downloads/PSPDFKit.pdf PDFs/Document.pdf
```

5. Specify the `assets` directory in `pubspec.yaml`:

```diff
# The following section is specific to Flutter.
flutter:
+ assets:
+ - PDFs/
...
```

6. From the terminal app, run the following command to get all the packages:

```bash
flutter pub get
```

### Android

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

```bash
open android/app/src/main/kotlin/com/example/pspdfkit_demo/pspdfkit_demo/MainActivity.kt
```

4. Modify the base from `FlutterActivity` to `FlutterFragmentActivity`:

```diff
package com.example.pspdfkit_demo.pspdfkit_demo
-import io.flutter.embedding.android.FlutterActivity
+import io.flutter.embedding.android.FlutterFragmentActivity
-class MainActivity: FlutterActivity() {
+class MainActivity: FlutterFragmentActivity() {
}
```
5. Open the project’s Gradle build file, `android/build.gradle`:
```bash
open android/build.gradle
```
6. Modify the Kotlin version inside the `buildscript` section:
```diff
buildscript {
- ext.kotlin_version = '1.3.50'
+ ext.kotlin_version = '1.5.31'
repositories {
google()
mavenCentral()
}
...
```
7. Open the app’s Gradle build file, `android/app/build.gradle`:
3. Open the app’s Gradle build file, `android/app/build.gradle`:

```bash
open android/app/build.gradle
```

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

```diff
android {
defaultConfig {
android {
- compileSdkVersion flutter.compileSdkVersion
+ compileSdkVersion 34
...
defaultConfig {
- minSdkVersion flutter.minSdkVersion
+ minSdkVersion 21
...
+ multiDexEnabled true
}
}
...
}
}
```

9. Open `pubspec.yaml`:
```bash
open pubspec.yaml
```
10. Add the PSPDFKit dependency in `pubspec.yaml`:
5. Add the AppCompat AndroidX library to your `android/app/build.gradle` file:

```diff
dependencies:
flutter:
sdk: flutter
+ pspdfkit_flutter: any
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
+ implementation 'androidx.appcompat:appcompat:1.4.0'
}
```
11. From the terminal app, run the following command to get all the packages:
6. Open the project’s main activity class, `android/app/src/main/kotlin/com/example/pspdfkit_demo/pspdfkit_demo/MainActivity.kt`:

```bash
flutter pub get
open android/app/src/main/kotlin/com/example/pspdfkit_demo/pspdfkit_demo/MainActivity.kt
```

12. Then run the command below to upgrade the dependencies:
7. Change the base `Activity` to extend `FlutterAppCompatActivity`:

```bash
flutter pub upgrade
```
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.
14. Add the PDF document you want to display in your project’s `assets` directory.
- First create a `PDFs` directory:
```diff
- import io.flutter.embedding.android.FlutterActivity;
+ import io.flutter.embedding.android.FlutterAppCompatActivity;
```bash
mkdir PDFs
```
- public class MainActivity extends FlutterActivity {
+ public class MainActivity extends FlutterAppCompatActivity {
}
```
- Move a [sample document](example/PDFs/PSPDFKit.pdf) into the newly created `PDFs` directory, and rename it as `Document.pdf`:
Alternatively you can update the `AndroidManifest.xml` file to use `FlutterAppCompatActivity` as the launcher activity:
```bash
cp ~/Downloads/PSPDFKit.pdf PDFs/Document.pdf
```
```diff
<activity
- android:name=".MainActivity"
+ android:name="io.flutter.embedding.android.FlutterAppCompatActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize"
android:exported="true">
```
**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.
15. Specify the `assets` directory in `pubspec.yaml`:
8. Update the theme in `android/app/src/main/res/values/styles.xml` to use `PSPDFKit.Theme.default` as the parent:
```diff
# The following section is specific to Flutter.
flutter:
+ assets:
+ - PDFs/
...
- <style name="NormalTheme" parent="Theme.AppCompat.Light.NoActionBar">
+ <style name="NormalTheme" parent="PSPDFKit.Theme.Default">
```
This is to customize the theme of the PSPDFKit UI. You can read more about this in the [appearance styling][] guide.
16. [Start your Android emulator][start-the-emulator], or connect a device.
9. [Start your Android emulator][start-the-emulator], or connect a device.
17. Run the app with:
10. Run the app with:
```bash
flutter run
Expand Down Expand Up @@ -198,34 +208,13 @@ Platform specific README exists for [Android](android/) and [iOS](ios/).
![iOS View controller-based status bar appearance](screenshots/ios-info-plist-statusbarappearance.png)
6. Add the PSPDFKit dependency in `pubspec.yaml`:
```diff
dependencies:
flutter:
sdk: flutter
+ pspdfkit_flutter:
```
7. From the terminal app, run the following command to get all the packages:
```bash
flutter pub get
```
8. Then run the command below to upgrade the dependencies:
```bash
flutter pub upgrade
```
9. Open your project’s Podfile in a text editor:
6. Open your project’s Podfile in a text editor:
```bash
open ios/Podfile
```
10. Update the platform to iOS 15 and add the PSPDFKit Podspec:
7. Update the platform to iOS 15 and add the PSPDFKit Podspec:
```diff
-# platform :ios, '9.0'
Expand All @@ -240,34 +229,38 @@ Platform specific README exists for [Android](android/) and [iOS](ios/).
end
```
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.
8. Run `flutter emulators --launch apple_ios_simulator` to launch the iOS Simulator.
12. Add the PDF document you want to display in your project’s `assets` directory.
- First create a `PDFs` directory:
9. Run the app with:
```bash
mkdir PDFs
```
```bash
flutter run
```
- Move a [sample document](example/PDFs/PSPDFKit.pdf) into the newly created `PDFs` directory, and rename it as `Document.pdf`:
### Web
```bash
cp ~/Downloads/PSPDFKit.pdf PDFs/Document.pdf
```
#### Requirements
13. Specify the `assets` directory in `pubspec.yaml`:
- The [latest stable version of Chrome][chrome]
```diff
# The following section is specific to Flutter.
flutter:
+ assets:
+ - PDFs/
...
```
#### Getting Started
PSPDFKit for Web library files are distributed as an archive that can be extracted manually.
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.
14. Run `flutter emulators --launch apple_ios_simulator` to launch the iOS Simulator.
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.
15. Run the app with:
3. Make sure your `assets` folder contains the `pspdfkit.js` file and a `pspdfkit-lib` directory with the library assets.
4. Make sure your server has the `Content-Type: application/wasm` MIME typeset. Read more about this in the [Troubleshooting][] section.
5. Include the PSPDFKit library in your `index.html` file:
```html
<script src="assets/pspdfkit.js"></script>
```
6. Run the app with:
```bash
flutter run
Expand All @@ -280,7 +273,7 @@ To see PSPDFKit for Flutter in action check out our [Flutter example app](exampl
Showing a PDF document inside your Flutter app is as simple as this:
```dart
Pspdfkit.present('file:///path/to/Document.pdf');
PspdfkitWidget(documentPath: 'file:///path/to/Documentpdf')
```
# Upgrading to a Full PSPDFKit License Key
Expand Down Expand Up @@ -322,3 +315,6 @@ For Troubleshooting common issues you might encounter when setting up PSPDFKit f
[start-the-emulator]: https://developer.android.com/studio/run/emulator#runningemulator
[flutter upgrade]: https://pspdfkit.com/guides/flutter/upgrade/
[troubleshooting]: https://pspdfkit.com/guides/flutter/troubleshoot/
[appcompatactivity migration]: https://pspdfkit.com/guides/flutter/troubleshooting/pspdfkit-widget-appcompat-activity-issue/
[appearance styling]: /guides/android/customizing-the-interface/appearance-styling
[chrome]: https://www.google.com/chrome/
2 changes: 1 addition & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright © 2019-2023 PSPDFKit GmbH. All rights reserved.
# Copyright © 2019-2024 PSPDFKit GmbH. All rights reserved.
#
# THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
# AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
Expand Down
Loading

0 comments on commit 84f8b59

Please sign in to comment.