Skip to content

Commit eaecb89

Browse files
author
PSPDFKit
committed
Release 4.4.1
1 parent 2d1025a commit eaecb89

File tree

9 files changed

+72
-87
lines changed

9 files changed

+72
-87
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 4.4.1 - 20 Jun 2025
2+
3+
- Updates for Nutrient Android SDK 10.4.0.
4+
- Fixes issue where the Android signature dialog custom style is not applied. (HYB-820)
5+
16
## 4.4.0 - 10 Jun 2025
27

38
- Adds AI Assistant support. (J#HYB-742)
@@ -7,7 +12,7 @@
712

813
## 4.3.0 - 11 Apr 2025
914

10-
- Adds setting custom stamp items support. Only custom text stamps are supported, and this is available only on iOS and Android for now. (J#HYB-715)
15+
- Adds setting custom stamp items support. Only custom text stamps are supported, and this is available only on iOS and Android for now. (J#HYB-715)
1116
- Adds signature creation configuration and signature saving strategy support. (J#HYB-739)
1217
- Adds support for custom main toolbar items with icons. (J#HYB-732)
1318
- Fixes issue where an annotation doesn't get selected when clicked on iOS. (J#HYB-735)

android/config.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ if (pspdfkitMavenUrl == null || pspdfkitMavenUrl == '') {
3838

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

4444
ext.pspdfkitMavenModuleName = 'nutrient'

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

Lines changed: 13 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -637,11 +637,7 @@ private void configureUserInterfaceViewMode(@NonNull String userInterfaceViewMod
637637
}
638638

639639
private void configureShowSearchAction(boolean showSearchAction) {
640-
if (showSearchAction) {
641-
configuration.enableSearch();
642-
} else {
643-
configuration.disableSearch();
644-
}
640+
configuration.searchEnabled(showSearchAction);
645641
}
646642

647643
private void configureImmersiveMode(boolean immersiveMode) {
@@ -670,45 +666,24 @@ private void configureShowThumbnailBar(@NonNull String showThumbnailBar) {
670666
}
671667

672668
private void configureShowThumbnailGridAction(boolean showThumbnailGridAction) {
673-
if (showThumbnailGridAction) {
674-
configuration.showThumbnailGrid();
675-
} else {
676-
configuration.hideThumbnailGrid();
677-
}
669+
configuration.thumbnailGridEnabled(showThumbnailGridAction);
678670
}
679671

680672
private void configureShowOutlineAction(boolean showOutlineAction) {
681-
if (showOutlineAction) {
682-
configuration.enableOutline();
683-
} else {
684-
configuration.disableOutline();
685-
}
673+
configuration.outlineEnabled(showOutlineAction);
686674
}
687675

688676
private void configureShowAnnotationListAction(boolean showAnnotationListAction) {
689-
if (showAnnotationListAction) {
690-
configuration.enableAnnotationList();
691-
} else {
692-
configuration.disableAnnotationList();
693-
}
677+
configuration.annotationListEnabled(showAnnotationListAction);
694678
}
695679

696680
private void configureShowPageLabels(boolean showPageLabels) {
697-
if (showPageLabels) {
698-
configuration.showPageNumberOverlay();
699-
configuration.showPageLabels();
700-
} else {
701-
configuration.hidePageNumberOverlay();
702-
configuration.hidePageLabels();
703-
}
681+
configuration.pageLabelsEnabled(showPageLabels);
682+
configuration.pageNumberOverlayEnabled(showPageLabels);
704683
}
705684

706685
private void configureDocumentLabelEnabled(boolean documentLabelEnabled) {
707-
if (documentLabelEnabled) {
708-
configuration.showDocumentTitleOverlay();
709-
} else {
710-
configuration.hideDocumentTitleOverlay();
711-
}
686+
configuration.documentTitleOverlayEnabled(documentLabelEnabled);
712687
}
713688

714689
private void configureToolbarTitle(@Nullable String toolbarTitle) {
@@ -724,11 +699,7 @@ private void configureInvertColors(boolean invertColors) {
724699
}
725700

726701
private void configureEnableAnnotationEditing(boolean enableAnnotationEditing) {
727-
if (enableAnnotationEditing) {
728-
configuration.enableAnnotationEditing();
729-
} else {
730-
configuration.disableAnnotationEditing();
731-
}
702+
configuration.annotationEditingEnabled(enableAnnotationEditing);
732703
}
733704

734705
private void configureShowShareAction(boolean showShareAction) {
@@ -740,39 +711,23 @@ private void configureShowShareAction(boolean showShareAction) {
740711
}
741712

742713
private void configureShowPrintAction(boolean showPrintAction) {
743-
if (showPrintAction) {
744-
configuration.enablePrinting();
745-
} else {
746-
configuration.disablePrinting();
747-
}
714+
configuration.printingEnabled(showPrintAction);
748715
}
749716

750717
private void configureEnableTextSelection(boolean enableTextSelection) {
751718
configuration.textSelectionEnabled(enableTextSelection);
752719
}
753720

754721
private void configureShowBookmarksAction(boolean enableBookmarkList) {
755-
if (enableBookmarkList) {
756-
configuration.enableBookmarkList();
757-
} else {
758-
configuration.disableBookmarkList();
759-
}
722+
configuration.bookmarkListEnabled(enableBookmarkList);
760723
}
761724

762725
private void configureEnableDocumentEditor(boolean enableDocumentEditor) {
763-
if (enableDocumentEditor) {
764-
configuration.enableDocumentEditor();
765-
} else {
766-
configuration.disableDocumentEditor();
767-
}
726+
configuration.documentEditorEnabled(enableDocumentEditor);
768727
}
769728

770729
private void configureDocumentInfoView(boolean enableDocumentInfoView) {
771-
if (enableDocumentInfoView) {
772-
configuration.enableDocumentInfoView();
773-
} else {
774-
configuration.disableDocumentInfoView();
775-
}
730+
configuration.documentInfoViewEnabled(enableDocumentInfoView);
776731
}
777732

778733
private void configureAppearanceMode(@NonNull String appearanceMode) {
@@ -812,11 +767,7 @@ private void configureDefaultThemeRes(@NonNull String defaultThemeResource, @Non
812767
}
813768

814769
private void configureShowNavigationButtons(boolean showNavigationButtons) {
815-
if (showNavigationButtons) {
816-
configuration.showNavigationButtons();
817-
} else {
818-
configuration.hideNavigationButtons();
819-
}
770+
configuration.navigationButtonsEnabled(showNavigationButtons);
820771
}
821772

822773
private static int getStyleResourceId(@NonNull String styleName, @NonNull Context context) {

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ import java.io.ByteArrayOutputStream
6565
import java.io.File
6666
import java.io.FileOutputStream
6767
import java.nio.charset.StandardCharsets
68+
import androidx.core.net.toUri
6869

6970
class PspdfkitApiImpl(private var activityPluginBinding: ActivityPluginBinding?) : PspdfkitApi {
7071

@@ -745,7 +746,7 @@ class PspdfkitApiImpl(private var activityPluginBinding: ActivityPluginBinding?)
745746
html,
746747
options["baseUrl"] as String
747748
)
748-
} else activityPluginBinding?.let { HtmlToPdfConverter.fromHTMLString(it.activity, html) }
749+
} else activityPluginBinding?.let { HtmlToPdfConverter.fromHTMLString(it.activity, html, options?.get("baseUrl") as String) }
749750

750751
if (options?.contains("enableJavaScript") == true)
751752
converter?.setJavaScriptEnabled(options["enableJavaScript"] as Boolean)
@@ -778,7 +779,7 @@ class PspdfkitApiImpl(private var activityPluginBinding: ActivityPluginBinding?)
778779
val convertor = activityPluginBinding?.let {
779780
HtmlToPdfConverter.fromUri(
780781
it.activity,
781-
Uri.parse(htmlUri)
782+
htmlUri.toUri()
782783
)
783784
}
784785

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ object PspdfkitHTMLConverter {
3636
context,
3737
html,
3838
options["baseUrl"] as String
39-
) else HtmlToPdfConverter.fromHTMLString(context, html)
39+
) else HtmlToPdfConverter.fromHTMLString(context, html, options?.get("baseUrl") as String)
4040

41-
if (options?.contains("enableJavaScript") == true)
41+
if (options.contains("enableJavaScript"))
4242
converter.setJavaScriptEnabled(options["enableJavaScript"] as Boolean)
4343

44-
if (options?.contains("documentTitle") == true)
44+
if (options.contains("documentTitle"))
4545
converter.title(options["documentTitle"] as String)
4646

4747
converter

android/src/main/java/com/pspdfkit/flutter/pspdfkit/events/FlutterEventsHelper.kt

Lines changed: 42 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class FlutterEventsHelper(private val eventCallbacks: NutrientEventsCallbacks? =
6262
pdfFragment.document?.invalidateCache()
6363
}
6464
NutrientEvent.ANNOTATIONS_SELECTED -> {
65-
val listener = object : AnnotationManager.OnAnnotationSelectedListener {
65+
val listener = object : com.pspdfkit.ui.annotations.OnAnnotationSelectedListener{
6666
override fun onPrepareAnnotationSelection(
6767
controller: AnnotationSelectionController,
6868
annotation: Annotation,
@@ -78,23 +78,51 @@ class FlutterEventsHelper(private val eventCallbacks: NutrientEventsCallbacks? =
7878
"isMultipleSelection" to isMultipleSelection
7979
))
8080
}
81+
82+
override fun onAnnotationDeselected(
83+
annotation: Annotation?,
84+
reselected: Boolean
85+
) {
86+
super.onAnnotationDeselected(annotation, reselected)
87+
}
8188
}
8289
pdfFragment.addOnAnnotationSelectedListener(listener)
8390
eventsMap[event] = listener
8491
}
8592
NutrientEvent.ANNOTATIONS_DESELECTED -> {
86-
val listener = AnnotationManager.OnAnnotationDeselectedListener { annotation, isMultipleSelection ->
87-
sendEvent(event, mapOf(
88-
"deselected" to mapOf(
89-
"name" to annotation.name,
90-
"type" to annotation.type.name,
91-
"id" to annotation.uuid,
92-
"objectNumber" to annotation.objectNumber
93-
),
94-
"isMultipleSelection" to isMultipleSelection
95-
))
93+
val listener = object : com.pspdfkit.ui.annotations.OnAnnotationSelectedListener{
94+
override fun onPrepareAnnotationSelection(
95+
controller: AnnotationSelectionController,
96+
annotation: Annotation,
97+
isMultipleSelection: Boolean
98+
): Boolean = true
99+
100+
override fun onAnnotationSelected(
101+
annotation: Annotation,
102+
isMultipleSelection: Boolean
103+
) {
104+
105+
}
106+
107+
override fun onAnnotationDeselected(
108+
annotation: Annotation?,
109+
reselected: Boolean
110+
) {
111+
super.onAnnotationDeselected(annotation, reselected)
112+
if (annotation != null) {
113+
sendEvent(event, mapOf(
114+
"deselected" to mapOf(
115+
"name" to annotation.name,
116+
"type" to annotation.type.name,
117+
"id" to annotation.uuid,
118+
"objectNumber" to annotation.objectNumber,
119+
"reselected" to reselected
120+
),
121+
))
122+
}
123+
}
96124
}
97-
pdfFragment.addOnAnnotationDeselectedListener(listener)
125+
pdfFragment.addOnAnnotationSelectedListener(listener)
98126
eventsMap[event] = listener
99127
}
100128
NutrientEvent.TEXT_SELECTION_CHANGED -> {
@@ -168,10 +196,10 @@ class FlutterEventsHelper(private val eventCallbacks: NutrientEventsCallbacks? =
168196
pdfFragment.removeOnAnnotationUpdatedListener(listener as AnnotationProvider.OnAnnotationUpdatedListener)
169197
}
170198
NutrientEvent.ANNOTATIONS_SELECTED -> {
171-
pdfFragment.removeOnAnnotationSelectedListener(listener as AnnotationManager.OnAnnotationSelectedListener)
199+
pdfFragment.removeOnAnnotationSelectedListener(listener as com.pspdfkit.ui.annotations.OnAnnotationSelectedListener)
172200
}
173201
NutrientEvent.ANNOTATIONS_DESELECTED -> {
174-
pdfFragment.removeOnAnnotationDeselectedListener(listener as AnnotationManager.OnAnnotationDeselectedListener)
202+
pdfFragment.removeOnAnnotationSelectedListener(listener as com.pspdfkit.ui.annotations.OnAnnotationSelectedListener)
175203
}
176204
NutrientEvent.TEXT_SELECTION_CHANGED -> {
177205
pdfFragment.removeOnTextSelectionChangeListener(listener as TextSelectionManager.OnTextSelectionChangeListener)

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: 4.4.0
3+
version: 4.4.1
44
homepage: https://pspdfkit.com/
55
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
66
environment:

ios/pspdfkit_flutter.podspec

Lines changed: 2 additions & 2 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 = "4.4.0"
8+
s.version = "4.4.1"
99
s.homepage = "https://PSPDFKit.com"
1010
s.documentation_url = "https://pspdfkit.com/guides/flutter"
1111
s.license = { type: "Commercial", file: "../LICENSE" }
@@ -22,6 +22,6 @@ Pod::Spec.new do |s|
2222
s.dependency("Instant", "14.8.0")
2323
s.swift_version = "5.0"
2424
s.platform = :ios, "16.0"
25-
s.version = "4.4.0"
25+
s.version = "4.4.1"
2626
s.pod_target_xcconfig = { "DEFINES_MODULE" => "YES", "SWIFT_INSTALL_OBJC_HEADER" => "NO" }
2727
end

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: pspdfkit_flutter
22
description: A Flutter plugin providing a feature-rich PDF viewing and editing experience to your users with the powerful Nutrient PDF SDK.
3-
version: 4.4.0
3+
version: 4.4.1
44
homepage: https://pspdfkit.com/
55
repository: https://github.com/PSPDFKit/pspdfkit-flutter
66
issue_tracker: https://support.pspdfkit.com/hc/en-us/requests/new

0 commit comments

Comments
 (0)