@webority-technologies/mobile-ui 0.0.7 → 0.0.9
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/RNMobileUiPdfRasterizer.podspec +25 -0
- package/android/build.gradle +64 -0
- package/android/src/newarch/java/com/webority/mobileui/pdfrasterizer/PdfRasterizerModule.kt +211 -0
- package/android/src/newarch/java/com/webority/mobileui/pdfrasterizer/PdfRasterizerPackage.kt +33 -0
- package/ios/PdfRasterizer.h +13 -0
- package/ios/PdfRasterizer.mm +292 -0
- package/lib/commonjs/components/DocumentViewer/DocumentViewer.js +199 -24
- package/lib/commonjs/specs/NativePdfRasterizer.js +9 -0
- package/lib/module/components/DocumentViewer/DocumentViewer.js +201 -26
- package/lib/module/specs/NativePdfRasterizer.js +5 -0
- package/lib/typescript/commonjs/components/DocumentViewer/DocumentViewer.d.ts +12 -4
- package/lib/typescript/commonjs/specs/NativePdfRasterizer.d.ts +40 -0
- package/lib/typescript/module/components/DocumentViewer/DocumentViewer.d.ts +12 -4
- package/lib/typescript/module/specs/NativePdfRasterizer.d.ts +40 -0
- package/package.json +13 -4
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
export interface PdfDocumentInfo {
|
|
3
|
+
/** Opaque handle for every subsequent call (getPageInfo/renderPage/close) — NOT the file path. */
|
|
4
|
+
handle: string;
|
|
5
|
+
pageCount: number;
|
|
6
|
+
/** Points (1/72 in), the unrotated page size of page 0 — a per-page size read happens in renderPage. */
|
|
7
|
+
pageWidth: number;
|
|
8
|
+
pageHeight: number;
|
|
9
|
+
}
|
|
10
|
+
export interface PdfPageInfo {
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
}
|
|
14
|
+
export interface Spec extends TurboModule {
|
|
15
|
+
/**
|
|
16
|
+
* Opens a LOCAL pdf file (a file:// path or bare absolute path — no http(s), no
|
|
17
|
+
* headers, no auth: callers download remote documents with mobile-core's
|
|
18
|
+
* `downloadFile` first). Returns a handle used by every other call. Throws
|
|
19
|
+
* (rejects) on a missing file, a corrupt PDF, or a password-protected PDF.
|
|
20
|
+
*/
|
|
21
|
+
open(path: string): Promise<PdfDocumentInfo>;
|
|
22
|
+
/**
|
|
23
|
+
* Reads one page's own size without rasterizing it (pages in a PDF can each
|
|
24
|
+
* have a different size/rotation).
|
|
25
|
+
*/
|
|
26
|
+
getPageInfo(handle: string, pageIndex: number): Promise<PdfPageInfo>;
|
|
27
|
+
/**
|
|
28
|
+
* Rasterizes one page to a PNG file in the cache directory and returns its
|
|
29
|
+
* absolute path. `scale` is a multiplier on the page's own point size (pass
|
|
30
|
+
* the view width / page width ratio, capped by the caller — see
|
|
31
|
+
* react-native.md's "RGBA_8888 is 4 bytes/px" guidance). Renders are
|
|
32
|
+
* serialized per handle on both platforms; call sequentially per document.
|
|
33
|
+
*/
|
|
34
|
+
renderPage(handle: string, pageIndex: number, scale: number): Promise<string>;
|
|
35
|
+
/** Releases the native document and evicts any cached page renders for it. */
|
|
36
|
+
close(handle: string): Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
declare const _default: Spec | null;
|
|
39
|
+
export default _default;
|
|
40
|
+
//# sourceMappingURL=NativePdfRasterizer.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority-technologies/mobile-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"description": "Beautiful, animated, accessible React Native components, theme and form engine for Webority projects.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -47,11 +47,22 @@
|
|
|
47
47
|
"types": "./lib/typescript/commonjs/index.d.ts",
|
|
48
48
|
"files": [
|
|
49
49
|
"lib",
|
|
50
|
+
"ios",
|
|
51
|
+
"android",
|
|
52
|
+
"RNMobileUiPdfRasterizer.podspec",
|
|
50
53
|
"!**/__tests__",
|
|
51
54
|
"!**/*.test.*",
|
|
52
55
|
"!**/*.spec.*",
|
|
53
56
|
"!**/*.map"
|
|
54
57
|
],
|
|
58
|
+
"codegenConfig": {
|
|
59
|
+
"name": "RNMobileUiPdfRasterizerSpec",
|
|
60
|
+
"type": "modules",
|
|
61
|
+
"jsSrcsDir": "./src/specs",
|
|
62
|
+
"android": {
|
|
63
|
+
"javaPackageName": "com.webority.mobileui.pdfrasterizer"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
55
66
|
"scripts": {
|
|
56
67
|
"build": "bob build",
|
|
57
68
|
"clean": "rimraf lib",
|
|
@@ -69,7 +80,6 @@
|
|
|
69
80
|
"react": "^19.1.0",
|
|
70
81
|
"react-native": ">=0.81.0",
|
|
71
82
|
"react-native-gesture-handler": "^2.21.0 || ^3.0.0",
|
|
72
|
-
"react-native-pdf": ">=7.0.4",
|
|
73
83
|
"react-native-reanimated": "^4.0.0",
|
|
74
84
|
"react-native-safe-area-context": ">=5.4.0",
|
|
75
85
|
"react-native-worklets": ">=0.10.0"
|
|
@@ -104,7 +114,6 @@
|
|
|
104
114
|
]
|
|
105
115
|
},
|
|
106
116
|
"devDependencies": {
|
|
107
|
-
"expo-haptics": "^57.0.2"
|
|
108
|
-
"react-native-pdf": "^7.0.4"
|
|
117
|
+
"expo-haptics": "^57.0.2"
|
|
109
118
|
}
|
|
110
119
|
}
|