@amafil/react-native-pdf-toolkit 1.1.2 → 1.1.17
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/README.md +0 -57
- 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/file-system.probe +0 -0
- package/android/build/.transforms/2892d280277a194daf04e3af971b529e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/react/viewmanagers/RNPDFPdfViewManagerDelegate.dex +0 -0
- package/android/build/.transforms/2892d280277a194daf04e3af971b529e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/react/viewmanagers/RNPDFPdfViewManagerInterface.dex +0 -0
- package/android/build/.transforms/2892d280277a194daf04e3af971b529e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/wonday/pdf/PdfManager.dex +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.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/generated/source/codegen/java/com/facebook/react/viewmanagers/RNPDFPdfViewManagerDelegate.java +0 -30
- package/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/RNPDFPdfViewManagerInterface.java +0 -10
- package/android/build/generated/source/codegen/jni/react/renderer/components/rnpdf/Props.cpp +0 -35
- package/android/build/generated/source/codegen/jni/react/renderer/components/rnpdf/Props.h +0 -7
- package/android/build/generated/source/codegen/schema.json +1 -1
- 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/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/react/viewmanagers/RNPDFPdfViewManagerDelegate.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/react/viewmanagers/RNPDFPdfViewManagerInterface.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/org/wonday/pdf/PdfManager.class +0 -0
- 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.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/react/viewmanagers/RNPDFPdfViewManagerDelegate.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/react/viewmanagers/RNPDFPdfViewManagerInterface.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/wonday/pdf/PdfManager.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.class +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/src/main/java/org/wonday/pdf/PdfManager.java +6 -63
- package/android/src/main/java/org/wonday/pdf/PdfView.java +4 -1189
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNPDFPdfViewManagerDelegate.java +0 -30
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNPDFPdfViewManagerInterface.java +0 -10
- package/fabric/RNPDFPdfNativeComponent.js +3 -18
- package/index.d.ts +1 -102
- package/index.js +0 -110
- package/index.js.flow +0 -72
- package/ios/RNPDFPdf/RNPDFPdfView.h +0 -11
- package/ios/RNPDFPdf/RNPDFPdfView.mm +0 -1242
- package/ios/RNPDFPdf/RNPDFPdfViewManager.mm +0 -37
- package/package.json +5 -6
- package/annotationDocumentUtils.js +0 -74
package/README.md
CHANGED
|
@@ -13,63 +13,6 @@ A react native PDF view component (cross-platform support)
|
|
|
13
13
|
* support password protected pdf
|
|
14
14
|
* jump to a specific page in the pdf
|
|
15
15
|
* auto scroll with configurable speed (ideal for music sheets)
|
|
16
|
-
* annotate pages with ink, text, and highlight tools
|
|
17
|
-
|
|
18
|
-
### Annotation editing
|
|
19
|
-
|
|
20
|
-
The component accepts an annotation document through the `annotations` prop together with `annotationMode`, `annotationTool`, `annotationEditable`, and `annotationIdMode`. Ink defaults can be controlled with `annotationInkColor` and `annotationInkThickness`.
|
|
21
|
-
|
|
22
|
-
```tsx
|
|
23
|
-
const annotations = {
|
|
24
|
-
editable: true,
|
|
25
|
-
idMode: 'auto',
|
|
26
|
-
annotations: [
|
|
27
|
-
{
|
|
28
|
-
id: 'note-1',
|
|
29
|
-
page: 1,
|
|
30
|
-
type: 'text',
|
|
31
|
-
bounds: {x: 0.15, y: 0.24, width: 0.28, height: 0.12},
|
|
32
|
-
text: 'Reminder for page one',
|
|
33
|
-
style: {color: '#2244aa', fontSize: 15, textAlign: 'left'},
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
id: 'stroke-1',
|
|
37
|
-
page: 2,
|
|
38
|
-
type: 'ink',
|
|
39
|
-
points: [
|
|
40
|
-
{x: 0.12, y: 0.18},
|
|
41
|
-
{x: 0.26, y: 0.22},
|
|
42
|
-
{x: 0.34, y: 0.19},
|
|
43
|
-
],
|
|
44
|
-
style: {color: '#111111', thickness: 2},
|
|
45
|
-
},
|
|
46
|
-
],
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
<Pdf
|
|
50
|
-
ref={pdfRef}
|
|
51
|
-
source={source}
|
|
52
|
-
annotations={annotations}
|
|
53
|
-
annotationMode
|
|
54
|
-
annotationTool="ink"
|
|
55
|
-
annotationInkColor="#1d4ed8"
|
|
56
|
-
annotationInkThickness={4}
|
|
57
|
-
/>
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Supported tools are `select`, `ink`, `text`, and `highlight`.
|
|
61
|
-
|
|
62
|
-
In `select` mode, tap an annotation to select it, drag to move it, and use the resize handle to resize text and highlight annotations. Deletion is host-controlled: call `pdfRef.current.deleteSelectedAnnotation()` or `pdfRef.current.deleteAllAnnotations()` from your own UI.
|
|
63
|
-
|
|
64
|
-
Call `await pdfRef.current.saveAnnotations()` to receive the current document back from native as `{ editable, idMode, annotations }`.
|
|
65
|
-
|
|
66
|
-
Legacy `underline` and `strikeout` annotations are normalized to `highlight` when loading and saving.
|
|
67
|
-
|
|
68
|
-
Notes:
|
|
69
|
-
|
|
70
|
-
* Editing currently targets the default vertical viewer flow.
|
|
71
|
-
* Android editing is disabled when `horizontal`, `enablePaging`, `enableRTL`, or `singlePage` are enabled.
|
|
72
|
-
* iOS editing uses PDFKit when `usePDFKit` is true.
|
|
73
16
|
|
|
74
17
|
### Supported versions
|
|
75
18
|
We use [`react-native-blob-util`](https://github.com/RonRadtke/react-native-blob-util) to handle file system access in this package,
|
|
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
|
|
@@ -75,27 +75,6 @@ public class RNPDFPdfViewManagerDelegate<T extends View, U extends BaseViewManag
|
|
|
75
75
|
case "password":
|
|
76
76
|
mViewManager.setPassword(view, value == null ? null : (String) value);
|
|
77
77
|
break;
|
|
78
|
-
case "annotations":
|
|
79
|
-
mViewManager.setAnnotations(view, value == null ? null : (String) value);
|
|
80
|
-
break;
|
|
81
|
-
case "annotationMode":
|
|
82
|
-
mViewManager.setAnnotationMode(view, value == null ? false : (boolean) value);
|
|
83
|
-
break;
|
|
84
|
-
case "annotationTool":
|
|
85
|
-
mViewManager.setAnnotationTool(view, value == null ? null : (String) value);
|
|
86
|
-
break;
|
|
87
|
-
case "annotationEditable":
|
|
88
|
-
mViewManager.setAnnotationEditable(view, value == null ? false : (boolean) value);
|
|
89
|
-
break;
|
|
90
|
-
case "annotationIdMode":
|
|
91
|
-
mViewManager.setAnnotationIdMode(view, value == null ? null : (String) value);
|
|
92
|
-
break;
|
|
93
|
-
case "annotationInkColor":
|
|
94
|
-
mViewManager.setAnnotationInkColor(view, value == null ? null : (String) value);
|
|
95
|
-
break;
|
|
96
|
-
case "annotationInkThickness":
|
|
97
|
-
mViewManager.setAnnotationInkThickness(view, value == null ? 0f : ((Double) value).floatValue());
|
|
98
|
-
break;
|
|
99
78
|
case "singlePage":
|
|
100
79
|
mViewManager.setSinglePage(view, value == null ? false : (boolean) value);
|
|
101
80
|
break;
|
|
@@ -116,15 +95,6 @@ public class RNPDFPdfViewManagerDelegate<T extends View, U extends BaseViewManag
|
|
|
116
95
|
case "stopNativeAutoScroll":
|
|
117
96
|
mViewManager.stopNativeAutoScroll(view);
|
|
118
97
|
break;
|
|
119
|
-
case "saveAnnotations":
|
|
120
|
-
mViewManager.saveAnnotations(view);
|
|
121
|
-
break;
|
|
122
|
-
case "deleteSelectedAnnotation":
|
|
123
|
-
mViewManager.deleteSelectedAnnotation(view);
|
|
124
|
-
break;
|
|
125
|
-
case "deleteAllAnnotations":
|
|
126
|
-
mViewManager.deleteAllAnnotations(view);
|
|
127
|
-
break;
|
|
128
98
|
}
|
|
129
99
|
}
|
|
130
100
|
}
|
|
@@ -31,18 +31,8 @@ public interface RNPDFPdfViewManagerInterface<T extends View> extends ViewManage
|
|
|
31
31
|
void setFitPolicy(T view, int value);
|
|
32
32
|
void setSpacing(T view, int value);
|
|
33
33
|
void setPassword(T view, @Nullable String value);
|
|
34
|
-
void setAnnotations(T view, @Nullable String value);
|
|
35
|
-
void setAnnotationMode(T view, boolean value);
|
|
36
|
-
void setAnnotationTool(T view, @Nullable String value);
|
|
37
|
-
void setAnnotationEditable(T view, boolean value);
|
|
38
|
-
void setAnnotationIdMode(T view, @Nullable String value);
|
|
39
|
-
void setAnnotationInkColor(T view, @Nullable String value);
|
|
40
|
-
void setAnnotationInkThickness(T view, float value);
|
|
41
34
|
void setSinglePage(T view, boolean value);
|
|
42
35
|
void setNativePage(T view, int page);
|
|
43
36
|
void startNativeAutoScroll(T view, double pixels, double resumeDelay);
|
|
44
37
|
void stopNativeAutoScroll(T view);
|
|
45
|
-
void saveAnnotations(T view);
|
|
46
|
-
void deleteSelectedAnnotation(T view);
|
|
47
|
-
void deleteAllAnnotations(T view);
|
|
48
38
|
}
|
package/android/build/generated/source/codegen/jni/react/renderer/components/rnpdf/Props.cpp
CHANGED
|
@@ -36,13 +36,6 @@ RNPDFPdfViewProps::RNPDFPdfViewProps(
|
|
|
36
36
|
fitPolicy(convertRawProp(context, rawProps, "fitPolicy", sourceProps.fitPolicy, {0})),
|
|
37
37
|
spacing(convertRawProp(context, rawProps, "spacing", sourceProps.spacing, {0})),
|
|
38
38
|
password(convertRawProp(context, rawProps, "password", sourceProps.password, {})),
|
|
39
|
-
annotations(convertRawProp(context, rawProps, "annotations", sourceProps.annotations, {})),
|
|
40
|
-
annotationMode(convertRawProp(context, rawProps, "annotationMode", sourceProps.annotationMode, {false})),
|
|
41
|
-
annotationTool(convertRawProp(context, rawProps, "annotationTool", sourceProps.annotationTool, {})),
|
|
42
|
-
annotationEditable(convertRawProp(context, rawProps, "annotationEditable", sourceProps.annotationEditable, {false})),
|
|
43
|
-
annotationIdMode(convertRawProp(context, rawProps, "annotationIdMode", sourceProps.annotationIdMode, {})),
|
|
44
|
-
annotationInkColor(convertRawProp(context, rawProps, "annotationInkColor", sourceProps.annotationInkColor, {})),
|
|
45
|
-
annotationInkThickness(convertRawProp(context, rawProps, "annotationInkThickness", sourceProps.annotationInkThickness, {0.0})),
|
|
46
39
|
singlePage(convertRawProp(context, rawProps, "singlePage", sourceProps.singlePage, {false})) {}
|
|
47
40
|
|
|
48
41
|
#ifdef RN_SERIALIZABLE_STATE
|
|
@@ -129,34 +122,6 @@ folly::dynamic RNPDFPdfViewProps::getDiffProps(
|
|
|
129
122
|
result["password"] = password;
|
|
130
123
|
}
|
|
131
124
|
|
|
132
|
-
if (annotations != oldProps->annotations) {
|
|
133
|
-
result["annotations"] = annotations;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
if (annotationMode != oldProps->annotationMode) {
|
|
137
|
-
result["annotationMode"] = annotationMode;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
if (annotationTool != oldProps->annotationTool) {
|
|
141
|
-
result["annotationTool"] = annotationTool;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
if (annotationEditable != oldProps->annotationEditable) {
|
|
145
|
-
result["annotationEditable"] = annotationEditable;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
if (annotationIdMode != oldProps->annotationIdMode) {
|
|
149
|
-
result["annotationIdMode"] = annotationIdMode;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
if (annotationInkColor != oldProps->annotationInkColor) {
|
|
153
|
-
result["annotationInkColor"] = annotationInkColor;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
if ((annotationInkThickness != oldProps->annotationInkThickness) && !(std::isnan(annotationInkThickness) && std::isnan(oldProps->annotationInkThickness))) {
|
|
157
|
-
result["annotationInkThickness"] = annotationInkThickness;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
125
|
if (singlePage != oldProps->singlePage) {
|
|
161
126
|
result["singlePage"] = singlePage;
|
|
162
127
|
}
|
|
@@ -39,13 +39,6 @@ class RNPDFPdfViewProps final : public ViewProps {
|
|
|
39
39
|
int fitPolicy{0};
|
|
40
40
|
int spacing{0};
|
|
41
41
|
std::string password{};
|
|
42
|
-
std::string annotations{};
|
|
43
|
-
bool annotationMode{false};
|
|
44
|
-
std::string annotationTool{};
|
|
45
|
-
bool annotationEditable{false};
|
|
46
|
-
std::string annotationIdMode{};
|
|
47
|
-
std::string annotationInkColor{};
|
|
48
|
-
Float annotationInkThickness{0.0};
|
|
49
42
|
bool singlePage{false};
|
|
50
43
|
|
|
51
44
|
#ifdef RN_SERIALIZABLE_STATE
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"libraryName":"","modules":{"RNPDFPdfView":{"type":"Component","components":{"RNPDFPdfView":{"extendsProps":[{"type":"ReactNativeBuiltInType","knownTypeName":"ReactNativeCoreViewProps"}],"events":[{"name":"onChange","optional":true,"bubblingType":"bubble","typeAnnotation":{"type":"EventTypeAnnotation","argument":{"type":"ObjectTypeAnnotation","properties":[{"name":"message","optional":true,"typeAnnotation":{"type":"StringTypeAnnotation"}}]}}}],"props":[{"name":"path","optional":true,"typeAnnotation":{"type":"StringTypeAnnotation","default":null}},{"name":"page","optional":true,"typeAnnotation":{"type":"Int32TypeAnnotation","default":0}},{"name":"scale","optional":true,"typeAnnotation":{"type":"FloatTypeAnnotation","default":0}},{"name":"minScale","optional":true,"typeAnnotation":{"type":"FloatTypeAnnotation","default":0}},{"name":"maxScale","optional":true,"typeAnnotation":{"type":"FloatTypeAnnotation","default":0}},{"name":"horizontal","optional":true,"typeAnnotation":{"type":"BooleanTypeAnnotation","default":false}},{"name":"enablePaging","optional":true,"typeAnnotation":{"type":"BooleanTypeAnnotation","default":false}},{"name":"enableRTL","optional":true,"typeAnnotation":{"type":"BooleanTypeAnnotation","default":false}},{"name":"enableAnnotationRendering","optional":true,"typeAnnotation":{"type":"BooleanTypeAnnotation","default":false}},{"name":"showsHorizontalScrollIndicator","optional":true,"typeAnnotation":{"type":"BooleanTypeAnnotation","default":false}},{"name":"showsVerticalScrollIndicator","optional":true,"typeAnnotation":{"type":"BooleanTypeAnnotation","default":false}},{"name":"scrollEnabled","optional":true,"typeAnnotation":{"type":"BooleanTypeAnnotation","default":false}},{"name":"enableAntialiasing","optional":true,"typeAnnotation":{"type":"BooleanTypeAnnotation","default":false}},{"name":"enableDoubleTapZoom","optional":true,"typeAnnotation":{"type":"BooleanTypeAnnotation","default":false}},{"name":"fitPolicy","optional":true,"typeAnnotation":{"type":"Int32TypeAnnotation","default":0}},{"name":"spacing","optional":true,"typeAnnotation":{"type":"Int32TypeAnnotation","default":0}},{"name":"password","optional":true,"typeAnnotation":{"type":"StringTypeAnnotation","default":null}},{"name":"
|
|
1
|
+
{"libraryName":"","modules":{"RNPDFPdfView":{"type":"Component","components":{"RNPDFPdfView":{"extendsProps":[{"type":"ReactNativeBuiltInType","knownTypeName":"ReactNativeCoreViewProps"}],"events":[{"name":"onChange","optional":true,"bubblingType":"bubble","typeAnnotation":{"type":"EventTypeAnnotation","argument":{"type":"ObjectTypeAnnotation","properties":[{"name":"message","optional":true,"typeAnnotation":{"type":"StringTypeAnnotation"}}]}}}],"props":[{"name":"path","optional":true,"typeAnnotation":{"type":"StringTypeAnnotation","default":null}},{"name":"page","optional":true,"typeAnnotation":{"type":"Int32TypeAnnotation","default":0}},{"name":"scale","optional":true,"typeAnnotation":{"type":"FloatTypeAnnotation","default":0}},{"name":"minScale","optional":true,"typeAnnotation":{"type":"FloatTypeAnnotation","default":0}},{"name":"maxScale","optional":true,"typeAnnotation":{"type":"FloatTypeAnnotation","default":0}},{"name":"horizontal","optional":true,"typeAnnotation":{"type":"BooleanTypeAnnotation","default":false}},{"name":"enablePaging","optional":true,"typeAnnotation":{"type":"BooleanTypeAnnotation","default":false}},{"name":"enableRTL","optional":true,"typeAnnotation":{"type":"BooleanTypeAnnotation","default":false}},{"name":"enableAnnotationRendering","optional":true,"typeAnnotation":{"type":"BooleanTypeAnnotation","default":false}},{"name":"showsHorizontalScrollIndicator","optional":true,"typeAnnotation":{"type":"BooleanTypeAnnotation","default":false}},{"name":"showsVerticalScrollIndicator","optional":true,"typeAnnotation":{"type":"BooleanTypeAnnotation","default":false}},{"name":"scrollEnabled","optional":true,"typeAnnotation":{"type":"BooleanTypeAnnotation","default":false}},{"name":"enableAntialiasing","optional":true,"typeAnnotation":{"type":"BooleanTypeAnnotation","default":false}},{"name":"enableDoubleTapZoom","optional":true,"typeAnnotation":{"type":"BooleanTypeAnnotation","default":false}},{"name":"fitPolicy","optional":true,"typeAnnotation":{"type":"Int32TypeAnnotation","default":0}},{"name":"spacing","optional":true,"typeAnnotation":{"type":"Int32TypeAnnotation","default":0}},{"name":"password","optional":true,"typeAnnotation":{"type":"StringTypeAnnotation","default":null}},{"name":"singlePage","optional":true,"typeAnnotation":{"type":"BooleanTypeAnnotation","default":false}}],"commands":[{"name":"setNativePage","optional":false,"typeAnnotation":{"type":"FunctionTypeAnnotation","params":[{"name":"page","optional":false,"typeAnnotation":{"type":"Int32TypeAnnotation"}}],"returnTypeAnnotation":{"type":"VoidTypeAnnotation"}}},{"name":"startNativeAutoScroll","optional":false,"typeAnnotation":{"type":"FunctionTypeAnnotation","params":[{"name":"pixels","optional":false,"typeAnnotation":{"type":"DoubleTypeAnnotation"}},{"name":"resumeDelay","optional":false,"typeAnnotation":{"type":"DoubleTypeAnnotation"}}],"returnTypeAnnotation":{"type":"VoidTypeAnnotation"}}},{"name":"stopNativeAutoScroll","optional":false,"typeAnnotation":{"type":"FunctionTypeAnnotation","params":[],"returnTypeAnnotation":{"type":"VoidTypeAnnotation"}}}]}}}}}
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
#
|
|
1
|
+
#Fri May 15 12:22:40 CEST 2026
|
|
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")
|
|
@@ -139,41 +138,6 @@ public class PdfManager extends SimpleViewManager<PdfView> implements RNPDFPdfVi
|
|
|
139
138
|
pdfView.setEnableDoubleTapZoom(enableDoubleTap);
|
|
140
139
|
}
|
|
141
140
|
|
|
142
|
-
@ReactProp(name = "annotations")
|
|
143
|
-
public void setAnnotations(PdfView pdfView, @Nullable String annotations) {
|
|
144
|
-
pdfView.setAnnotations(annotations);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
@ReactProp(name = "annotationMode")
|
|
148
|
-
public void setAnnotationMode(PdfView pdfView, boolean annotationMode) {
|
|
149
|
-
pdfView.setAnnotationMode(annotationMode);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
@ReactProp(name = "annotationTool")
|
|
153
|
-
public void setAnnotationTool(PdfView pdfView, @Nullable String annotationTool) {
|
|
154
|
-
pdfView.setAnnotationTool(annotationTool);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
@ReactProp(name = "annotationEditable")
|
|
158
|
-
public void setAnnotationEditable(PdfView pdfView, boolean annotationEditable) {
|
|
159
|
-
pdfView.setAnnotationEditable(annotationEditable);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
@ReactProp(name = "annotationIdMode")
|
|
163
|
-
public void setAnnotationIdMode(PdfView pdfView, @Nullable String annotationIdMode) {
|
|
164
|
-
pdfView.setAnnotationIdMode(annotationIdMode);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
@ReactProp(name = "annotationInkColor")
|
|
168
|
-
public void setAnnotationInkColor(PdfView pdfView, @Nullable String annotationInkColor) {
|
|
169
|
-
pdfView.setAnnotationInkColor(annotationInkColor);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
@ReactProp(name = "annotationInkThickness")
|
|
173
|
-
public void setAnnotationInkThickness(PdfView pdfView, float annotationInkThickness) {
|
|
174
|
-
pdfView.setAnnotationInkThickness(annotationInkThickness);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
141
|
@ReactProp(name = "enablePaging")
|
|
178
142
|
public void setEnablePaging(PdfView pdfView, boolean enablePaging) {
|
|
179
143
|
pdfView.setEnablePaging(enablePaging);
|
|
@@ -193,7 +157,7 @@ public class PdfManager extends SimpleViewManager<PdfView> implements RNPDFPdfVi
|
|
|
193
157
|
// use `receiveCommand` method and call this one there
|
|
194
158
|
@Override
|
|
195
159
|
public void setNativePage(PdfView view, int page) {
|
|
196
|
-
|
|
160
|
+
view.setPage(page);
|
|
197
161
|
}
|
|
198
162
|
|
|
199
163
|
@Override
|
|
@@ -219,30 +183,9 @@ public class PdfManager extends SimpleViewManager<PdfView> implements RNPDFPdfVi
|
|
|
219
183
|
startNativeAutoScroll(root, args.getDouble(0), args.getDouble(1));
|
|
220
184
|
} else if ("stopNativeAutoScroll".equals(commandId)) {
|
|
221
185
|
stopNativeAutoScroll(root);
|
|
222
|
-
} else if ("saveAnnotations".equals(commandId)) {
|
|
223
|
-
saveAnnotations(root);
|
|
224
|
-
} else if ("deleteSelectedAnnotation".equals(commandId)) {
|
|
225
|
-
deleteSelectedAnnotation(root);
|
|
226
|
-
} else if ("deleteAllAnnotations".equals(commandId)) {
|
|
227
|
-
deleteAllAnnotations(root);
|
|
228
186
|
}
|
|
229
187
|
}
|
|
230
188
|
|
|
231
|
-
@Override
|
|
232
|
-
public void saveAnnotations(PdfView view) {
|
|
233
|
-
view.saveAnnotations();
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
@Override
|
|
237
|
-
public void deleteSelectedAnnotation(PdfView view) {
|
|
238
|
-
view.deleteSelectedAnnotation();
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
@Override
|
|
242
|
-
public void deleteAllAnnotations(PdfView view) {
|
|
243
|
-
view.deleteAllAnnotations();
|
|
244
|
-
}
|
|
245
|
-
|
|
246
189
|
@Override
|
|
247
190
|
public void onAfterUpdateTransaction(PdfView pdfView) {
|
|
248
191
|
super.onAfterUpdateTransaction(pdfView);
|