Skip to content

Commit c476007

Browse files
author
PSPDFKit
committed
Release 2.5.0
1 parent c1d809b commit c476007

File tree

79 files changed

+5134
-8629
lines changed

Some content is hidden

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

79 files changed

+5134
-8629
lines changed

.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
module.exports = {
22
root: true,
33
extends: '@react-native-community',
4+
parserOptions: {
5+
requireConfigFile: false,
6+
},
47
rules: {
58
'react/no-string-refs': 'off',
69
'no-alert': 'off',

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ PSPDFKit/PSPDFKitUI.xcframework
5050
# UWP license file
5151
samples/Catalog/windows/Catalog/License.xaml
5252

53-
.fake
53+
.fake

.rubocop.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
inherit_from: ../../.rubocop.yml
2+
3+
Naming/FileName:
4+
Enabled: false

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ruby 3.1.3

ACKNOWLEDGEMENTS.md

Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,200 @@ FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
543543
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
544544
DEALINGS IN THE SOFTWARE.
545545

546+
--------------------------------------------------------------------------------
547+
Apache License
548+
Version 2.0, January 2004
549+
http://www.apache.org/licenses/
550+
551+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
552+
553+
1. Definitions.
554+
555+
"License" shall mean the terms and conditions for use, reproduction, and
556+
distribution as defined by Sections 1 through 9 of this document.
557+
558+
"Licensor" shall mean the copyright owner or entity authorized by the copyright
559+
owner that is granting the License.
560+
561+
"Legal Entity" shall mean the union of the acting entity and all other entities
562+
that control, are controlled by, or are under common control with that entity.
563+
For the purposes of this definition, "control" means (i) the power, direct or
564+
indirect, to cause the direction or management of such entity, whether by
565+
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
566+
outstanding shares, or (iii) beneficial ownership of such entity.
567+
568+
"You" (or "Your") shall mean an individual or Legal Entity exercising
569+
permissions granted by this License.
570+
571+
"Source" form shall mean the preferred form for making modifications, including
572+
but not limited to software source code, documentation source, and configuration
573+
files.
574+
575+
"Object" form shall mean any form resulting from mechanical transformation or
576+
translation of a Source form, including but not limited to compiled object code,
577+
generated documentation, and conversions to other media types.
578+
579+
"Work" shall mean the work of authorship, whether in Source or Object form, made
580+
available under the License, as indicated by a copyright notice that is included
581+
in or attached to the work (an example is provided in the Appendix below).
582+
583+
"Derivative Works" shall mean any work, whether in Source or Object form, that
584+
is based on (or derived from) the Work and for which the editorial revisions,
585+
annotations, elaborations, or other modifications represent, as a whole, an
586+
original work of authorship. For the purposes of this License, Derivative Works
587+
shall not include works that remain separable from, or merely link (or bind by
588+
name) to the interfaces of, the Work and Derivative Works thereof.
589+
590+
"Contribution" shall mean any work of authorship, including the original version
591+
of the Work and any modifications or additions to that Work or Derivative Works
592+
thereof, that is intentionally submitted to Licensor for inclusion in the Work
593+
by the copyright owner or by an individual or Legal Entity authorized to submit
594+
on behalf of the copyright owner. For the purposes of this definition,
595+
"submitted" means any form of electronic, verbal, or written communication sent
596+
to the Licensor or its representatives, including but not limited to
597+
communication on electronic mailing lists, source code control systems, and
598+
issue tracking systems that are managed by, or on behalf of, the Licensor for
599+
the purpose of discussing and improving the Work, but excluding communication
600+
that is conspicuously marked or otherwise designated in writing by the copyright
601+
owner as "Not a Contribution."
602+
603+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
604+
of whom a Contribution has been received by Licensor and subsequently
605+
incorporated within the Work.
606+
607+
2. Grant of Copyright License.
608+
609+
Subject to the terms and conditions of this License, each Contributor hereby
610+
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
611+
irrevocable copyright license to reproduce, prepare Derivative Works of,
612+
publicly display, publicly perform, sublicense, and distribute the Work and such
613+
Derivative Works in Source or Object form.
614+
615+
3. Grant of Patent License.
616+
617+
Subject to the terms and conditions of this License, each Contributor hereby
618+
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
619+
irrevocable (except as stated in this section) patent license to make, have
620+
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
621+
such license applies only to those patent claims licensable by such Contributor
622+
that are necessarily infringed by their Contribution(s) alone or by combination
623+
of their Contribution(s) with the Work to which such Contribution(s) was
624+
submitted. If You institute patent litigation against any entity (including a
625+
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
626+
Contribution incorporated within the Work constitutes direct or contributory
627+
patent infringement, then any patent licenses granted to You under this License
628+
for that Work shall terminate as of the date such litigation is filed.
629+
630+
4. Redistribution.
631+
632+
You may reproduce and distribute copies of the Work or Derivative Works thereof
633+
in any medium, with or without modifications, and in Source or Object form,
634+
provided that You meet the following conditions:
635+
636+
You must give any other recipients of the Work or Derivative Works a copy of
637+
this License; and
638+
You must cause any modified files to carry prominent notices stating that You
639+
changed the files; and
640+
You must retain, in the Source form of any Derivative Works that You distribute,
641+
all copyright, patent, trademark, and attribution notices from the Source form
642+
of the Work, excluding those notices that do not pertain to any part of the
643+
Derivative Works; and
644+
If the Work includes a "NOTICE" text file as part of its distribution, then any
645+
Derivative Works that You distribute must include a readable copy of the
646+
attribution notices contained within such NOTICE file, excluding those notices
647+
that do not pertain to any part of the Derivative Works, in at least one of the
648+
following places: within a NOTICE text file distributed as part of the
649+
Derivative Works; within the Source form or documentation, if provided along
650+
with the Derivative Works; or, within a display generated by the Derivative
651+
Works, if and wherever such third-party notices normally appear. The contents of
652+
the NOTICE file are for informational purposes only and do not modify the
653+
License. You may add Your own attribution notices within Derivative Works that
654+
You distribute, alongside or as an addendum to the NOTICE text from the Work,
655+
provided that such additional attribution notices cannot be construed as
656+
modifying the License.
657+
You may add Your own copyright statement to Your modifications and may provide
658+
additional or different license terms and conditions for use, reproduction, or
659+
distribution of Your modifications, or for any such Derivative Works as a whole,
660+
provided Your use, reproduction, and distribution of the Work otherwise complies
661+
with the conditions stated in this License.
662+
663+
5. Submission of Contributions.
664+
665+
Unless You explicitly state otherwise, any Contribution intentionally submitted
666+
for inclusion in the Work by You to the Licensor shall be under the terms and
667+
conditions of this License, without any additional terms or conditions.
668+
Notwithstanding the above, nothing herein shall supersede or modify the terms of
669+
any separate license agreement you may have executed with Licensor regarding
670+
such Contributions.
671+
672+
6. Trademarks.
673+
674+
This License does not grant permission to use the trade names, trademarks,
675+
service marks, or product names of the Licensor, except as required for
676+
reasonable and customary use in describing the origin of the Work and
677+
reproducing the content of the NOTICE file.
678+
679+
7. Disclaimer of Warranty.
680+
681+
Unless required by applicable law or agreed to in writing, Licensor provides the
682+
Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
683+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
684+
including, without limitation, any warranties or conditions of TITLE,
685+
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
686+
solely responsible for determining the appropriateness of using or
687+
redistributing the Work and assume any risks associated with Your exercise of
688+
permissions under this License.
689+
690+
8. Limitation of Liability.
691+
692+
In no event and under no legal theory, whether in tort (including negligence),
693+
contract, or otherwise, unless required by applicable law (such as deliberate
694+
and grossly negligent acts) or agreed to in writing, shall any Contributor be
695+
liable to You for damages, including any direct, indirect, special, incidental,
696+
or consequential damages of any character arising as a result of this License or
697+
out of the use or inability to use the Work (including but not limited to
698+
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
699+
any and all other commercial damages or losses), even if such Contributor has
700+
been advised of the possibility of such damages.
701+
702+
9. Accepting Warranty or Additional Liability.
703+
704+
While redistributing the Work or Derivative Works thereof, You may choose to
705+
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
706+
other liability obligations and/or rights consistent with this License. However,
707+
in accepting such obligations, You may act only on Your own behalf and on Your
708+
sole responsibility, not on behalf of any other Contributor, and only if You
709+
agree to indemnify, defend, and hold each Contributor harmless for any liability
710+
incurred by, or claims asserted against, such Contributor by reason of your
711+
accepting any such warranty or additional liability.
712+
713+
END OF TERMS AND CONDITIONS
714+
715+
APPENDIX: How to apply the Apache License to your work
716+
717+
To apply the Apache License to your work, attach the following boilerplate
718+
notice, with the fields enclosed by brackets "[]" replaced with your own
719+
identifying information. (Don't include the brackets!) The text should be
720+
enclosed in the appropriate comment syntax for the file format. We also
721+
recommend that a file or class name and description of purpose be included on
722+
the same "printed page" as the copyright notice for easier identification within
723+
third-party archives.
724+
725+
Copyright [yyyy] [name of copyright owner]
726+
727+
Licensed under the Apache License, Version 2.0 (the "License");
728+
you may not use this file except in compliance with the License.
729+
You may obtain a copy of the License at
730+
731+
http://www.apache.org/licenses/LICENSE-2.0
732+
733+
Unless required by applicable law or agreed to in writing, software
734+
distributed under the License is distributed on an "AS IS" BASIS,
735+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
736+
See the License for the specific language governing permissions and
737+
limitations under the License.
738+
739+
546740
--------------------------------------------------------------------------------
547741
## djinni-support-lib (https://github.com/cross-language-cpp/djinni-support-lib)
548742

@@ -1744,6 +1938,33 @@ LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
17441938
OF THIS SOFTWARE.
17451939

17461940

1941+
--------------------------------------------------------------------------------
1942+
## LoopKit (https://github.com/LoopKit/LoopKit)
1943+
1944+
The MIT License (MIT)
1945+
1946+
Copyright (c) 2015 Nathan Racklyeft
1947+
Copyright (c) 2016 LoopKit Authors
1948+
1949+
Permission is hereby granted, free of charge, to any person obtaining a copy
1950+
of this software and associated documentation files (the "Software"), to deal
1951+
in the Software without restriction, including without limitation the rights
1952+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1953+
copies of the Software, and to permit persons to whom the Software is
1954+
furnished to do so, subject to the following conditions:
1955+
1956+
The above copyright notice and this permission notice shall be included in all
1957+
copies or substantial portions of the Software.
1958+
1959+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1960+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1961+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1962+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1963+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1964+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1965+
SOFTWARE.
1966+
1967+
17471968
--------------------------------------------------------------------------------
17481969
## Mantle (https://github.com/Mantle/Mantle)
17491970

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
## Newest Release
2+
- Added magic ink tool for Android annotation toolbar configuration. (#39174)
3+
- Upgrades React Native dependencies and project configuration to 0.71.2
4+
- Adds Instant JSON for React Native
25

36
### 2.4.2 - 01 Feb 2023
47
- Fixes bug issue for deleting multiple annotations (#38518)

android/build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* Contains gradle configuration constants
1616
*/
1717
ext {
18-
PSPDFKIT_VERSION = '8.5.0'
18+
PSPDFKIT_VERSION = 'SNAPSHOT'
1919
}
2020

2121
buildscript {
@@ -25,7 +25,7 @@ buildscript {
2525
url 'https://maven.google.com'
2626
}
2727
maven {
28-
url 'https://customers.pspdfkit.com/maven'
28+
url 'https://customers.pspdfkit.com/maven/'
2929
}
3030
}
3131

@@ -37,12 +37,12 @@ buildscript {
3737
apply plugin: 'com.android.library'
3838

3939
android {
40-
compileSdkVersion 30
40+
compileSdkVersion 33
4141
buildToolsVersion "30.0.2"
4242

4343
defaultConfig {
4444
minSdkVersion 21
45-
targetSdkVersion 30
45+
targetSdkVersion 33
4646
versionCode 1
4747
versionName "1.0"
4848
}
@@ -62,4 +62,5 @@ dependencies {
6262
exclude group: 'com.google.auto.value', module: 'auto-value'
6363
}
6464
implementation "com.facebook.react:react-native:+"
65+
implementation 'com.squareup.okhttp3:okhttp:4.9.2'
6566
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
import com.pspdfkit.document.image.GalleryImagePickerFragment;
4242
import com.pspdfkit.document.processor.PdfProcessor;
4343
import com.pspdfkit.document.processor.PdfProcessorTask;
44-
import com.pspdfkit.instant.ui.InstantPdfActivity;
44+
import com.pspdfkit.react.RNInstantPdfActivity;
4545
import com.pspdfkit.listeners.SimpleDocumentListener;
4646
import com.pspdfkit.react.helper.ConversionHelpers;
4747
import com.pspdfkit.ui.PdfActivity;
@@ -173,7 +173,7 @@ public void presentInstant(@NonNull String serverUrl, @NonNull String jwt, @NonN
173173
ConfigurationAdapter configurationAdapter = new ConfigurationAdapter(getCurrentActivity(), configuration);
174174

175175
lastPresentPromise = promise;
176-
InstantPdfActivity.showInstantDocument(getCurrentActivity(), serverUrl, jwt, configurationAdapter.build());
176+
RNInstantPdfActivity.showInstantDocument(getCurrentActivity(), serverUrl, jwt, configurationAdapter.build());
177177
}
178178
}
179179

@@ -213,7 +213,7 @@ public void run() {
213213
@ReactMethod
214214
public void setLicenseKey(@Nullable String licenseKey, @Nullable Promise promise) {
215215
try {
216-
PSPDFKit.initialize(resumedActivity, licenseKey, new ArrayList<>(), HYBRID_TECHNOLOGY);
216+
PSPDFKit.initialize(getCurrentActivity(), licenseKey, new ArrayList<>(), HYBRID_TECHNOLOGY);
217217
promise.resolve("Initialised PSPDFKit");
218218
} catch (InvalidPSPDFKitLicenseException e) {
219219
promise.reject(e);
@@ -225,7 +225,7 @@ public void setLicenseKeys(@Nullable String androidLicenseKey, @Nullable String
225225
// Here, we ignore the `iOSLicenseKey` parameter and only care about `androidLicenseKey`.
226226
// `iOSLicenseKey` will be used to activate the license on iOS.
227227
try {
228-
PSPDFKit.initialize(resumedActivity, androidLicenseKey, new ArrayList<>(), HYBRID_TECHNOLOGY);
228+
PSPDFKit.initialize(getCurrentActivity(), androidLicenseKey, new ArrayList<>(), HYBRID_TECHNOLOGY);
229229
promise.resolve("Initialised PSPDFKit");
230230
} catch (InvalidPSPDFKitLicenseException e) {
231231
promise.reject(e);
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package com.pspdfkit.react;
2+
3+
/// Copyright © 2021-2023 PSPDFKit GmbH. All rights reserved.
4+
///
5+
/// THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
6+
/// AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
7+
/// UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
8+
/// This notice may not be removed from this file.
9+
///
10+
11+
import android.util.Log;
12+
13+
import androidx.annotation.NonNull;
14+
15+
import com.pspdfkit.document.PdfDocument;
16+
import com.pspdfkit.instant.document.InstantPdfDocument;
17+
import com.pspdfkit.instant.exceptions.InstantException;
18+
import com.pspdfkit.instant.ui.InstantPdfActivity;
19+
20+
public class RNInstantPdfActivity extends InstantPdfActivity {
21+
22+
@Override
23+
public void onDocumentLoaded(@NonNull PdfDocument document) {
24+
super.onDocumentLoaded(document);
25+
}
26+
27+
@Override
28+
public void onSyncError(@NonNull InstantPdfDocument instantDocument, @NonNull InstantException error) {
29+
super.onSyncError(instantDocument, error);
30+
}
31+
32+
@Override
33+
public void onSyncFinished(@NonNull InstantPdfDocument instantDocument) {
34+
super.onSyncFinished(instantDocument);
35+
Log.d("RNInstant::::::", "onSyncFinished: ");
36+
}
37+
38+
@Override
39+
public void onSyncStarted(@NonNull InstantPdfDocument instantDocument) {
40+
super.onSyncStarted(instantDocument);
41+
Log.d("RNInstant::::::", "onSyncStarted: ");
42+
}
43+
}

android/src/main/java/com/pspdfkit/react/menu/ReactGroupingRule.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@ private int getIdFromName(@NonNull String name) {
134134
return R.id.pspdf__annotation_creation_toolbar_item_redaction;
135135
case "picker":
136136
return R.id.pspdf__annotation_creation_toolbar_item_picker;
137+
case "magic_ink":
138+
return R.id.pspdf__annotation_creation_toolbar_item_magic_ink;
139+
case "undo":
140+
return R.id.pspdf__annotation_creation_toolbar_item_undo;
141+
case "redo":
142+
return R.id.pspdf__annotation_creation_toolbar_item_redo;
137143
}
138144

139145
Log.i(TAG, String.format("Received unknown menu item %s.", name));

0 commit comments

Comments
 (0)