Skip to content

Commit 05b38da

Browse files
author
PSPDFKit
committed
Release 3.8.2
1 parent 91651d8 commit 05b38da

File tree

14 files changed

+56
-40
lines changed

14 files changed

+56
-40
lines changed

CHANGELOG.md

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

3-
### 3.8.1 - 14 Feb 2024
4-
- Fixes callbacks when Pspdfkit.present() is used. (J#HYB-204)
3+
### 3.8.2 - 27 Feb 2024
4+
5+
- Updates for PSPDFKit 13.3.1 for iOS. (#43550)
6+
- Fixes issue where PSPDFKit for Flutter does not work on web with Flutter SDK version 13.19.0 (J#HYB-216)
7+
- Fixes issue where annotation toolbar items are not being displayed on Web. (J#HYB-217)
58

69
## Previous Releases
710

11+
### 3.8.1 - 14 Feb 2024
12+
- Fixes callbacks when Pspdfkit.present() is used. (J#HYB-204)
13+
814
### 3.8.0 - 06 Feb 2024
915
- Adds Flutter for Web support. (#42151)
1016
- Replaces configuration `Map` with a dedicated `PdfConfiguration` class. (#42191)

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ class FlutterInstantPdfActivity : InstantPdfActivity() {
3939

4040
override fun onDocumentLoaded(pdfDocument: PdfDocument) {
4141
super.onDocumentLoaded(pdfDocument)
42-
EventDispatcher.getInstance().notifyDocumentLoaded(pdfDocument)
4342
val result = loadedDocumentResult.getAndSet(null)
4443
result?.success(true)
4544
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ protected void onDestroy() {
6060
@Override
6161
public void onDocumentLoaded(@NonNull PdfDocument pdfDocument) {
6262
super.onDocumentLoaded(pdfDocument);
63-
EventDispatcher.getInstance().notifyDocumentLoaded(pdfDocument);
6463
Result result = loadedDocumentResult.getAndSet(null);
6564
if (result != null) {
6665
result.success(true);

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165
97C146E61CF9000F007C117D /* Project object */ = {
166166
isa = PBXProject;
167167
attributes = {
168-
LastUpgradeCheck = 1430;
168+
LastUpgradeCheck = 1510;
169169
ORGANIZATIONNAME = "The Chromium Authors";
170170
TargetAttributes = {
171171
97C146ED1CF9000F007C117D = {

example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1430"
3+
LastUpgradeVersion = "1510"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: pspdfkit_example
22
description: Demonstrates how to use the pspdfkit plugin.
3-
version: 3.8.1
3+
version: 3.8.2
44
homepage: https://pspdfkit.com/
55
environment:
66
sdk: '>=2.17.0 <4.0.0'

ios/pspdfkit_flutter.podspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
Pod::Spec.new do |s|
77
s.name = "pspdfkit_flutter"
8-
s.version = "3.8.1"
8+
s.version = "3.8.2"
99
s.homepage = "https://PSPDFKit.com"
1010
s.documentation_url = "https://pspdfkit.com/guides/flutter"
1111
s.license = { type: "Commercial", file: "../LICENSE" }
@@ -18,10 +18,10 @@ Pod::Spec.new do |s|
1818
s.source_files = "Classes/**/*.{h,m,swift}"
1919
s.public_header_files = "Classes/**/*.h"
2020
s.dependency("Flutter")
21-
s.dependency("PSPDFKit", "13.3.0")
22-
s.dependency("Instant", "13.3.0")
21+
s.dependency("PSPDFKit", "13.3.1")
22+
s.dependency("Instant", "13.3.1")
2323
s.swift_version = "5.0"
2424
s.platform = :ios, "15.0"
25-
s.version = "3.8.1"
25+
s.version = "3.8.2"
2626
s.pod_target_xcconfig = { "DEFINES_MODULE" => "YES", "SWIFT_INSTALL_OBJC_HEADER" => "NO" }
2727
end

lib/src/web/pspdfkit_web.dart

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@
77
/// This notice may not be removed from this file.
88
///
99
10+
import 'dart:html';
1011
import 'dart:js';
1112
import 'package:pspdfkit_flutter/src/web/models/pspdfkit_web_toolbar_item.dart';
1213
import 'package:pspdfkit_flutter/src/web/pspdfkit_web_instance.dart';
1314
import 'package:pspdfkit_flutter/src/web/pspdfkit_web_configuration_helper.dart';
14-
1515
import '../pdf_configuration.dart';
1616
import 'pspdfkit_web_utils.dart';
1717

18+
const flutterWebProductId = 'FlutterForWeb';
19+
1820
/// Provides access to PSPDFKit for web.
1921
///
2022
/// This class represents the [PSPDFKit](https://pspdfkit.com/api/web/PSPDFKit.html) object in the PSPDFKit Web SDK.
@@ -33,6 +35,7 @@ class PSPDFKitWeb {
3335
// Try to set the license key to confirm it is valid, then store it in local storage.
3436
var config = JsObject.jsify({
3537
'licenseKey': licenseKey,
38+
'productId': flutterWebProductId,
3639
});
3740

3841
await promiseToFuture(_pspdfkit.callMethod('preloadWorker', [config]))
@@ -48,7 +51,7 @@ class PSPDFKitWeb {
4851
///
4952
/// The [documentPath] parameter specifies the path to the document that will be loaded.
5053
///
51-
/// The [id] parameter is used to identify the container element in which the PSPDFKit instance will be rendered.
54+
/// The [element] parameter is used to identify the container element in which the PSPDFKit instance will be rendered.
5255
///
5356
/// The [configuration] parameter is an optional configuration object that can be used to customize the behavior of PSPDFKit.
5457
///
@@ -68,10 +71,10 @@ class PSPDFKitWeb {
6871
///
6972
/// // Use the instance to interact with the document.
7073
/// ```
71-
static Future<PspdfkitWebInstance> load(
72-
String documentPath, int id, PdfConfiguration? configuration) async {
74+
static Future<PspdfkitWebInstance> load(String documentPath, Element element,
75+
PdfConfiguration? configuration) async {
7376
var webConfiguration = WebConfigurationHelper.populateWebConfiguration(
74-
id,
77+
element,
7578
documentPath,
7679
_pspdfkitLicenseKey,
7780
configuration,

lib/src/web/pspdfkit_web_configuration_helper.dart

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
/// This notice may not be removed from this file.
88
///
99
10+
import 'dart:html';
1011
import 'dart:js';
11-
import 'package:pspdfkit_flutter/src/web/pspdfkit_web_utils.dart';
12-
1312
import '../../pspdfkit.dart';
13+
import 'pspdfkit_web.dart';
14+
import 'pspdfkit_web_utils.dart';
1415

1516
/// This is a utility class used to convert a [PdfConfiguration] to a [PSPDFKit.Configuration](https://pspdfkit.com/api/web/PSPDFKit.Configuration.html) JsObject for Web.
1617
/// It is used in [PSPDFKitWeb.load]. This class isolates the js interop code from the rest of the plugin.
@@ -28,7 +29,7 @@ class WebConfigurationHelper {
2829
///
2930
/// Returns a [PSPDFKit.Configuration](https://pspdfkit.com/api/web/PSPDFKit.Configuration.html) JsObject.
3031
static JsObject populateWebConfiguration(
31-
int id,
32+
Element element,
3233
String documentPath,
3334
String? licenseKey,
3435
PdfConfiguration? configuration,
@@ -94,7 +95,11 @@ class WebConfigurationHelper {
9495

9596
// Return a list of new annotation toolbar items.
9697
return JsObject.jsify(
97-
newAnnotationToolbarItems?.map((e) => e.toJsObject()).toList() ?? []);
98+
newAnnotationToolbarItems?.map((e) => e.toJsObject()).toList() ??
99+
[
100+
...callbackOptions.defaultAnnotationToolbarItems
101+
.map((e) => e.toJsObject())
102+
]);
98103
}
99104

100105
// Remove the annotation toolbar items from the configuration.
@@ -104,7 +109,8 @@ class WebConfigurationHelper {
104109
var map = <String, dynamic>{
105110
'document': documentPath,
106111
'licenseKey': licenseKey,
107-
'container': '#pspdfkit-$id',
112+
'productId': flutterWebProductId,
113+
'container': element,
108114
'initialViewState': initialViewState,
109115
'password': configuration?.password,
110116
'editableAnnotationTypes': configuration?.editableAnnotationTypes,

lib/src/widgets/pspdfkit_widget_controller.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import '../../pspdfkit.dart';
1010

1111
/// A controller for a PSPDFKit widget.
1212
abstract class PspdfkitWidgetController {
13-
PspdfkitWidgetController(int id);
14-
1513
/// Sets the value of a form field by specifying its fully qualified field name.
1614
Future<bool?> setFormFieldValue(String value, String fullyQualifiedName);
1715

0 commit comments

Comments
 (0)