@amafil/react-native-pdf-toolkit 1.1.3 → 1.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/.gradle/8.5/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/8.5/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/8.5/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/8.5/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/file-system.probe +0 -0
- package/android/build/.transforms/2892d280277a194daf04e3af971b529e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/wonday/pdf/PdfView$1.dex +0 -0
- package/android/build/.transforms/2892d280277a194daf04e3af971b529e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/wonday/pdf/PdfView$2.dex +0 -0
- package/android/build/.transforms/2892d280277a194daf04e3af971b529e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/wonday/pdf/PdfView$3.dex +0 -0
- package/android/build/.transforms/2892d280277a194daf04e3af971b529e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/wonday/pdf/PdfView$AnnotationOverlayView$1.dex +0 -0
- package/android/build/.transforms/2892d280277a194daf04e3af971b529e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/wonday/pdf/PdfView$AnnotationOverlayView$AnnotationHit.dex +0 -0
- package/android/build/.transforms/2892d280277a194daf04e3af971b529e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/wonday/pdf/PdfView$AnnotationOverlayView$AnnotationSelectionHit.dex +0 -0
- package/android/build/.transforms/2892d280277a194daf04e3af971b529e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/wonday/pdf/PdfView$AnnotationOverlayView.dex +0 -0
- package/android/build/.transforms/2892d280277a194daf04e3af971b529e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/wonday/pdf/PdfView$PageRenderInfo.dex +0 -0
- package/android/build/.transforms/2892d280277a194daf04e3af971b529e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/wonday/pdf/PdfView.dex +0 -0
- package/android/build/.transforms/2892d280277a194daf04e3af971b529e/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/.transforms/e40f3b884607647e8beb6dabe8165962/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -1
- package/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +1 -1
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +1 -1
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +1 -1
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/org/wonday/pdf/PdfView$1.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/org/wonday/pdf/PdfView$2.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/org/wonday/pdf/PdfView$3.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/org/wonday/pdf/PdfView$AnnotationOverlayView$1.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/org/wonday/pdf/PdfView$AnnotationOverlayView$AnnotationHit.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/org/wonday/pdf/PdfView$AnnotationOverlayView$AnnotationSelectionHit.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/org/wonday/pdf/PdfView$AnnotationOverlayView.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/org/wonday/pdf/PdfView$PageRenderInfo.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/org/wonday/pdf/PdfView.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/wonday/pdf/PdfView$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/wonday/pdf/PdfView$2.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/wonday/pdf/PdfView$3.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/wonday/pdf/PdfView$AnnotationOverlayView$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/wonday/pdf/PdfView$AnnotationOverlayView$AnnotationHit.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/wonday/pdf/PdfView$AnnotationOverlayView$AnnotationSelectionHit.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/wonday/pdf/PdfView$AnnotationOverlayView.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/wonday/pdf/PdfView$PageRenderInfo.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/wonday/pdf/PdfView.class +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/PdfManager.class.uniqueId7 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/{PdfView$1.class.uniqueId0 → PdfView$1.class.uniqueId3} +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/PdfView$2.class.uniqueId5 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/PdfView$AnnotationOverlayView$1.class.uniqueId6 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/PdfView$AnnotationOverlayView$AnnotationHit.class.uniqueId1 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/PdfView$AnnotationOverlayView$AnnotationSelectionHit.class.uniqueId9 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/PdfView$AnnotationOverlayView.class.uniqueId8 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/PdfView$PageRenderInfo.class.uniqueId0 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/PdfView.class.uniqueId2 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/src/main/java/org/wonday/pdf/PdfManager.java +6 -7
- package/android/src/main/java/org/wonday/pdf/PdfView.java +155 -91
- package/index.d.ts +2 -1
- package/index.js +2 -0
- package/index.js.flow +2 -1
- package/ios/RNPDFPdf/RNPDFPdfView.mm +199 -83
- package/package.json +1 -1
- package/android/build/.transforms/3337b950908a4f6985ba400cb8386b0b/results.bin +0 -1
- package/android/build/.transforms/3337b950908a4f6985ba400cb8386b0b/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/react/viewmanagers/RNPDFPdfViewManagerDelegate.dex +0 -0
- package/android/build/.transforms/3337b950908a4f6985ba400cb8386b0b/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/react/viewmanagers/RNPDFPdfViewManagerInterface.dex +0 -0
- package/android/build/.transforms/3337b950908a4f6985ba400cb8386b0b/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/wonday/pdf/BuildConfig.dex +0 -0
- package/android/build/.transforms/3337b950908a4f6985ba400cb8386b0b/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/wonday/pdf/PdfManager.dex +0 -0
- package/android/build/.transforms/3337b950908a4f6985ba400cb8386b0b/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/wonday/pdf/PdfView$1.dex +0 -0
- package/android/build/.transforms/3337b950908a4f6985ba400cb8386b0b/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/wonday/pdf/PdfView$2.dex +0 -0
- package/android/build/.transforms/3337b950908a4f6985ba400cb8386b0b/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/wonday/pdf/PdfView$3.dex +0 -0
- package/android/build/.transforms/3337b950908a4f6985ba400cb8386b0b/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/wonday/pdf/PdfView.dex +0 -0
- package/android/build/.transforms/3337b950908a4f6985ba400cb8386b0b/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/wonday/pdf/RNPDFPackage.dex +0 -0
- package/android/build/.transforms/3337b950908a4f6985ba400cb8386b0b/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/wonday/pdf/events/TopChangeEvent.dex +0 -0
- package/android/build/.transforms/3337b950908a4f6985ba400cb8386b0b/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/.transforms/787b9137f14dcc9eebbb21ac62a7be22/results.bin +0 -1
- package/android/build/.transforms/787b9137f14dcc9eebbb21ac62a7be22/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/.transforms/79ca1220a602ed0c9c23366e0e92a6d1/results.bin +0 -1
- package/android/build/.transforms/79ca1220a602ed0c9c23366e0e92a6d1/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/react/viewmanagers/RNPDFPdfViewManagerDelegate.dex +0 -0
- package/android/build/.transforms/79ca1220a602ed0c9c23366e0e92a6d1/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/react/viewmanagers/RNPDFPdfViewManagerInterface.dex +0 -0
- package/android/build/.transforms/79ca1220a602ed0c9c23366e0e92a6d1/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/wonday/pdf/BuildConfig.dex +0 -0
- package/android/build/.transforms/79ca1220a602ed0c9c23366e0e92a6d1/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/wonday/pdf/PdfManager.dex +0 -0
- package/android/build/.transforms/79ca1220a602ed0c9c23366e0e92a6d1/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/wonday/pdf/PdfView$1.dex +0 -0
- package/android/build/.transforms/79ca1220a602ed0c9c23366e0e92a6d1/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/wonday/pdf/PdfView$2.dex +0 -0
- package/android/build/.transforms/79ca1220a602ed0c9c23366e0e92a6d1/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/wonday/pdf/PdfView$3.dex +0 -0
- package/android/build/.transforms/79ca1220a602ed0c9c23366e0e92a6d1/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/wonday/pdf/PdfView.dex +0 -0
- package/android/build/.transforms/79ca1220a602ed0c9c23366e0e92a6d1/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/wonday/pdf/RNPDFPackage.dex +0 -0
- package/android/build/.transforms/79ca1220a602ed0c9c23366e0e92a6d1/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/wonday/pdf/events/TopChangeEvent.dex +0 -0
- package/android/build/.transforms/79ca1220a602ed0c9c23366e0e92a6d1/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/.transforms/c29f40a753b0ae1d85db8c8c5812fc85/results.bin +0 -1
- package/android/build/.transforms/c29f40a753b0ae1d85db8c8c5812fc85/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +0 -7
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +0 -18
- package/android/build/intermediates/aar_main_jar/debug/syncDebugLibJars/classes.jar +0 -0
- package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +0 -5
- package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +0 -1
- package/android/build/intermediates/annotation_processor_list/debugAndroidTest/annotationProcessors.json +0 -1
- package/android/build/intermediates/annotation_processor_list/debugUnitTest/annotationProcessors.json +0 -1
- package/android/build/intermediates/annotations_typedef_file/debug/extractDebugAnnotations/typedefs.txt +0 -0
- package/android/build/intermediates/incremental/debug-mergeJavaRes/merge-state +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +0 -2
- package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +0 -8
- package/android/build/intermediates/merged_java_res/debug/mergeDebugJavaResource/feature-react-native-pdf.jar +0 -0
- package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +0 -7
- package/android/build/intermediates/navigation_json/debug/navigation.json +0 -1
- package/android/build/intermediates/packaged_manifests/debug/output-metadata.json +0 -18
- package/android/build/outputs/aar/react-native-pdf-debug.aar +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/PdfManager.class.uniqueId3 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/PdfManager.class.uniqueId4 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/PdfView$2.class.uniqueId6 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/PdfView$3.class.uniqueId4 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/PdfView$3.class.uniqueId5 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/PdfView.class.uniqueId3 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNPDFPackage.class.uniqueId2 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNPDFPdfViewManagerDelegate.class.uniqueId7 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNPDFPdfViewManagerInterface.class.uniqueId1 +0 -0
- /package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/{RNPDFPackage.class.uniqueId1 → RNPDFPackage.class.uniqueId4} +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
#
|
|
1
|
+
#Sat May 16 13:51:56 CEST 2026
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/filippo/Documents/
|
|
2
|
+
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/filippo/Documents/diodellamialode/DioDellaMiaLode/node_modules/@amafil/react-native-pdf-toolkit/android/src/main/assets"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/filippo/Documents/diodellamialode/DioDellaMiaLode/node_modules/@amafil/react-native-pdf-toolkit/android/src/debug/assets"/></dataSet><dataSet config="generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/filippo/Documents/diodellamialode/DioDellaMiaLode/node_modules/@amafil/react-native-pdf-toolkit/android/build/intermediates/shader_assets/debug/compileDebugShaders/out"/></dataSet></merger>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/filippo/Documents/
|
|
2
|
+
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/filippo/Documents/diodellamialode/DioDellaMiaLode/node_modules/@amafil/react-native-pdf-toolkit/android/src/main/jniLibs"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/filippo/Documents/diodellamialode/DioDellaMiaLode/node_modules/@amafil/react-native-pdf-toolkit/android/src/debug/jniLibs"/></dataSet></merger>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/filippo/Documents/
|
|
2
|
+
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/filippo/Documents/diodellamialode/DioDellaMiaLode/node_modules/@amafil/react-native-pdf-toolkit/android/src/main/shaders"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/filippo/Documents/diodellamialode/DioDellaMiaLode/node_modules/@amafil/react-native-pdf-toolkit/android/src/debug/shaders"/></dataSet></merger>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -29,7 +29,6 @@ import com.facebook.react.viewmanagers.RNPDFPdfViewManagerInterface;
|
|
|
29
29
|
public class PdfManager extends SimpleViewManager<PdfView> implements RNPDFPdfViewManagerInterface<PdfView> {
|
|
30
30
|
public static final String REACT_CLASS = "RNPDFPdfView";
|
|
31
31
|
private Context context;
|
|
32
|
-
private PdfView pdfView;
|
|
33
32
|
private final ViewManagerDelegate<PdfView> mDelegate;
|
|
34
33
|
|
|
35
34
|
@Nullable
|
|
@@ -54,13 +53,13 @@ public class PdfManager extends SimpleViewManager<PdfView> implements RNPDFPdfVi
|
|
|
54
53
|
|
|
55
54
|
@Override
|
|
56
55
|
public PdfView createViewInstance(ThemedReactContext context) {
|
|
57
|
-
|
|
58
|
-
return pdfView;
|
|
56
|
+
return new PdfView(context,null);
|
|
59
57
|
}
|
|
60
58
|
|
|
61
59
|
@Override
|
|
62
60
|
public void onDropViewInstance(PdfView pdfView) {
|
|
63
|
-
pdfView
|
|
61
|
+
pdfView.cleanup();
|
|
62
|
+
super.onDropViewInstance(pdfView);
|
|
64
63
|
}
|
|
65
64
|
|
|
66
65
|
@ReactProp(name = "path")
|
|
@@ -106,12 +105,12 @@ public class PdfManager extends SimpleViewManager<PdfView> implements RNPDFPdfVi
|
|
|
106
105
|
|
|
107
106
|
@ReactProp(name = "enableRTL")
|
|
108
107
|
public void setEnableRTL(PdfView view, boolean enableRTL) {
|
|
109
|
-
|
|
108
|
+
view.setEnableRTL(enableRTL);
|
|
110
109
|
}
|
|
111
110
|
|
|
112
111
|
@ReactProp(name = "scrollEnabled")
|
|
113
112
|
public void setScrollEnabled(PdfView view, boolean scrollEnabled) {
|
|
114
|
-
|
|
113
|
+
view.setScrollEnabled(scrollEnabled);
|
|
115
114
|
}
|
|
116
115
|
|
|
117
116
|
@ReactProp(name = "spacing")
|
|
@@ -193,7 +192,7 @@ public class PdfManager extends SimpleViewManager<PdfView> implements RNPDFPdfVi
|
|
|
193
192
|
// use `receiveCommand` method and call this one there
|
|
194
193
|
@Override
|
|
195
194
|
public void setNativePage(PdfView view, int page) {
|
|
196
|
-
|
|
195
|
+
view.setPage(page);
|
|
197
196
|
}
|
|
198
197
|
|
|
199
198
|
@Override
|
|
@@ -17,6 +17,7 @@ import android.os.Handler;
|
|
|
17
17
|
import android.os.Looper;
|
|
18
18
|
import android.os.ParcelFileDescriptor;
|
|
19
19
|
import android.util.SizeF;
|
|
20
|
+
import android.util.SparseArray;
|
|
20
21
|
import android.view.Choreographer;
|
|
21
22
|
import android.view.View;
|
|
22
23
|
import android.view.ViewGroup;
|
|
@@ -27,6 +28,7 @@ import android.view.MotionEvent;
|
|
|
27
28
|
import android.view.ViewConfiguration;
|
|
28
29
|
import android.graphics.Canvas;
|
|
29
30
|
import android.graphics.Color;
|
|
31
|
+
import android.graphics.Matrix;
|
|
30
32
|
import android.graphics.Paint;
|
|
31
33
|
import android.graphics.Path;
|
|
32
34
|
import android.graphics.PointF;
|
|
@@ -113,6 +115,9 @@ public class PdfView extends PDFView implements OnPageChangeListener,OnLoadCompl
|
|
|
113
115
|
private float originalWidth = 0;
|
|
114
116
|
private float lastPageWidth = 0;
|
|
115
117
|
private float lastPageHeight = 0;
|
|
118
|
+
private final SparseArray<PageRenderInfo> pageRenderInfoByIndex = new SparseArray<>();
|
|
119
|
+
private final Matrix pageRenderMatrix = new Matrix();
|
|
120
|
+
private final float[] pageRenderMatrixValues = new float[9];
|
|
116
121
|
|
|
117
122
|
// used to store the parameters for `super.onSizeChanged`
|
|
118
123
|
private int oldW = 0;
|
|
@@ -129,6 +134,20 @@ public class PdfView extends PDFView implements OnPageChangeListener,OnLoadCompl
|
|
|
129
134
|
private long lastFrameTimeNanos = 0;
|
|
130
135
|
private float accumulatedScrollOffset = 0f; // float accumulator – avoids re-reading the rendering-quantised offset
|
|
131
136
|
|
|
137
|
+
private static final class PageRenderInfo {
|
|
138
|
+
final float left;
|
|
139
|
+
final float top;
|
|
140
|
+
final float width;
|
|
141
|
+
final float height;
|
|
142
|
+
|
|
143
|
+
PageRenderInfo(float left, float top, float width, float height) {
|
|
144
|
+
this.left = left;
|
|
145
|
+
this.top = top;
|
|
146
|
+
this.width = width;
|
|
147
|
+
this.height = height;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
132
151
|
public PdfView(Context context, AttributeSet set){
|
|
133
152
|
super(context, set);
|
|
134
153
|
ConfigKt.setPdfiumConfig(new Config(new DefaultLogger(), AlreadyClosedBehavior.IGNORE));
|
|
@@ -336,6 +355,15 @@ public class PdfView extends PDFView implements OnPageChangeListener,OnLoadCompl
|
|
|
336
355
|
originalWidth = pageWidth;
|
|
337
356
|
}
|
|
338
357
|
|
|
358
|
+
canvas.getMatrix(pageRenderMatrix);
|
|
359
|
+
pageRenderMatrix.getValues(pageRenderMatrixValues);
|
|
360
|
+
pageRenderInfoByIndex.put(displayedPage, new PageRenderInfo(
|
|
361
|
+
pageRenderMatrixValues[Matrix.MTRANS_X] - getCurrentXOffset(),
|
|
362
|
+
pageRenderMatrixValues[Matrix.MTRANS_Y] - getCurrentYOffset(),
|
|
363
|
+
pageWidth,
|
|
364
|
+
pageHeight
|
|
365
|
+
));
|
|
366
|
+
|
|
339
367
|
if (lastPageWidth>0 && lastPageHeight>0 && (pageWidth!=lastPageWidth || pageHeight!=lastPageHeight)) {
|
|
340
368
|
// maybe change by other instance, restore zoom setting
|
|
341
369
|
Constants.Pinch.MINIMUM_ZOOM = this.minScale;
|
|
@@ -368,6 +396,52 @@ public class PdfView extends PDFView implements OnPageChangeListener,OnLoadCompl
|
|
|
368
396
|
}
|
|
369
397
|
}
|
|
370
398
|
|
|
399
|
+
private void clearPageRenderInfo() {
|
|
400
|
+
pageRenderInfoByIndex.clear();
|
|
401
|
+
originalWidth = 0;
|
|
402
|
+
lastPageWidth = 0;
|
|
403
|
+
lastPageHeight = 0;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
private PageRenderInfo getPageRenderInfo(int pageIndex) {
|
|
407
|
+
PageRenderInfo pageRenderInfo = pageRenderInfoByIndex.get(pageIndex);
|
|
408
|
+
if (pageRenderInfo != null) {
|
|
409
|
+
return new PageRenderInfo(
|
|
410
|
+
pageRenderInfo.left + getCurrentXOffset(),
|
|
411
|
+
pageRenderInfo.top + getCurrentYOffset(),
|
|
412
|
+
pageRenderInfo.width,
|
|
413
|
+
pageRenderInfo.height
|
|
414
|
+
);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
SizeF pageSize = getPageSize(pageIndex);
|
|
418
|
+
if (pageSize == null) {
|
|
419
|
+
return null;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
float zoom = getZoom();
|
|
423
|
+
float scaledPageWidth = pageSize.getWidth() * zoom;
|
|
424
|
+
float scaledPageHeight = pageSize.getHeight() * zoom;
|
|
425
|
+
float horizontalMargin = Math.max(0f, (getWidth() - scaledPageWidth) / 2f);
|
|
426
|
+
float pageTop = getFallbackPageTop(pageIndex, zoom) + getCurrentYOffset();
|
|
427
|
+
return new PageRenderInfo(horizontalMargin, pageTop, scaledPageWidth, scaledPageHeight);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
private float getFallbackPageTop(int pageIndex, float zoom) {
|
|
431
|
+
float pageTop = 0f;
|
|
432
|
+
for (int i = 0; i < pageIndex; i++) {
|
|
433
|
+
SizeF previousPageSize = getPageSize(i);
|
|
434
|
+
if (previousPageSize == null) {
|
|
435
|
+
continue;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
pageTop += previousPageSize.getHeight() * zoom;
|
|
439
|
+
pageTop += spacing * zoom;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
return pageTop;
|
|
443
|
+
}
|
|
444
|
+
|
|
371
445
|
@Override
|
|
372
446
|
protected void onAttachedToWindow() {
|
|
373
447
|
super.onAttachedToWindow();
|
|
@@ -387,6 +461,7 @@ public class PdfView extends PDFView implements OnPageChangeListener,OnLoadCompl
|
|
|
387
461
|
|
|
388
462
|
public void drawPdf() {
|
|
389
463
|
showLog(format("drawPdf path:%s %s", this.path, this.page));
|
|
464
|
+
clearPageRenderInfo();
|
|
390
465
|
|
|
391
466
|
if (this.path != null){
|
|
392
467
|
|
|
@@ -506,6 +581,13 @@ public class PdfView extends PDFView implements OnPageChangeListener,OnLoadCompl
|
|
|
506
581
|
updateAnnotationOverlayConfig();
|
|
507
582
|
}
|
|
508
583
|
|
|
584
|
+
public void cleanup() {
|
|
585
|
+
stopAutoScroll();
|
|
586
|
+
if (!this.isRecycled()) {
|
|
587
|
+
this.recycle();
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
|
|
509
591
|
public void setPath(String path) {
|
|
510
592
|
this.path = path;
|
|
511
593
|
}
|
|
@@ -801,24 +883,6 @@ public class PdfView extends PDFView implements OnPageChangeListener,OnLoadCompl
|
|
|
801
883
|
endInk();
|
|
802
884
|
return true;
|
|
803
885
|
}
|
|
804
|
-
} else if ("highlight".equals(currentTool)) {
|
|
805
|
-
if (action == MotionEvent.ACTION_DOWN) {
|
|
806
|
-
AnnotationHit hit = hitTest(event.getX(), event.getY());
|
|
807
|
-
if (hit == null) {
|
|
808
|
-
return false;
|
|
809
|
-
}
|
|
810
|
-
beginMarkup(hit, event.getX(), event.getY(), currentTool);
|
|
811
|
-
return true;
|
|
812
|
-
} else if (action == MotionEvent.ACTION_MOVE) {
|
|
813
|
-
AnnotationHit hit = hitTest(event.getX(), event.getY());
|
|
814
|
-
if (hit != null) {
|
|
815
|
-
updateMarkup(hit, event.getX(), event.getY());
|
|
816
|
-
}
|
|
817
|
-
return true;
|
|
818
|
-
} else if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) {
|
|
819
|
-
endMarkup();
|
|
820
|
-
return true;
|
|
821
|
-
}
|
|
822
886
|
} else if ("text".equals(currentTool)) {
|
|
823
887
|
if (action == MotionEvent.ACTION_UP) {
|
|
824
888
|
AnnotationHit hit = hitTest(event.getX(), event.getY());
|
|
@@ -858,7 +922,22 @@ public class PdfView extends PDFView implements OnPageChangeListener,OnLoadCompl
|
|
|
858
922
|
|
|
859
923
|
if ("ink".equals(type)) {
|
|
860
924
|
JSONArray points = annotation.optJSONArray("points");
|
|
861
|
-
if (points == null || points.length()
|
|
925
|
+
if (points == null || points.length() == 0) {
|
|
926
|
+
continue;
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
if (points.length() == 1) {
|
|
930
|
+
JSONObject point = points.optJSONObject(0);
|
|
931
|
+
if (point != null) {
|
|
932
|
+
float pageX = (float) point.optDouble("x", 0f);
|
|
933
|
+
float pageY = (float) point.optDouble("y", 0f);
|
|
934
|
+
PointF viewPoint = viewPointForNormalizedPoint(pageIndex, pageX, pageY);
|
|
935
|
+
float radius = Math.max(1f, (float) styleFor(annotation).optDouble("thickness", 2.0)) / 2f;
|
|
936
|
+
Paint dotPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
|
937
|
+
dotPaint.setStyle(Paint.Style.FILL);
|
|
938
|
+
dotPaint.setColor(annotationColor(annotation, Color.BLACK));
|
|
939
|
+
canvas.drawCircle(viewPoint.x, viewPoint.y, radius, dotPaint);
|
|
940
|
+
}
|
|
862
941
|
continue;
|
|
863
942
|
}
|
|
864
943
|
|
|
@@ -970,6 +1049,10 @@ public class PdfView extends PDFView implements OnPageChangeListener,OnLoadCompl
|
|
|
970
1049
|
}
|
|
971
1050
|
|
|
972
1051
|
private void drawSelectionDecorations(Canvas canvas) {
|
|
1052
|
+
if (!annotationModeEnabled || !editable || !supported) {
|
|
1053
|
+
return;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
973
1056
|
JSONObject annotation = getSelectedAnnotation();
|
|
974
1057
|
if (annotation == null) {
|
|
975
1058
|
return;
|
|
@@ -1132,14 +1215,13 @@ public class PdfView extends PDFView implements OnPageChangeListener,OnLoadCompl
|
|
|
1132
1215
|
return;
|
|
1133
1216
|
}
|
|
1134
1217
|
|
|
1135
|
-
|
|
1136
|
-
if (
|
|
1218
|
+
PageRenderInfo pageRenderInfo = PdfView.this.getPageRenderInfo(activeSelectionPageIndex);
|
|
1219
|
+
if (pageRenderInfo == null) {
|
|
1137
1220
|
return;
|
|
1138
1221
|
}
|
|
1139
1222
|
|
|
1140
|
-
float
|
|
1141
|
-
float
|
|
1142
|
-
float scaledPageHeight = Math.max(1f, pageSize.getHeight() * zoom);
|
|
1223
|
+
float scaledPageWidth = Math.max(1f, pageRenderInfo.width);
|
|
1224
|
+
float scaledPageHeight = Math.max(1f, pageRenderInfo.height);
|
|
1143
1225
|
float normalizedDeltaX = deltaX / scaledPageWidth;
|
|
1144
1226
|
float normalizedDeltaY = deltaY / scaledPageHeight;
|
|
1145
1227
|
|
|
@@ -1159,14 +1241,13 @@ public class PdfView extends PDFView implements OnPageChangeListener,OnLoadCompl
|
|
|
1159
1241
|
return;
|
|
1160
1242
|
}
|
|
1161
1243
|
|
|
1162
|
-
|
|
1163
|
-
if (
|
|
1244
|
+
PageRenderInfo pageRenderInfo = PdfView.this.getPageRenderInfo(activeSelectionPageIndex);
|
|
1245
|
+
if (pageRenderInfo == null) {
|
|
1164
1246
|
return;
|
|
1165
1247
|
}
|
|
1166
1248
|
|
|
1167
|
-
float
|
|
1168
|
-
float
|
|
1169
|
-
float scaledPageHeight = Math.max(1f, pageSize.getHeight() * zoom);
|
|
1249
|
+
float scaledPageWidth = Math.max(1f, pageRenderInfo.width);
|
|
1250
|
+
float scaledPageHeight = Math.max(1f, pageRenderInfo.height);
|
|
1170
1251
|
float normalizedDeltaX = deltaX / scaledPageWidth;
|
|
1171
1252
|
float normalizedDeltaY = deltaY / scaledPageHeight;
|
|
1172
1253
|
|
|
@@ -1329,6 +1410,7 @@ public class PdfView extends PDFView implements OnPageChangeListener,OnLoadCompl
|
|
|
1329
1410
|
private void endInk() {
|
|
1330
1411
|
activeInkAnnotation = null;
|
|
1331
1412
|
invalidate();
|
|
1413
|
+
PdfView.this.notifyOnChangeWithMessage("strokeEnd");
|
|
1332
1414
|
}
|
|
1333
1415
|
|
|
1334
1416
|
private void beginMarkup(AnnotationHit hit, float x, float y, String type) {
|
|
@@ -1485,23 +1567,17 @@ public class PdfView extends PDFView implements OnPageChangeListener,OnLoadCompl
|
|
|
1485
1567
|
return null;
|
|
1486
1568
|
}
|
|
1487
1569
|
|
|
1488
|
-
float zoom = PdfView.this.getZoom();
|
|
1489
|
-
float documentY = y - PdfView.this.getCurrentYOffset();
|
|
1490
1570
|
for (int i = 0; i < PdfView.this.getPageCount(); i++) {
|
|
1491
|
-
|
|
1492
|
-
if (
|
|
1571
|
+
PageRenderInfo pageRenderInfo = PdfView.this.getPageRenderInfo(i);
|
|
1572
|
+
if (pageRenderInfo == null) {
|
|
1493
1573
|
continue;
|
|
1494
1574
|
}
|
|
1495
1575
|
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
float pageX = x - horizontalMargin;
|
|
1502
|
-
if (pageX >= 0f && pageX <= scaledPageWidth) {
|
|
1503
|
-
return new AnnotationHit(i, pageSize);
|
|
1504
|
-
}
|
|
1576
|
+
if (x >= pageRenderInfo.left &&
|
|
1577
|
+
x <= pageRenderInfo.left + pageRenderInfo.width &&
|
|
1578
|
+
y >= pageRenderInfo.top &&
|
|
1579
|
+
y <= pageRenderInfo.top + pageRenderInfo.height) {
|
|
1580
|
+
return new AnnotationHit(i, pageRenderInfo);
|
|
1505
1581
|
}
|
|
1506
1582
|
}
|
|
1507
1583
|
|
|
@@ -1509,26 +1585,25 @@ public class PdfView extends PDFView implements OnPageChangeListener,OnLoadCompl
|
|
|
1509
1585
|
}
|
|
1510
1586
|
|
|
1511
1587
|
private PointF normalizedPointFor(AnnotationHit hit, float x, float y) {
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
float
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
float documentY = y - PdfView.this.getCurrentYOffset();
|
|
1520
|
-
float pageY = documentY - pageTop;
|
|
1521
|
-
return new PointF(pageX / Math.max(1f, scaledPageWidth), pageY / Math.max(1f, scaledPageHeight));
|
|
1588
|
+
PageRenderInfo pageRenderInfo = hit.pageRenderInfo;
|
|
1589
|
+
float pageX = x - pageRenderInfo.left;
|
|
1590
|
+
float pageY = y - pageRenderInfo.top;
|
|
1591
|
+
return new PointF(
|
|
1592
|
+
pageX / Math.max(1f, pageRenderInfo.width),
|
|
1593
|
+
pageY / Math.max(1f, pageRenderInfo.height)
|
|
1594
|
+
);
|
|
1522
1595
|
}
|
|
1523
1596
|
|
|
1524
1597
|
private PointF viewPointForNormalizedPoint(int pageIndex, float normalizedX, float normalizedY) {
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1598
|
+
PageRenderInfo pageRenderInfo = PdfView.this.getPageRenderInfo(pageIndex);
|
|
1599
|
+
if (pageRenderInfo == null) {
|
|
1600
|
+
return new PointF();
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
return new PointF(
|
|
1604
|
+
pageRenderInfo.left + (normalizedX * pageRenderInfo.width),
|
|
1605
|
+
pageRenderInfo.top + (normalizedY * pageRenderInfo.height)
|
|
1606
|
+
);
|
|
1532
1607
|
}
|
|
1533
1608
|
|
|
1534
1609
|
private RectF viewRectForAnnotation(JSONObject annotation, int pageIndex) {
|
|
@@ -1538,17 +1613,11 @@ public class PdfView extends PDFView implements OnPageChangeListener,OnLoadCompl
|
|
|
1538
1613
|
return null;
|
|
1539
1614
|
}
|
|
1540
1615
|
|
|
1541
|
-
|
|
1542
|
-
if (
|
|
1616
|
+
PageRenderInfo pageRenderInfo = PdfView.this.getPageRenderInfo(pageIndex);
|
|
1617
|
+
if (pageRenderInfo == null) {
|
|
1543
1618
|
return null;
|
|
1544
1619
|
}
|
|
1545
1620
|
|
|
1546
|
-
float zoom = PdfView.this.getZoom();
|
|
1547
|
-
float scaledPageWidth = pageSize.getWidth() * zoom;
|
|
1548
|
-
float scaledPageHeight = pageSize.getHeight() * zoom;
|
|
1549
|
-
float horizontalMargin = Math.max(0f, (PdfView.this.getWidth() - scaledPageWidth) / 2f);
|
|
1550
|
-
float pageTop = getPageTop(pageIndex, zoom) + PdfView.this.getCurrentYOffset();
|
|
1551
|
-
|
|
1552
1621
|
if ("ink".equals(type)) {
|
|
1553
1622
|
JSONArray points = annotation.optJSONArray("points");
|
|
1554
1623
|
if (points == null || points.length() == 0) {
|
|
@@ -1577,10 +1646,10 @@ public class PdfView extends PDFView implements OnPageChangeListener,OnLoadCompl
|
|
|
1577
1646
|
return null;
|
|
1578
1647
|
}
|
|
1579
1648
|
|
|
1580
|
-
float left =
|
|
1581
|
-
float top =
|
|
1582
|
-
float right =
|
|
1583
|
-
float bottom =
|
|
1649
|
+
float left = pageRenderInfo.left + (minX * pageRenderInfo.width);
|
|
1650
|
+
float top = pageRenderInfo.top + (minY * pageRenderInfo.height);
|
|
1651
|
+
float right = pageRenderInfo.left + (maxX * pageRenderInfo.width);
|
|
1652
|
+
float bottom = pageRenderInfo.top + (maxY * pageRenderInfo.height);
|
|
1584
1653
|
return new RectF(Math.min(left, right), Math.min(top, bottom), Math.max(left, right), Math.max(top, bottom));
|
|
1585
1654
|
}
|
|
1586
1655
|
|
|
@@ -1589,10 +1658,10 @@ public class PdfView extends PDFView implements OnPageChangeListener,OnLoadCompl
|
|
|
1589
1658
|
float width = (float) bounds.optDouble("width", 0f);
|
|
1590
1659
|
float height = (float) bounds.optDouble("height", 0f);
|
|
1591
1660
|
|
|
1592
|
-
float left =
|
|
1593
|
-
float top =
|
|
1594
|
-
float right =
|
|
1595
|
-
float bottom =
|
|
1661
|
+
float left = pageRenderInfo.left + (x * pageRenderInfo.width);
|
|
1662
|
+
float top = pageRenderInfo.top + (y * pageRenderInfo.height);
|
|
1663
|
+
float right = pageRenderInfo.left + ((x + width) * pageRenderInfo.width);
|
|
1664
|
+
float bottom = pageRenderInfo.top + ((y + height) * pageRenderInfo.height);
|
|
1596
1665
|
|
|
1597
1666
|
return new RectF(Math.min(left, right), Math.min(top, bottom), Math.max(left, right), Math.max(top, bottom));
|
|
1598
1667
|
}
|
|
@@ -1622,6 +1691,14 @@ public class PdfView extends PDFView implements OnPageChangeListener,OnLoadCompl
|
|
|
1622
1691
|
}
|
|
1623
1692
|
|
|
1624
1693
|
try {
|
|
1694
|
+
// Support CSS-standard #RRGGBBAA (alpha last) in addition to #RRGGBB
|
|
1695
|
+
if (color.startsWith("#") && color.length() == 9) {
|
|
1696
|
+
int r = Integer.parseInt(color.substring(1, 3), 16);
|
|
1697
|
+
int g = Integer.parseInt(color.substring(3, 5), 16);
|
|
1698
|
+
int b = Integer.parseInt(color.substring(5, 7), 16);
|
|
1699
|
+
int a = Integer.parseInt(color.substring(7, 9), 16);
|
|
1700
|
+
return Color.argb(a, r, g, b);
|
|
1701
|
+
}
|
|
1625
1702
|
return Color.parseColor(color);
|
|
1626
1703
|
} catch (IllegalArgumentException ex) {
|
|
1627
1704
|
return fallback;
|
|
@@ -1640,26 +1717,13 @@ public class PdfView extends PDFView implements OnPageChangeListener,OnLoadCompl
|
|
|
1640
1717
|
return "local-" + java.util.UUID.randomUUID().toString();
|
|
1641
1718
|
}
|
|
1642
1719
|
|
|
1643
|
-
private float getPageTop(int pageIndex, float zoom) {
|
|
1644
|
-
float pageTop = 0f;
|
|
1645
|
-
for (int i = 0; i < pageIndex; i++) {
|
|
1646
|
-
SizeF previousPageSize = PdfView.this.getPageSize(i);
|
|
1647
|
-
if (previousPageSize == null) {
|
|
1648
|
-
continue;
|
|
1649
|
-
}
|
|
1650
|
-
pageTop += previousPageSize.getHeight() * zoom;
|
|
1651
|
-
pageTop += PdfView.this.spacing * zoom;
|
|
1652
|
-
}
|
|
1653
|
-
return pageTop;
|
|
1654
|
-
}
|
|
1655
|
-
|
|
1656
1720
|
private final class AnnotationHit {
|
|
1657
1721
|
final int pageIndex;
|
|
1658
|
-
final
|
|
1722
|
+
final PageRenderInfo pageRenderInfo;
|
|
1659
1723
|
|
|
1660
|
-
AnnotationHit(int pageIndex,
|
|
1724
|
+
AnnotationHit(int pageIndex, PageRenderInfo pageRenderInfo) {
|
|
1661
1725
|
this.pageIndex = pageIndex;
|
|
1662
|
-
this.
|
|
1726
|
+
this.pageRenderInfo = pageRenderInfo;
|
|
1663
1727
|
}
|
|
1664
1728
|
}
|
|
1665
1729
|
}
|
package/index.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export type Source = {
|
|
|
29
29
|
|
|
30
30
|
export type AnnotationRotation = 0 | 90 | 180 | 270;
|
|
31
31
|
export type AnnotationIdMode = 'auto' | 'manual';
|
|
32
|
-
export type AnnotationTool = 'select' | 'ink' | 'text'
|
|
32
|
+
export type AnnotationTool = 'select' | 'ink' | 'text';
|
|
33
33
|
export type AnnotationTextAlign = 'left' | 'center' | 'right';
|
|
34
34
|
|
|
35
35
|
export type AnnotationPoint = {
|
|
@@ -169,6 +169,7 @@ export interface PdfProps {
|
|
|
169
169
|
onScaleChanged?: (scale: number) => void,
|
|
170
170
|
onPressLink?: (url: string) => void,
|
|
171
171
|
onAutoScrollEnd?: () => void,
|
|
172
|
+
onAnnotationStrokeEnd?: () => void,
|
|
172
173
|
onTextSelectionChange?: (event: TextSelectionChangeEvent) => void,
|
|
173
174
|
}
|
|
174
175
|
|