Skip to content

Commit c2affd4

Browse files
author
PSPDFKit
committed
Release 2.9.0
1 parent 439f544 commit c2affd4

File tree

161 files changed

+11042
-1849
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+11042
-1849
lines changed

ACKNOWLEDGEMENTS.md

+28-28
Original file line numberDiff line numberDiff line change
@@ -3439,6 +3439,34 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34393439
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34403440
POSSIBILITY OF SUCH DAMAGE.
34413441

3442+
--------------------------------------------------------------------------------
3443+
## zlib (http://www.zlib.net/)
3444+
3445+
zlib.h -- interface of the 'zlib' general purpose compression library
3446+
version 1.2.11, January 15th, 2017
3447+
3448+
Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
3449+
3450+
This software is provided 'as-is', without any express or implied
3451+
warranty. In no event will the authors be held liable for any damages
3452+
arising from the use of this software.
3453+
3454+
Permission is granted to anyone to use this software for any purpose,
3455+
including commercial applications, and to alter it and redistribute it
3456+
freely, subject to the following restrictions:
3457+
3458+
1. The origin of this software must not be misrepresented; you must not
3459+
claim that you wrote the original software. If you use this software
3460+
in a product, an acknowledgment in the product documentation would be
3461+
appreciated but is not required.
3462+
2. Altered source versions must be plainly marked as such, and must not be
3463+
misrepresented as being the original software.
3464+
3. This notice may not be removed or altered from any source distribution.
3465+
3466+
Jean-loup Gailly Mark Adler
3467+
3468+
3469+
34423470
--------------------------------------------------------------------------------
34433471
## Pdfium (https://pdfium.googlesource.com/)
34443472

@@ -4060,31 +4088,3 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
40604088
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
40614089
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40624090

4063-
4064-
--------------------------------------------------------------------------------
4065-
## zlib (http://www.zlib.net/)
4066-
4067-
zlib.h -- interface of the 'zlib' general purpose compression library
4068-
version 1.2.11, January 15th, 2017
4069-
4070-
Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
4071-
4072-
This software is provided 'as-is', without any express or implied
4073-
warranty. In no event will the authors be held liable for any damages
4074-
arising from the use of this software.
4075-
4076-
Permission is granted to anyone to use this software for any purpose,
4077-
including commercial applications, and to alter it and redistribute it
4078-
freely, subject to the following restrictions:
4079-
4080-
1. The origin of this software must not be misrepresented; you must not
4081-
claim that you wrote the original software. If you use this software
4082-
in a product, an acknowledgment in the product documentation would be
4083-
appreciated but is not required.
4084-
2. Altered source versions must be plainly marked as such, and must not be
4085-
misrepresented as being the original software.
4086-
3. This notice may not be removed or altered from any source distribution.
4087-
4088-
Jean-loup Gailly Mark Adler
4089-
4090-

CHANGELOG.md

+16-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
11
## Newest Release
22

3+
### 2.9.0 - 22 Mar 2024
4+
5+
- Adds new getConfiguration method to retrieve current PSPDFKitView configuration options. (J#HYB-192)
6+
- Adds the option to open a password protected document through configuration. (J#HYB-213)
7+
- Adds the ability to add custom toolbar buttons to the PSPDFKit toolbar. (J#HYB-198)
8+
- Adds support for new `MeasurementValueConfiguration` configuration option, replacing deprecated `setMeasurementScale` and `setMeasurementPrecision` methods. (J#HYB-205)
9+
- Updates `showPageLabels` property to also control page number overlay on Android. (J#HYB-223)
10+
- Updates for PSPDFKit 2024.1.2 for Android.
11+
- Updates for PSPDFKit 13.3.3 for iOS.
12+
- Fixes issue of document URIs with file:/// scheme on iOS. (#43160)
13+
- Fixes issue where `onDocumentLoaded` callback was not called on Android. (#43187)
14+
- Fixes signatureSavingStrategy configuration option to save signature if enabled. (J#HYB-210)
15+
- Fixes `spreadFitting` configuration option behaviour on iOS. (J#HYB-222)
16+
17+
## Previous Releases
18+
319
### 2.8.1 - 27 Feb 2024
420

521
- Updates for PSPDFKit 13.3.1 for iOS. (#43565)
622
- Removes `scrollViewInsetAdjustment`, `spreadFitting` and `allowedMenuActions` configuration options which are deprecated in PSPDFKit for iOS. (#43565)
723

8-
## Previous Releases
9-
1024
### 2.8.0 - 18 Dec 2023
1125

1226
- Adds TypeScript types support to PSPDFKit plugin. (#42380)

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
All items and source code Copyright © 2010-2023 PSPDFKit GmbH.
1+
All items and source code Copyright © 2010-2024 PSPDFKit GmbH.
22

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

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,6 @@ For Troubleshooting common issues you might encounter when setting up PSPDFKit f
692692
## License
693693

694694
This project can be used for evaluation or if you have a valid PSPDFKit license.
695-
All items and source code Copyright © 2010-2023 PSPDFKit GmbH.
695+
All items and source code Copyright © 2010-2024 PSPDFKit GmbH.
696696

697697
See [LICENSE](./LICENSE) for details.

android/build.gradle

+9-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* PSPDFKit
55
*
6-
* Copyright © 2021-2023 PSPDFKit GmbH. All rights reserved.
6+
* Copyright © 2021-2024 PSPDFKit GmbH. All rights reserved.
77
*
88
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
99
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
@@ -15,7 +15,7 @@
1515
* Contains gradle configuration constants
1616
*/
1717
ext {
18-
PSPDFKIT_VERSION = '8.10.0'
18+
PSPDFKIT_VERSION = '2024.1.2'
1919
}
2020

2121
buildscript {
@@ -70,6 +70,13 @@ dependencies {
7070
api("com.pspdfkit:pspdfkit:${PSPDFKIT_VERSION}") {
7171
exclude group: 'com.google.auto.value', module: 'auto-value'
7272
}
73+
74+
implementation "androidx.compose.material:material:1.5.4"
75+
implementation "androidx.constraintlayout:constraintlayout:2.1.4"
76+
implementation "androidx.constraintlayout:constraintlayout-compose:1.0.1"
77+
implementation "androidx.compose.foundation:foundation:1.5.4"
78+
implementation "androidx.compose.ui:ui:1.5.4"
79+
7380
implementation "com.facebook.react:react-native:+"
7481
implementation 'com.squareup.okhttp3:okhttp:4.9.2'
7582
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

android/src/main/AndroidManifest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
~
55
~ PSPDFKit
66
~
7-
~ Copyright © 2017-2023 PSPDFKit GmbH. All rights reserved.
7+
~ Copyright © 2017-2024 PSPDFKit GmbH. All rights reserved.
88
~
99
~ THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
1010
~ AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.

android/src/main/java/com/pspdfkit/react/AnnotationConfigurationAdaptor.kt

+1-34
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Copyright © 2018-2023 PSPDFKit GmbH. All rights reserved.
2+
// Copyright © 2018-2024 PSPDFKit GmbH. All rights reserved.
33
//
44
// THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
55
// AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
@@ -34,7 +34,6 @@ import com.pspdfkit.annotations.configuration.SoundAnnotationConfiguration
3434
import com.pspdfkit.annotations.configuration.StampAnnotationConfiguration
3535
import com.pspdfkit.annotations.stamps.StampPickerItem
3636
import com.pspdfkit.configuration.annotations.AnnotationAggregationStrategy
37-
import com.pspdfkit.react.helper.MeasurementHelper
3837
import com.pspdfkit.ui.fonts.Font
3938
import com.pspdfkit.ui.inspector.views.BorderStylePreset
4039
import com.pspdfkit.ui.special_mode.controller.AnnotationTool
@@ -70,8 +69,6 @@ const val MIN_TEXT_SIZE = "minimumTextSize"
7069
const val MAX_TEXT_SIZE = "maximumTextSize"
7170
const val DEFAULT_FONT = "defaultFont"
7271
const val AVAILABLE_FONTS = "availableFonts"
73-
const val DEFAULT_SCALE = "defaultScale"
74-
const val DEFAULT_PRECISION = "defaultPrecision"
7572

7673
const val ANNOTATION_INK_PEN = "inkPen"
7774
const val ANNOTATION_INK_MAGIC = "inkMagic"
@@ -306,16 +303,6 @@ class AnnotationConfigurationAdaptor {
306303
)
307304
}
308305

309-
DEFAULT_SCALE -> configuration.getMap(key)?.let { scaleObject ->
310-
val scale = MeasurementHelper.getScale(scaleObject)
311-
builder.setDefaultScale(scale)
312-
}
313-
314-
DEFAULT_PRECISION -> configuration.getString(key)?.let { precisionString ->
315-
val precision = MeasurementHelper.getPrecision(precisionString)
316-
builder.setDefaultPrecision(precision)
317-
}
318-
319306
MAX_ALPHA -> builder.setMaxAlpha(configuration.getDouble(key).toFloat())
320307
MIN_ALPHA -> builder.setMinAlpha(configuration.getDouble(key).toFloat())
321308
MAX_THICKNESS -> builder.setMaxThickness(configuration.getDouble(key).toFloat())
@@ -366,16 +353,6 @@ class AnnotationConfigurationAdaptor {
366353
builder.setAvailableColors(extractColors(colors.toArrayList().map { it as String }))
367354
}
368355

369-
DEFAULT_SCALE -> configuration.getMap(key)?.let { scaleObject ->
370-
val scale = MeasurementHelper.getScale(scaleObject)
371-
builder.setDefaultScale(scale)
372-
}
373-
374-
DEFAULT_PRECISION -> configuration.getString(key)?.let { precisionString ->
375-
val precision = MeasurementHelper.getPrecision(precisionString)
376-
builder.setDefaultPrecision(precision)
377-
}
378-
379356
MAX_ALPHA -> builder.setMaxAlpha(configuration.getDouble(key).toFloat())
380357
MIN_ALPHA -> builder.setMinAlpha(configuration.getDouble(key).toFloat())
381358
MAX_THICKNESS -> builder.setMaxThickness(configuration.getDouble(key).toFloat())
@@ -429,16 +406,6 @@ class AnnotationConfigurationAdaptor {
429406
)
430407
}
431408

432-
DEFAULT_SCALE -> configuration.getMap(key)?.let { scaleObject ->
433-
val scale = MeasurementHelper.getScale(scaleObject)
434-
builder.setDefaultScale(scale)
435-
}
436-
437-
DEFAULT_PRECISION -> configuration.getString(key)?.let { precisionString ->
438-
val precision = MeasurementHelper.getPrecision(precisionString)
439-
builder.setDefaultPrecision(precision)
440-
}
441-
442409
DEFAULT_LINE_END -> configuration.getString(key)?.let { lineEndPair ->
443410
builder.setDefaultLineEnds(extractLineEndPair(lineEndPair))
444411
}

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

+58-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* PSPDFKit
55
*
6-
* Copyright © 2017-2023 PSPDFKit GmbH. All rights reserved.
6+
* Copyright © 2017-2024 PSPDFKit GmbH. All rights reserved.
77
*
88
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
99
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
@@ -325,6 +325,61 @@ public ConfigurationAdapter(@NonNull final Context context, ReadableMap configur
325325
}
326326
}
327327

328+
public static List<String> getStringValuesForConfigurationItems(final List<AnnotationType> items) {
329+
List<String> foundKeys = new ArrayList<>();
330+
for (AnnotationType item : items) {
331+
foundKeys.add(item.toString());
332+
}
333+
return foundKeys;
334+
}
335+
336+
public static String getStringValueForConfigurationItem(final Enum item) {
337+
String resolvedValue = "";
338+
if (item instanceof PageScrollDirection) {
339+
if (item == PageScrollDirection.HORIZONTAL) { resolvedValue = PAGE_SCROLL_DIRECTION_HORIZONTAL; }
340+
else if (item == PageScrollDirection.VERTICAL) { resolvedValue = PAGE_SCROLL_DIRECTION_VERTICAL; }
341+
}
342+
343+
if (item instanceof PageScrollMode) {
344+
if (item == PageScrollMode.PER_PAGE) { resolvedValue = PAGE_TRANSITION_PER_SPREAD; }
345+
else if (item == PageScrollMode.CONTINUOUS) { resolvedValue = PAGE_TRANSITION_CONTINUOUS; }
346+
}
347+
348+
if (item instanceof PageLayoutMode) {
349+
if (item == PageLayoutMode.AUTO) { resolvedValue = PAGE_MODE_AUTO; }
350+
else if (item == PageLayoutMode.SINGLE) { resolvedValue = PAGE_MODE_SINGLE; }
351+
else if (item == PageLayoutMode.DOUBLE) { resolvedValue = PAGE_MODE_DOUBLE; }
352+
}
353+
354+
if (item instanceof SignatureSavingStrategy) {
355+
if (item == SignatureSavingStrategy.ALWAYS_SAVE) { resolvedValue = SIGNATURE_SAVING_STRATEGY_ALWAYS; }
356+
else if (item == SignatureSavingStrategy.NEVER_SAVE) { resolvedValue = SIGNATURE_SAVING_STRATEGY_NEVER; }
357+
else if (item == SignatureSavingStrategy.SAVE_IF_SELECTED) { resolvedValue = SIGNATURE_SAVING_STRATEGY_IF_SELECTED; }
358+
}
359+
360+
if (item instanceof PageFitMode) {
361+
if (item == PageFitMode.FIT_TO_SCREEN) { resolvedValue = SPREAD_FITTING_FIT; }
362+
else if (item == PageFitMode.FIT_TO_WIDTH) { resolvedValue = SPREAD_FITTING_FILL; }
363+
}
364+
365+
if (item instanceof UserInterfaceViewMode) {
366+
if (item == UserInterfaceViewMode.USER_INTERFACE_VIEW_MODE_AUTOMATIC) { resolvedValue = USER_INTERFACE_VIEW_MODE_AUTOMATIC; }
367+
else if (item == UserInterfaceViewMode.USER_INTERFACE_VIEW_MODE_AUTOMATIC_BORDER_PAGES) { resolvedValue = USER_INTERFACE_VIEW_MODE_AUTOMATIC_BORDER_PAGES; }
368+
else if (item == UserInterfaceViewMode.USER_INTERFACE_VIEW_MODE_VISIBLE) { resolvedValue = USER_INTERFACE_VIEW_MODE_ALWAYS_VISIBLE; }
369+
else if (item == UserInterfaceViewMode.USER_INTERFACE_VIEW_MODE_HIDDEN) { resolvedValue = USER_INTERFACE_VIEW_MODE_ALWAYS_HIDDEN; }
370+
else if (item == UserInterfaceViewMode.USER_INTERFACE_VIEW_MODE_MANUAL) { resolvedValue = USER_INTERFACE_VIEW_MODE_ALWAYS_HIDDEN; }
371+
}
372+
373+
if (item instanceof ThumbnailBarMode) {
374+
if (item == ThumbnailBarMode.THUMBNAIL_BAR_MODE_FLOATING) { resolvedValue = SHOW_THUMBNAIL_BAR_FLOATING; }
375+
else if (item == ThumbnailBarMode.THUMBNAIL_BAR_MODE_NONE) { resolvedValue = SHOW_THUMBNAIL_BAR_NONE; }
376+
else if (item == ThumbnailBarMode.THUMBNAIL_BAR_MODE_SCROLLABLE) { resolvedValue = SHOW_THUMBNAIL_BAR_SCROLLABLE; }
377+
else if (item == ThumbnailBarMode.THUMBNAIL_BAR_MODE_PINNED) { resolvedValue = SHOW_THUMBNAIL_BAR_PINNED; }
378+
}
379+
380+
return resolvedValue;
381+
}
382+
328383
private void configureShowPageNumberOverlay(final boolean showPageNumberOverlay) {
329384
if (showPageNumberOverlay) {
330385
configuration.showPageNumberOverlay();
@@ -499,8 +554,10 @@ private void configureShowAnnotationListAction(final boolean showAnnotationListA
499554
private void configureShowPageLabels(final boolean showPageLabels) {
500555
if (showPageLabels) {
501556
configuration.showPageLabels();
557+
configuration.showPageNumberOverlay();
502558
} else {
503559
configuration.hidePageLabels();
560+
configuration.hidePageNumberOverlay();
504561
}
505562
}
506563

android/src/main/java/com/pspdfkit/react/MainActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* PSPDFKit
55
*
6-
* Copyright © 2017-2023 PSPDFKit GmbH. All rights reserved.
6+
* Copyright © 2017-2024 PSPDFKit GmbH. All rights reserved.
77
*
88
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
99
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.

android/src/main/java/com/pspdfkit/react/MainApplication.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* PSPDFKit
55
*
6-
* Copyright © 2017-2023 PSPDFKit GmbH. All rights reserved.
6+
* Copyright © 2017-2024 PSPDFKit GmbH. All rights reserved.
77
*
88
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
99
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.

android/src/main/java/com/pspdfkit/react/PSPDFKitModule.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* PSPDFKit
55
*
6-
* Copyright © 2017-2023 PSPDFKit GmbH. All rights reserved.
6+
* Copyright © 2017-2024 PSPDFKit GmbH. All rights reserved.
77
*
88
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
99
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.

android/src/main/java/com/pspdfkit/react/PSPDFKitPackage.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* PSPDFKit
55
*
6-
* Copyright © 2017-2023 PSPDFKit GmbH. All rights reserved.
6+
* Copyright © 2017-2024 PSPDFKit GmbH. All rights reserved.
77
*
88
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
99
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.

android/src/main/java/com/pspdfkit/react/RNInstantPdfActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.pspdfkit.react;
22

3-
/// Copyright © 2021-2023 PSPDFKit GmbH. All rights reserved.
3+
/// Copyright © 2021-2024 PSPDFKit GmbH. All rights reserved.
44
///
55
/// THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
66
/// AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.

android/src/main/java/com/pspdfkit/react/RNProcessor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* PSPDFKit
55
*
6-
* Copyright © 2017-2023 PSPDFKit GmbH. All rights reserved.
6+
* Copyright © 2017-2024 PSPDFKit GmbH. All rights reserved.
77
*
88
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
99
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.

0 commit comments

Comments
 (0)