@amafil/react-native-pdf-toolkit 1.0.15 → 1.1.1
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 +57 -0
- package/android/src/main/java/org/wonday/pdf/PdfManager.java +56 -0
- package/android/src/main/java/org/wonday/pdf/PdfView.java +1192 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNPDFPdfViewManagerDelegate.java +30 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNPDFPdfViewManagerInterface.java +10 -0
- package/annotationDocumentUtils.js +74 -0
- package/fabric/RNPDFPdfNativeComponent.js +17 -1
- package/index.d.ts +102 -1
- package/index.js +110 -0
- package/index.js.flow +72 -0
- package/ios/RNPDFPdf/RNPDFPdfView.h +11 -0
- package/ios/RNPDFPdf/RNPDFPdfView.mm +1242 -0
- package/ios/RNPDFPdf/RNPDFPdfViewManager.mm +37 -0
- package/package.json +2 -1
|
@@ -46,6 +46,13 @@ RCT_EXPORT_VIEW_PROPERTY(enablePaging, BOOL);
|
|
|
46
46
|
RCT_EXPORT_VIEW_PROPERTY(enableRTL, BOOL);
|
|
47
47
|
RCT_EXPORT_VIEW_PROPERTY(enableAnnotationRendering, BOOL);
|
|
48
48
|
RCT_EXPORT_VIEW_PROPERTY(enableDoubleTapZoom, BOOL);
|
|
49
|
+
RCT_EXPORT_VIEW_PROPERTY(annotations, NSString);
|
|
50
|
+
RCT_EXPORT_VIEW_PROPERTY(annotationMode, BOOL);
|
|
51
|
+
RCT_EXPORT_VIEW_PROPERTY(annotationTool, NSString);
|
|
52
|
+
RCT_EXPORT_VIEW_PROPERTY(annotationEditable, BOOL);
|
|
53
|
+
RCT_EXPORT_VIEW_PROPERTY(annotationIdMode, NSString);
|
|
54
|
+
RCT_EXPORT_VIEW_PROPERTY(annotationInkColor, NSString);
|
|
55
|
+
RCT_EXPORT_VIEW_PROPERTY(annotationInkThickness, float);
|
|
49
56
|
RCT_EXPORT_VIEW_PROPERTY(fitPolicy, int);
|
|
50
57
|
RCT_EXPORT_VIEW_PROPERTY(spacing, int);
|
|
51
58
|
RCT_EXPORT_VIEW_PROPERTY(password, NSString);
|
|
@@ -76,6 +83,36 @@ RCT_EXPORT_METHOD(stopAutoScroll:(nonnull NSNumber *)reactTag)
|
|
|
76
83
|
}];
|
|
77
84
|
}
|
|
78
85
|
|
|
86
|
+
RCT_EXPORT_METHOD(saveAnnotations:(nonnull NSNumber *)reactTag)
|
|
87
|
+
{
|
|
88
|
+
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
89
|
+
RNPDFPdfView *view = (RNPDFPdfView *)viewRegistry[reactTag];
|
|
90
|
+
if ([view isKindOfClass:[RNPDFPdfView class]]) {
|
|
91
|
+
[view saveAnnotations];
|
|
92
|
+
}
|
|
93
|
+
}];
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
RCT_EXPORT_METHOD(deleteSelectedAnnotation:(nonnull NSNumber *)reactTag)
|
|
97
|
+
{
|
|
98
|
+
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
99
|
+
RNPDFPdfView *view = (RNPDFPdfView *)viewRegistry[reactTag];
|
|
100
|
+
if ([view isKindOfClass:[RNPDFPdfView class]]) {
|
|
101
|
+
[view deleteSelectedAnnotation];
|
|
102
|
+
}
|
|
103
|
+
}];
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
RCT_EXPORT_METHOD(deleteAllAnnotations:(nonnull NSNumber *)reactTag)
|
|
107
|
+
{
|
|
108
|
+
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
109
|
+
RNPDFPdfView *view = (RNPDFPdfView *)viewRegistry[reactTag];
|
|
110
|
+
if ([view isKindOfClass:[RNPDFPdfView class]]) {
|
|
111
|
+
[view deleteAllAnnotations];
|
|
112
|
+
}
|
|
113
|
+
}];
|
|
114
|
+
}
|
|
115
|
+
|
|
79
116
|
RCT_EXPORT_METHOD(supportPDFKit:(RCTResponseSenderBlock)callback)
|
|
80
117
|
{
|
|
81
118
|
if([[[UIDevice currentDevice] systemVersion] compare:@"11.0" options:NSNumericSearch] == NSOrderedDescending
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amafil/react-native-pdf-toolkit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"summary": "A react native PDF view component",
|
|
5
5
|
"description": "A react native PDF view component, support ios and android platform",
|
|
6
6
|
"main": "index.js",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"index.d.ts",
|
|
50
50
|
"index.js",
|
|
51
51
|
"index.js.flow",
|
|
52
|
+
"annotationDocumentUtils.js",
|
|
52
53
|
"PdfManager.js",
|
|
53
54
|
"PdfPageView.js",
|
|
54
55
|
"PdfView.js",
|