Skip to content

Commit

Permalink
Release 2.16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
PSPDFKit committed Feb 26, 2025
1 parent 85ddc55 commit 4cbfc5c
Show file tree
Hide file tree
Showing 155 changed files with 6,194 additions and 3,335 deletions.
329 changes: 326 additions & 3 deletions ACKNOWLEDGEMENTS.md

Large diffs are not rendered by default.

291 changes: 155 additions & 136 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
All items and source code Copyright © 2010-2024 PSPDFKit GmbH.
All items and source code Copyright © 2010-2025 PSPDFKit GmbH.

The Nutrient SDK is a commercial product and requires a license to be used.

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ See our [Getting Started on React Native guide](https://www.nutrient.io/getting-
...
android {
- compileSdkVersion rootProject.ext.compileSdkVersion
+ compileSdkVersion 34
+ compileSdkVersion 35
...
defaultConfig {
applicationId "com.pspdfkitdemo"
Expand All @@ -139,7 +139,7 @@ See our [Getting Started on React Native guide](https://www.nutrient.io/getting-
```diff
...
- platform :ios, min_ios_version_supported
+ platform :ios, '15.0'
+ platform :ios, '16.0'
...
```

Expand All @@ -161,7 +161,7 @@ See our [Getting Started on React Native guide](https://www.nutrient.io/getting-
open PSPDFKitDemo.xcworkspace
```

1. Make sure the deployment target is set to 15.0 or higher:
1. Make sure the deployment target is set to 16.0 or higher:

![deployment-target](./screenshots/deployment-target.png)

Expand Down Expand Up @@ -268,6 +268,6 @@ For Troubleshooting common issues you might encounter when setting up the Nutrie
## License

This project can be used for evaluation or if you have a valid Nutrient license.
All items and source code Copyright © 2010-2024 PSPDFKit GmbH.
All items and source code Copyright © 2010-2025 PSPDFKit GmbH.

See [LICENSE](./LICENSE) for details.
2 changes: 1 addition & 1 deletion android/.classpath
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11/"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>
2 changes: 1 addition & 1 deletion android/.settings/org.eclipse.buildship.core.prefs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(8.9))
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=/Users/erhardbrand/Library/Java/JavaVirtualMachines/jdk-17.0.8.jdk/Contents/Home
java.home=/Library/Java/JavaVirtualMachines/temurin-8.jdk/Contents/Home
jvm.arguments=
offline.mode=false
override.workspace.settings=true
Expand Down
49 changes: 39 additions & 10 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* PSPDFKit
*
* Copyright © 2021-2024 PSPDFKit GmbH. All rights reserved.
* Copyright © 2021-2025 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.
Expand All @@ -15,45 +15,66 @@
* Contains gradle configuration constants
*/
ext {
PSPDFKIT_VERSION = '2024.8.1'
PSPDFKIT_VERSION = '10.0.1'
}

buildscript {
ext.kotlin_version = '1.9.24'
ext.kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.kotlinVersion :
rootProject.ext.has('kotlin_version') ? rootProject.ext.kotlin_version :
'1.9.24'

ext.getComposeVersion = { kotlin_version ->
switch (kotlin_version) {
case ~/2\..*/:
// For Kotlin 2.x+, compose compiler is handled by the plugin
return null
case '1.9.25': return '1.5.15'
case '1.9.24': return '1.5.14'
default: return '1.5.14'
}
}

repositories {
mavenCentral()
google()
maven {
url 'https://maven.google.com'
}
maven {
url 'https://customers.pspdfkit.com/maven/'
url 'https://my.nutrient.io/maven/'
}
}

dependencies {
classpath("com.android.tools.build:gradle:8.5.0")
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// Add Compose compiler plugin for Kotlin 2.0+
if (kotlin_version.startsWith('2')) {
classpath "org.jetbrains.kotlin:compose-compiler-gradle-plugin:$kotlin_version"
}
}
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
// Add Compose compiler plugin for Kotlin 2.0+
if (kotlin_version.startsWith('2')) {
apply plugin: 'org.jetbrains.kotlin.plugin.compose'
}

android {
compileSdkVersion 34
buildToolsVersion "34.0.0"

namespace "com.pspdfkit.react"

defaultConfig {
minSdkVersion 21
minSdkVersion 24
targetSdkVersion 34
versionCode 1
versionName "1.0"
}

compileOptions {
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
Expand All @@ -68,7 +89,11 @@ android {
}

composeOptions {
kotlinCompilerExtensionVersion "1.5.14"
def composeVersion = getComposeVersion(kotlin_version)
if (composeVersion != null) {
kotlinCompilerExtensionVersion composeVersion
}
// When using Kotlin 2.0+, the kotlinCompilerExtensionVersion is handled by the plugin
}

kotlin {
Expand All @@ -77,11 +102,15 @@ android {
}

dependencies {
api("com.pspdfkit:pspdfkit:${PSPDFKIT_VERSION}") {
api("io.nutrient:nutrient:${PSPDFKIT_VERSION}") {
exclude group: 'com.google.auto.value', module: 'auto-value'
exclude group: 'androidx.recyclerview', module: 'recyclerview'
}

implementation "com.facebook.react:react-native:+"
implementation 'com.squareup.okhttp3:okhttp:4.9.2'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "androidx.compose.material:material:1.7.8"
implementation "androidx.compose.material3:material3:1.3.1"
implementation "androidx.recyclerview:recyclerview:1.3.2"
}
2 changes: 1 addition & 1 deletion android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
~
~ PSPDFKit
~
~ Copyright © 2017-2024 PSPDFKit GmbH. All rights reserved.
~ Copyright © 2017-2025 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright © 2018-2024 PSPDFKit GmbH. All rights reserved.
// Copyright © 2018-2025 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* PSPDFKit
*
* Copyright © 2017-2024 PSPDFKit GmbH. All rights reserved.
* Copyright © 2017-2025 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.
Expand Down
2 changes: 1 addition & 1 deletion android/src/main/java/com/pspdfkit/react/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* PSPDFKit
*
* Copyright © 2017-2024 PSPDFKit GmbH. All rights reserved.
* Copyright © 2017-2025 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* PSPDFKit
*
* Copyright © 2017-2024 PSPDFKit GmbH. All rights reserved.
* Copyright © 2017-2025 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import com.facebook.react.bridge.WritableMap
import com.pspdfkit.PSPDFKit
import com.pspdfkit.analytics.AnalyticsClient
import com.pspdfkit.annotations.Annotation
import com.pspdfkit.annotations.AnnotationType
import com.pspdfkit.annotations.WidgetAnnotation
import com.pspdfkit.forms.ChoiceFormElement
import com.pspdfkit.forms.ComboBoxFormElement
import com.pspdfkit.forms.EditableButtonFormElement
Expand All @@ -27,6 +29,7 @@ enum class NotificationEvent(val value: String) {
DOCUMENT_LOADED("documentLoaded"),
DOCUMENT_LOAD_FAILED("documentLoadFailed"),
DOCUMENT_PAGE_CHANGED("documentPageChanged"),
DOCUMENT_SCROLLED("documentScrolled"),
ANNOTATIONS_ADDED("annotationsAdded"),
ANNOTATION_CHANGED("annotationChanged"),
ANNOTATIONS_REMOVED("annotationsRemoved"),
Expand Down Expand Up @@ -87,6 +90,18 @@ object NutrientNotificationCenter {
sendEvent(NotificationEvent.DOCUMENT_PAGE_CHANGED.value, jsonData)
}

fun documentScrolled(scrollData: Map<String, Int>, documentID: String) {
val jsonData = Arguments.createMap()
val scrollDataMap = Arguments.createMap()
scrollData.forEach { (key, value) ->
scrollDataMap.putInt(key, value)
}
jsonData.putString("event", NotificationEvent.DOCUMENT_SCROLLED.value)
jsonData.putMap("scrollData", scrollDataMap)
jsonData.putString("documentID", documentID)
sendEvent(NotificationEvent.DOCUMENT_SCROLLED.value, jsonData)
}

fun annotationsChanged(changeType: String, annotation: Annotation, documentID: String) {
when (changeType) {
"changed" -> {
Expand All @@ -95,6 +110,10 @@ object NutrientNotificationCenter {
val annotationsList = mutableListOf<Map<String, Any>>()
val annotationMap = JsonUtilities.jsonObjectToMap(instantJson)
annotationMap["uuid"] = annotation.uuid
if (annotation.type == AnnotationType.WIDGET) {
val widgetAnnotation : WidgetAnnotation = annotation as WidgetAnnotation
annotationMap["isRequired"] = widgetAnnotation.formElement?.isRequired
}
annotationsList.add(annotationMap)
val nativeAnnotationsList = Arguments.makeNativeArray(annotationsList)

Expand Down Expand Up @@ -128,6 +147,10 @@ object NutrientNotificationCenter {
val annotationsList = mutableListOf<Map<String, Any>>()
val annotationMap = JsonUtilities.jsonObjectToMap(instantJson)
annotationMap["uuid"] = annotation.uuid
if (annotation.type == AnnotationType.WIDGET) {
val widgetAnnotation : WidgetAnnotation = annotation as WidgetAnnotation
annotationMap["isRequired"] = widgetAnnotation.formElement?.isRequired
}
annotationsList.add(annotationMap)
val nativeAnnotationsList = Arguments.makeNativeArray(annotationsList)

Expand All @@ -149,6 +172,10 @@ object NutrientNotificationCenter {
val annotationsList = mutableListOf<Map<String, Any>>()
val annotationMap = JsonUtilities.jsonObjectToMap(instantJson)
annotationMap["uuid"] = annotation.uuid
if (annotation.type == AnnotationType.WIDGET) {
val widgetAnnotation : WidgetAnnotation = annotation as WidgetAnnotation
annotationMap["isRequired"] = widgetAnnotation.formElement?.isRequired
}
annotationsList.add(annotationMap)
val nativeAnnotationsList = Arguments.makeNativeArray(annotationsList)

Expand All @@ -168,6 +195,10 @@ object NutrientNotificationCenter {
val annotationsList = mutableListOf<Map<String, Any>>()
val annotationMap = JsonUtilities.jsonObjectToMap(instantJson)
annotationMap["uuid"] = annotation.uuid
if (annotation.type == AnnotationType.WIDGET) {
val widgetAnnotation : WidgetAnnotation = annotation as WidgetAnnotation
annotationMap["isRequired"] = widgetAnnotation.formElement?.isRequired
}
annotationsList.add(annotationMap)
val nativeAnnotationsList = Arguments.makeNativeArray(annotationsList)

Expand All @@ -186,6 +217,10 @@ object NutrientNotificationCenter {
val instantJson = JSONObject(annotation.toInstantJson())
val annotationMap = JsonUtilities.jsonObjectToMap(instantJson)
annotationMap["uuid"] = annotation.uuid
if (annotation.type == AnnotationType.WIDGET) {
val widgetAnnotation : WidgetAnnotation = annotation as WidgetAnnotation
annotationMap["isRequired"] = widgetAnnotation.formElement?.isRequired
}
val nativeAnnotationMap = Arguments.makeNativeMap(annotationMap)

val pointMap = mapOf("x" to pointF.x, "y" to pointF.y)
Expand Down Expand Up @@ -217,6 +252,10 @@ object NutrientNotificationCenter {
val annotationsList = mutableListOf<Map<String, Any>>()
val annotationMap = JsonUtilities.jsonObjectToMap(instantJson)
annotationMap["uuid"] = annotation.uuid
if (annotation.type == AnnotationType.WIDGET) {
val widgetAnnotation : WidgetAnnotation = annotation as WidgetAnnotation
annotationMap["isRequired"] = widgetAnnotation.formElement?.isRequired
}

(formField.formElement as? TextFormElement).let { textFormElement ->
if (textFormElement != null) {
Expand Down Expand Up @@ -258,6 +297,10 @@ object NutrientNotificationCenter {
val instantJson = JSONObject(annotation.toInstantJson())
val annotationMap = JsonUtilities.jsonObjectToMap(instantJson)
annotationMap["uuid"] = annotation.uuid
if (annotation.type == AnnotationType.WIDGET) {
val widgetAnnotation : WidgetAnnotation = annotation as WidgetAnnotation
annotationMap["isRequired"] = widgetAnnotation.formElement?.isRequired
}

(formElement as? TextFormElement).let { textFormElement ->
if (textFormElement != null) {
Expand Down Expand Up @@ -297,6 +340,10 @@ object NutrientNotificationCenter {
val instantJson = JSONObject(annotation.toInstantJson())
val annotationMap = JsonUtilities.jsonObjectToMap(instantJson)
annotationMap["uuid"] = annotation.uuid
if (annotation.type == AnnotationType.WIDGET) {
val widgetAnnotation : WidgetAnnotation = annotation as WidgetAnnotation
annotationMap["isRequired"] = widgetAnnotation.formElement?.isRequired
}

(formElement as? TextFormElement).let { textFormElement ->
if (textFormElement != null) {
Expand Down
Loading

0 comments on commit 4cbfc5c

Please sign in to comment.