Skip to content

Commit

Permalink
Release 3.12.1
Browse files Browse the repository at this point in the history
  • Loading branch information
PSPDFKit committed Sep 11, 2024
1 parent cf2375b commit 6e9787c
Show file tree
Hide file tree
Showing 15 changed files with 113 additions and 54 deletions.
26 changes: 17 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
## Newest Release

### 3.12.1 - 11 Sep 2024

- Updates for PSPDFKit 2024.5.1 for Android. (J#HYB-506)
- Updates for PSPDFKit 13.9.1 for iOS. (J#HYB-506)
- PSPDFKit for Flutter now requires Flutter 3.24.1 or later.
- Fixes an issue where some annotation toolbar items are not displayed when custom grouping is used. (J#HYB-440)
- Fixes an issue where `onDocumentLoaded` is triggered multiple times. (J#HYB-494)

## Previous Releases

### 3.12.0 - 30 Jul 2024

- Adds `zoomToRect` and `getVisibleRect` APIs to PspdfkitWidgetController. (J#HYB-429)
- Added `processAnnotations` API support for Android. (J#HYB-426)
- Updated the `processAnnotations` parameter types to enums `AnnotationType` and `AnnotationProcessingMode`. (#44722)
- Adds `zoomToRect` and `getVisibleRect` APIs to `PspdfkitWidgetController`. (J#HYB-429)
- Adds `processAnnotations` API support for Android. (J#HYB-426)
- Updates the `processAnnotations` parameter types to `AnnotationType` and `AnnotationProcessingMode` enums. (#44722)
- Updates for PSPDFKit 2024.4.0 for Android. (J#HYB-422)
- Updates for PSPDFKit 13.8.0 for iOS. (J#HYB-422)

## Previous Releases

### 3.11.0 - 21 Jun 2024

- Adds API to get form filed properties to PdfDocument. (J#HYB-169)
- Adds instant synchronization support on Web. (J#HYB-377)
- Adds API to get form filled properties to `PdfDocument`. (J#HYB-169)
- Adds Instant synchronization support on Web. (J#HYB-377)

### 3.10.1 - 28 May 2024

- Fixes issue where ViewUtils.generateViewId() cannot be resolved. (J#HYB-379)
- Fixes an issue where `ViewUtils.generateViewId()` cannot be resolved. (J#HYB-379)

### 3.10.0 - 03 May 2024

Expand Down Expand Up @@ -137,7 +145,7 @@

### 3.2.0 - 14 Feb 2022

- This release requires you to update your Android project's `compileSdkVersion` to version 31. Please refer to [our migration guide](https://pspdfkit.com/guides/flutter/migration-guides/flutter-3-2-migration-guide/) for this release.
- This release requires you to update your Android project's `compileSdkVersion` to version 31. Please refer to [our migration guide](https://pspdfkit.com/guides/flutter/migration-guides/flutter-3-2-migration-guide) for this release.
- PSPDFKit now requires Flutter 2.10.1 or later. (#33016)
- Adds a new configuration option to disable autosave. (#32857)
- Adds a new example illustrating manual saving of documents with autosave disabled. (#32857)
Expand Down
2 changes: 1 addition & 1 deletion android/config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ if (pspdfkitMavenUrl == null || pspdfkitMavenUrl == '') {

ext.pspdfkitVersion = localProperties.getProperty('pspdfkit.version')
if (pspdfkitVersion == null || pspdfkitVersion == '') {
ext.pspdfkitVersion = '2024.4.0'
ext.pspdfkitVersion = '2024.5.1'
}

ext.pspdfkitMavenModuleName = 'pspdfkit'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ internal class PSPDFKitView(
private var fragmentContainerView: FragmentContainerView? = FragmentContainerView(context)
private val methodChannel: MethodChannel
private val pdfUiFragment: PdfUiFragment

private var fragmentCallbacks: FlutterPdfUiFragmentCallbacks? = null

init {
fragmentContainerView?.id = View.generateViewId()
methodChannel = MethodChannel(messenger, "com.pspdfkit.widget.$id")
Expand Down Expand Up @@ -92,8 +93,11 @@ internal class PSPDFKitView(
.build()
}
}
getFragmentActivity(context).supportFragmentManager.registerFragmentLifecycleCallbacks(FlutterPdfUiFragmentCallbacks(methodChannel,
measurementValueConfigurations, messenger), true)
fragmentCallbacks = FlutterPdfUiFragmentCallbacks(methodChannel,
measurementValueConfigurations, messenger)
fragmentCallbacks?.let {
getFragmentActivity(context).supportFragmentManager.registerFragmentLifecycleCallbacks(it, true)
}
getFragmentActivity(context).supportFragmentManager.registerFragmentLifecycleCallbacks( object : FragmentManager.FragmentLifecycleCallbacks() {
override fun onFragmentAttached(
fm: FragmentManager,
Expand Down Expand Up @@ -136,6 +140,10 @@ internal class PSPDFKitView(

override fun dispose() {
fragmentContainerView = null
fragmentCallbacks?.let {
getFragmentActivity(context).supportFragmentManager.unregisterFragmentLifecycleCallbacks(it)
}
fragmentCallbacks = null
}

@SuppressLint("CheckResult")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class FlutterMenuGroupingRule(context: Context, menuItems: List<Any>) :
"squiggly" -> return R.id.pspdf__annotation_creation_toolbar_item_squiggly
"strikeout" -> return R.id.pspdf__annotation_creation_toolbar_item_strikeout
"underline" -> return R.id.pspdf__annotation_creation_toolbar_item_underline
"freetext" -> return R.id.pspdf__annotation_creation_toolbar_item_freetext
"freeText" -> return R.id.pspdf__annotation_creation_toolbar_item_freetext
"freeTextCallout" -> return R.id.pspdf__annotation_creation_toolbar_item_freetext_callout
"signature" -> return R.id.pspdf__annotation_creation_toolbar_item_signature
"pen" -> return R.id.pspdf__annotation_creation_toolbar_item_ink_pen
Expand Down
3 changes: 2 additions & 1 deletion example/lib/pspdfkit_instant_collaboration_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ class _PspdfkitInstantCollaborationExampleState
style: const TextStyle(color: Colors.black),
children: [
TextSpan(
text: 'https://web-examples.services.demo.pspdfkit.com',
text:
'https://web-examples.services.demo.pspdfkit.com',
style: const TextStyle(color: Colors.blue),
recognizer: TapGestureRecognizer()
..onTap = () {
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: pspdfkit_example
description: Demonstrates how to use the pspdfkit plugin.
version: 3.12.0
version: 3.12.1
homepage: https://pspdfkit.com/
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
environment:
Expand Down
68 changes: 39 additions & 29 deletions ios/Classes/AnnotationToolbarItemsGrouping.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class AnnotationToolbarItemsGrouping: NSObject {
static let annotationUnderline = "underline"
static let annotationSquiggly = "squiggly"
static let annotationNote = "note"
static let annotationFreeText = "freetext"
static let annotationFreeText = "freeText"
static let annotationInk = "ink"
static let annotationLine = "line"
static let annotationSquare = "square"
Expand All @@ -30,19 +30,19 @@ public class AnnotationToolbarItemsGrouping: NSObject {
static let annotationRedaction = "redaction"
static let annotationDistanceMeasurement = "distance"
static let annotationPerimeterMeasurement = "perimeter"
static let annotationPolygonalAreaMeasurement = "area_polygon"
static let annotationEllipticalAreaMeasurement = "area_circle"
static let annotationSquareAreaMeasurement = "area_square"
static let annotationPolygonalAreaMeasurement = "areaPolygon"
static let annotationEllipticalAreaMeasurement = "areaCircle"
static let annotationSquareAreaMeasurement = "areaSquare"
static let annotationInkPen = "pen"
static let annotationInkMagic = "magic_ink"
static let annotationInkMagic = "magicInk"
static let annotationInkHighlighter = "highlighter"
static let annotationLineArrow = "arrow"
static let annotationFreeTextCallout = "freetext_callout"
static let annotationPolygonCloud = "cloudy_polygon"
static let annotationFreeTextCallout = "freeTextCallout"
static let annotationPolygonCloud = "cloudyPolygon"
static let annotationTextHighlighter = "highlight"
static let annotationWidget = "widget"
static let annotationCaret = "caret"
static let annotationHighligh = "highlight"
static let annotationHighlight = "highlight"
static let annotationInstantCommentMarker = "instantCommentMarker"
static let annotationScreen = "screen"
static let annotationFile = "file"
Expand All @@ -54,25 +54,25 @@ public class AnnotationToolbarItemsGrouping: NSObject {
@objc public static func convertAnnotationToolbarConfiguration(toolbarItems: NSArray) -> AnnotationToolConfiguration {
var parsedItems: [AnnotationToolConfiguration.ToolGroup] = []

for itemToParse in toolbarItems {
if let dict = itemToParse as? [String: Any] {
let subArray = dict["items"] as! [Any]
var subItems: [AnnotationToolConfiguration.ToolItem] = []

for subItem in subArray {
let annotationString = annotationStringFromName(name: subItem as! String)
if annotationString != nil {
subItems.append(AnnotationToolConfiguration.ToolItem(type: annotationString!, variant: annotationVariantStringFromName(name: subItem as! String), configurationBlock: annotationGroupItemConfigurationBlockFromName(name: subItem as! String)))
}
}
parsedItems.append(AnnotationToolConfiguration.ToolGroup(items: subItems))
} else {
let annotationString = annotationStringFromName(name: itemToParse as! String)
if annotationString != nil {
parsedItems.append(AnnotationToolConfiguration.ToolGroup(items: [AnnotationToolConfiguration.ToolItem(type: annotationString!, variant: annotationVariantStringFromName(name: itemToParse as! String), configurationBlock: annotationGroupItemConfigurationBlockFromName(name: itemToParse as! String))]))
}
for itemToParse in toolbarItems {
if let dict = itemToParse as? [String: Any] {
let subArray = dict["items"] as! [Any]
var subItems: [AnnotationToolConfiguration.ToolItem] = []
for subItem in subArray {
let annotationString = annotationStringFromName(name: subItem as! String)
if annotationString != nil {
subItems.append(AnnotationToolConfiguration.ToolItem(type: annotationString!, variant: annotationVariantStringFromName(name: subItem as! String), configurationBlock: annotationGroupItemConfigurationBlockFromName(name: subItem as! String)))
}
}
parsedItems.append(AnnotationToolConfiguration.ToolGroup(items: subItems))
} else {
let annotationType = annotationStringFromName(name: itemToParse as! String)
let annotationVariant = annotationVariantStringFromName(name: itemToParse as! String)
if annotationType != nil {
parsedItems.append(AnnotationToolConfiguration.ToolGroup(items: [AnnotationToolConfiguration.ToolItem(type: annotationType!, variant: annotationVariant, configurationBlock: annotationGroupItemConfigurationBlockFromName(name: itemToParse as? String ?? ""))]))
}
}
}
return PSPDFKit.AnnotationToolConfiguration(annotationGroups: parsedItems)
Expand Down Expand Up @@ -102,13 +102,23 @@ public class AnnotationToolbarItemsGrouping: NSObject {
annotationSignature: .signature,
annotationWidget: .widget,
annotationFile: .file,
annotationHighligh: .highlight,
annotationHighlight: .highlight,
annotationCaret: .caret,
annotationInstantCommentMarker: .instantCommentMarker,
annotationMultimedia: .richMedia,
annotationWatermark: .watermark,
annotationScreen: .screen,
annotationTrapNet: .trapNet
annotationTrapNet: .trapNet,
annotationInkPen: .ink,
annotationInkHighlighter: .ink,
annotationPolygonCloud: .polygon,
annotationSquareAreaMeasurement: .square,
annotationDistanceMeasurement: .line,
annotationEllipticalAreaMeasurement:.circle,
annotationLineArrow: .line,
annotationInkMagic: .ink,
annotationFreeTextCallout: .freeText,
annotationPolygonalAreaMeasurement: .polygon
]
return nameToAnnotationStringMapping[name]
}
Expand Down
8 changes: 4 additions & 4 deletions ios/pspdfkit_flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
Pod::Spec.new do |s|
s.name = "pspdfkit_flutter"
s.version = "3.12.0"
s.version = "3.12.1"
s.homepage = "https://PSPDFKit.com"
s.documentation_url = "https://pspdfkit.com/guides/flutter"
s.license = { type: "Commercial", file: "../LICENSE" }
Expand All @@ -18,10 +18,10 @@ Pod::Spec.new do |s|
s.source_files = "Classes/**/*.{h,m,swift}"
s.public_header_files = "Classes/**/*.h"
s.dependency("Flutter")
s.dependency("PSPDFKit", "13.8.0")
s.dependency("Instant", "13.8.0")
s.dependency("PSPDFKit", "13.9.1")
s.dependency("Instant", "13.9.1")
s.swift_version = "5.0"
s.platform = :ios, "15.0"
s.version = "3.12.0"
s.version = "3.12.1"
s.pod_target_xcconfig = { "DEFINES_MODULE" => "YES", "SWIFT_INSTALL_OBJC_HEADER" => "NO" }
end
1 change: 0 additions & 1 deletion lib/src/document/pdf_document_native.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,4 @@ class PdfDocumentNative extends PdfDocument {
throw Exception('Error getting form fields: $error');
});
}

}
1 change: 0 additions & 1 deletion lib/src/document/pdf_document_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,4 @@ class PdfDocumentWeb extends PdfDocument {
Future<List<PdfFormField>> getFormFields() {
return _instance.getFormFields();
}

}
11 changes: 9 additions & 2 deletions lib/src/toolbar/annotation_toolbar_items.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
///
/// Copyright © 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.
/// UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
/// This notice may not be removed from this file.
///
enum AnnotationToolbarItem {
markup,
writing,
Expand Down Expand Up @@ -52,5 +61,3 @@ enum AnnotationToolbarItem {
watermark,
file,
}


9 changes: 9 additions & 0 deletions lib/src/toolbar/toolbar.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
///
/// Copyright © 2023-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.
/// UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
/// This notice may not be removed from this file.
///
export 'toolbar_item_grouping.dart';
export 'annotation_toolbar_items.dart';
export 'toolbar_items.dart';
9 changes: 9 additions & 0 deletions lib/src/toolbar/toolbar_item_grouping.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
///
/// Copyright © 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.
/// UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
/// This notice may not be removed from this file.
///
import 'package:pspdfkit_flutter/src/toolbar/annotation_toolbar_items.dart';

class AnnotationToolsGroup {
Expand Down
9 changes: 9 additions & 0 deletions lib/src/toolbar/toolbar_items.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
///
/// Copyright © 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.
/// UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
/// This notice may not be removed from this file.
///
enum ToolbarItems {
search,
thumbnails,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: pspdfkit_flutter
description: A Flutter plugin providing a feature-rich PDF viewing and editing experience to your users with the powerful PSPDFKit PDF SDK.
version: 3.12.0
version: 3.12.1
homepage: https://pspdfkit.com/
repository: https://github.com/PSPDFKit/pspdfkit-flutter
issue_tracker: https://support.pspdfkit.com/hc/en-us/requests/new
Expand Down

0 comments on commit 6e9787c

Please sign in to comment.