Skip to content

Commit 940ca0f

Browse files
author
PSPDFKit
committed
Release 3.3.0
1 parent e8a8ffc commit 940ca0f

38 files changed

+1152
-206
lines changed

ACKNOWLEDGEMENTS.md

Lines changed: 339 additions & 63 deletions
Large diffs are not rendered by default.

CHANGELOG.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
## Newest Release
22

3+
### 3.3.0 - 19 Jul 2022
4+
5+
- Moved package files from `lib/src` to `lib` to remove import warnings and renamed `main.dart` to `pspdfkit.dart`. (#34058)
6+
- Updates the deployment target to iOS 14.0. (#33871)
7+
- PSPDFKit now requires Flutter 3.0.1 or later (#35028)
8+
- Updates for PSPDFKit 11.4.0 for iOS. (#35384)
9+
- Updates for PSPDFKit 8.2.1 for Android. (#35384)
10+
- Handles multiple initializations exception. (#35079)
11+
- Fixes an issue where tapping on form fields yields unexpected behavior in the Catalog basic example. (#33853)
12+
- Fixes the configuration option `userInterfaceViewMode: 'alwaysHidden'` not hiding the widget’s top bar on iOS. (#31095)
13+
14+
## Previous Releases
15+
316
### 3.2.2 - 16 Mar 2022
417

518
- Improves the example project by using the `PlatformUtils` class to check for supported platforms (#33212)
619
- Adds a new **Save As** example to the example project. (#33376)
720
- Updates for PSPDFKit 11.3.0 for iOS. (#33514)
821

9-
## Previous Releases
10-
1122
### 3.2.1 - 04 Mar 2022
1223

1324
- Updates for PSPDFKit 8.1.2 for Android. (#33314)

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Platform specific README exists for [Android](android/) and [iOS](ios/).
5050
```bash
5151
open android/app/src/main/kotlin/com/example/pspdfkit_demo/pspdfkit_demo/MainActivity.kt
5252
```
53-
53+
5454
4. Modify the base from `FlutterActivity` to `FlutterFragmentActivity`:
5555

5656
```diff
@@ -65,13 +65,13 @@ Platform specific README exists for [Android](android/) and [iOS](ios/).
6565
```
6666
6767
5. Open the project’s Gradle build file, `android/build.gradle`:
68-
68+
6969
```bash
7070
open android/build.gradle
7171
```
7272
7373
6. Modify the Kotlin version inside the `buildscript` section:
74-
74+
7575
```diff
7676
buildscript {
7777
- ext.kotlin_version = '1.3.50'
@@ -138,7 +138,7 @@ Platform specific README exists for [Android](android/) and [iOS](ios/).
138138
mkdir PDFs
139139
```
140140
141-
- Move a [sample document](example/PDFs/PSPDFKit.pdf) into the newly created `PDFs` directory, and rename it as `Document.pdf`:
141+
- Move a [sample document](example/PDFs/PSPDFKit.pdf) into the newly created `PDFs` directory, and rename it as `Document.pdf`:
142142
143143
```bash
144144
cp ~/Downloads/PSPDFKit.pdf PDFs/Document.pdf
@@ -190,7 +190,7 @@ Platform specific README exists for [Android](android/) and [iOS](ios/).
190190
open ios/Runner.xcworkspace
191191
```
192192
193-
4. Make sure the `iOS Deployment Target` is set to 13.0 or higher.
193+
4. Make sure the `iOS Deployment Target` is set to 14.0 or higher.
194194
195195
![iOS Deployment Target](screenshots/ios-deployment-target.png)
196196
@@ -225,16 +225,16 @@ Platform specific README exists for [Android](android/) and [iOS](ios/).
225225
open ios/Podfile
226226
```
227227
228-
10. Update the platform to iOS 13 and add the PSPDFKit Podspec:
228+
10. Update the platform to iOS 14 and add the PSPDFKit Podspec:
229229
230230
```diff
231231
-# platform :ios, '9.0'
232-
+ platform :ios, '13.0'
232+
+ platform :ios, '14.0'
233233
...
234234
target 'Runner' do
235235
use_frameworks!
236236
use_modular_headers!`
237-
237+
238238
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
239239
+ pod 'PSPDFKit', podspec:'https://customers.pspdfkit.com/pspdfkit-ios/latest.podspec'
240240
end
@@ -285,8 +285,8 @@ Showing a PDF document inside your Flutter app is as simple as this:
285285
286286
# Upgrading to a Full PSPDFKit License Key
287287
288-
PSPDFKit is a commercial product and requires the purchase of a license key when used in production. By default, this library will
289-
initialize in demo mode, placing a watermark on each PDF and limiting usage to 60 minutes.
288+
PSPDFKit is a commercial product and requires the purchase of a license key when used in production. By default, this library will
289+
initialize in demo mode, placing a watermark on each PDF and limiting usage to 60 minutes.
290290
291291
To purchase a license for production use, please reach out to us via https://pspdfkit.com/sales/form/.
292292

analysis_options.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@
88
include: package:flutter_lints/flutter.yaml
99

1010
analyzer:
11+
# exclude:
12+
# - ../../core/Vendor
1113
errors:
1214
invalid_assignment: error
1315
missing_return: error
1416
dead_code: warning
17+
# avoid_print: false
1518

1619
strong-mode:
1720
implicit-casts: false
@@ -25,5 +28,5 @@ linter:
2528
- unawaited_futures
2629
- unsafe_html
2730
- use_full_hex_values_for_flutter_colors
28-
31+
2932

android/config.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ if (localPropertiesFile.exists()) {
2626
}
2727
}
2828

29-
ext.flutterRoot = localProperties.getProperty('flutter.sdk')
29+
ext.flutterRoot = localProperties.getProperty('flutter.sdk') ?: "$System.env.FLUTTER_ROOT"
3030
if (flutterRoot == null) {
3131
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
3232
}
@@ -38,7 +38,7 @@ if (pspdfkitMavenUrl == null || pspdfkitMavenUrl == '') {
3838

3939
ext.pspdfkitVersion = localProperties.getProperty('pspdfkit.version')
4040
if (pspdfkitVersion == null || pspdfkitVersion == '') {
41-
ext.pspdfkitVersion = '8.1.2'
41+
ext.pspdfkitVersion = '8.2.1'
4242
}
4343

4444
ext.pspdfkitMavenModuleName = 'pspdfkit'

android/src/main/java/com/pspdfkit/flutter/pspdfkit/PSPDFKitView.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,11 +376,11 @@ internal class PSPDFKitView(
376376
class PSPDFKitViewFactory(
377377
private val messenger: BinaryMessenger,
378378
) : PlatformViewFactory(StandardMessageCodec.INSTANCE) {
379-
override fun create(context: Context, viewId: Int, args: Any?): PlatformView {
379+
override fun create(context: Context?, viewId: Int, args: Any?): PlatformView {
380380
val creationParams = args as Map<String?, Any?>?
381381

382382
return PSPDFKitView(
383-
context,
383+
context!!,
384384
viewId,
385385
messenger,
386386
creationParams?.get("document") as String?,

android/src/main/java/com/pspdfkit/flutter/pspdfkit/PspdfkitPlugin.java

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
import com.pspdfkit.PSPDFKit;
3131
import com.pspdfkit.document.PdfDocument;
3232
import com.pspdfkit.document.formatters.DocumentJsonFormatter;
33+
import com.pspdfkit.exceptions.InvalidPSPDFKitLicenseException;
34+
import com.pspdfkit.exceptions.PSPDFKitException;
3335
import com.pspdfkit.flutter.pspdfkit.util.DocumentJsonDataProvider;
3436
import com.pspdfkit.forms.ChoiceFormElement;
3537
import com.pspdfkit.forms.EditableButtonFormElement;
@@ -62,16 +64,23 @@
6264
*/
6365
public class PspdfkitPlugin implements MethodCallHandler, PluginRegistry.RequestPermissionsResultListener,
6466
FlutterPlugin, ActivityAware {
65-
@NonNull private static final EventDispatcher eventDispatcher = EventDispatcher.getInstance();
67+
@NonNull
68+
private static final EventDispatcher eventDispatcher = EventDispatcher.getInstance();
6669
private static final String LOG_TAG = "PSPDFKitPlugin";
6770

68-
/** Hybrid technology where the application is supposed to be working on. */
71+
/**
72+
* Hybrid technology where the application is supposed to be working on.
73+
*/
6974
private static final String HYBRID_TECHNOLOGY = "Flutter";
7075

71-
/** Atomic reference that prevents sending twice the permission result and throwing exception. */
72-
@NonNull private final AtomicReference<Result> permissionRequestResult;
76+
/**
77+
* Atomic reference that prevents sending twice the permission result and throwing exception.
78+
*/
79+
@NonNull
80+
private final AtomicReference<Result> permissionRequestResult;
7381

74-
@Nullable private ActivityPluginBinding activityPluginBinding;
82+
@Nullable
83+
private ActivityPluginBinding activityPluginBinding;
7584

7685
public PspdfkitPlugin() {
7786
this.permissionRequestResult = new AtomicReference<>();
@@ -129,12 +138,20 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {
129138
case "setLicenseKey":
130139
String licenseKey = call.argument("licenseKey");
131140
requireNotNullNotEmpty(licenseKey, "License key");
132-
PSPDFKit.initialize(activity, licenseKey, new ArrayList<>(), HYBRID_TECHNOLOGY);
141+
try {
142+
PSPDFKit.initialize(activity, licenseKey, new ArrayList<>(), HYBRID_TECHNOLOGY);
143+
} catch (PSPDFKitException e) {
144+
result.error("PSPDFKitException", e.getMessage(), null);
145+
}
133146
break;
134147
case "setLicenseKeys":
135148
String androidLicenseKey = call.argument("androidLicenseKey");
136149
requireNotNullNotEmpty(androidLicenseKey, "Android License key");
137-
PSPDFKit.initialize(activity, androidLicenseKey, new ArrayList<>(), HYBRID_TECHNOLOGY);
150+
try {
151+
PSPDFKit.initialize(activity, androidLicenseKey, new ArrayList<>(), HYBRID_TECHNOLOGY);
152+
} catch (PSPDFKitException e) {
153+
result.error("PSPDFKitException", e.getMessage(), null);
154+
}
138155
break;
139156
case "present":
140157
String documentPath = call.argument("document");

example/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ android {
1818
}
1919

2020
lintOptions {
21-
disable 'InvalidPackage'
21+
disable 'InvalidPackage', 'PSPDFKit-HandledConfigurationChanges-NoSupport'
2222
}
2323

2424
defaultConfig {

example/android/app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
~ UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
77
~ This notice may not be removed from this file.
88
-->
9-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
10-
package="com.pspdfkit.flutter.example">
9+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.pspdfkit.flutter.example">
1110

1211
<!-- The INTERNET permission is required for development. Specifically,
1312
flutter needs it to communicate with the running application
@@ -25,7 +24,8 @@
2524
android:theme="@style/LaunchTheme"
2625
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale"
2726
android:hardwareAccelerated="true"
28-
android:windowSoftInputMode="adjustResize">
27+
android:windowSoftInputMode="adjustResize"
28+
android:exported="true">
2929
<!-- Specify that the launch screen should continue being displayed -->
3030
<!-- until Flutter renders its first frame. -->
3131
<meta-data
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)