react-native-pdf-renderer 1.3.1 → 1.3.2
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
CHANGED
|
@@ -14,7 +14,7 @@ It uses [PdfRenderer](https://developer.android.com/reference/android/graphics/p
|
|
|
14
14
|
|
|
15
15
|
## Why another PDF renderer?
|
|
16
16
|
|
|
17
|
-
The main reason why I create this library is to avoid using third
|
|
17
|
+
The main reason why I create this library is to avoid using third-party native dependencies, like `com.github.TalbotGooday:AndroidPdfViewer`, `com.github.mhiew:android-pdf-viewer`, `react-native-blob-util` or even `react-native-webview`.
|
|
18
18
|
|
|
19
19
|
But why?
|
|
20
20
|
|
|
@@ -65,9 +65,9 @@ const App = () => {
|
|
|
65
65
|
export default App;
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
The `source` prop must point to a file stored inside device memory.
|
|
68
|
+
The `source` prop must point to a file stored inside the device memory.
|
|
69
69
|
|
|
70
|
-
If the file is online, you can use some third
|
|
70
|
+
If the file is online, you can use some third-party library like `expo-file-system`, `rn-fetch-blob`, or `react-native-blob-util` to download and save it locally.
|
|
71
71
|
|
|
72
72
|
For more details, see the [Sample Project](https://github.com/douglasjunior/react-native-pdf-renderer/blob/main/Sample/App.tsx).
|
|
73
73
|
|
|
@@ -75,7 +75,7 @@ For more details, see the [Sample Project](https://github.com/douglasjunior/reac
|
|
|
75
75
|
|
|
76
76
|
|Name|Type|Default|Description|
|
|
77
77
|
|-|-|-|-|
|
|
78
|
-
|source|`string`||Path to a file stored on device.|
|
|
78
|
+
|source|`string`||Path to a file stored on the device.|
|
|
79
79
|
|distanceBetweenPages|`number`|`16`|Distance in `DPI` between pages.|
|
|
80
80
|
|maxZoom|`number`|`5`|Max zoom scale.|
|
|
81
81
|
|singlePage|`boolean`|`false`|(Experimental) Renders only the first page without scroll. (useful for display thumbnail)|
|
|
@@ -84,13 +84,19 @@ For more details, see the [Sample Project](https://github.com/douglasjunior/reac
|
|
|
84
84
|
|
|
85
85
|
## Limitations
|
|
86
86
|
|
|
87
|
+
### Page interactions
|
|
88
|
+
|
|
89
|
+
Because Android renders the PDF page as a full image, it does not support text selection, accessibility, or handling links.
|
|
90
|
+
|
|
91
|
+
If any of these features are important for your product, we recommend adding a button to open the PDF in an external PDF viewer.
|
|
92
|
+
|
|
87
93
|
### Size measuring
|
|
88
94
|
|
|
89
|
-
The `PdfRendererView` is `flex: 1` by default, so you need to make sure that your parents `View` are `flex: 1` or have a fixed `width/height`.
|
|
95
|
+
The `PdfRendererView` is `flex: 1` by default, so you need to make sure that your parents `View`s are `flex: 1` or have a fixed `width/height`.
|
|
90
96
|
|
|
91
97
|
### Border radius
|
|
92
98
|
|
|
93
|
-
The `borderRadius` style is ignored by React Native custom view in Android and
|
|
99
|
+
The `borderRadius` style is ignored by React Native custom view in Android and crashes on iOS. (read more [#1](https://github.com/douglasjunior/react-native-pdf-renderer/issues/1#issuecomment-1483395465))
|
|
94
100
|
|
|
95
101
|
If you need `borderRadius`, the best option is to wrap the `PdfRendererView` in another `View`.
|
|
96
102
|
|
|
@@ -110,7 +116,7 @@ jest.mock('react-native-pdf-renderer', () => require('react-native-pdf-renderer/
|
|
|
110
116
|
|
|
111
117
|
## Contribute
|
|
112
118
|
|
|
113
|
-
New features, bug fixes and improvements are welcome! For questions and suggestions use the [issues](https://github.com/douglasjunior/react-native-pdf-renderer/issues).
|
|
119
|
+
New features, bug fixes, and improvements are welcome! For questions and suggestions use the [issues](https://github.com/douglasjunior/react-native-pdf-renderer/issues).
|
|
114
120
|
|
|
115
121
|
<a href="https://www.patreon.com/douglasjunior"><img src="http://i.imgur.com/xEO164Z.png" alt="Become a Patron!" width="200" /></a>
|
|
116
122
|
[](https://paypal.me/douglasnassif)
|
|
@@ -52,9 +52,11 @@ BOOL observerAdded = NO;
|
|
|
52
52
|
|
|
53
53
|
NSUInteger currentPageNumber = [view.document indexForPage:view.currentPage];
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
@
|
|
57
|
-
|
|
55
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
56
|
+
view.onPageChange(@{
|
|
57
|
+
@"position": [NSNumber numberWithInteger:currentPageNumber],
|
|
58
|
+
@"total": [NSNumber numberWithInteger:view.document.pageCount],
|
|
59
|
+
});
|
|
58
60
|
});
|
|
59
61
|
}
|
|
60
62
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-pdf-renderer",
|
|
3
3
|
"displayName": "React-Native Pdf Renderer",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.2",
|
|
5
5
|
"description": "⚛ A zoomable, blazing fast, zero dependencies, pure native, typed PDF Renderer for Android and iOS.",
|
|
6
6
|
"main": "dist",
|
|
7
7
|
"license": "MIT",
|
package/DEPENDENTS.md
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# Dependents stats for douglasjunior/react-native-pdf-renderer
|
|
2
|
-
|
|
3
|
-
[](https://github.com/douglasjunior/react-native-pdf-renderer/network/dependents)
|
|
4
|
-
[&message=17&color=informational&logo=slickpic)](https://github.com/douglasjunior/react-native-pdf-renderer/network/dependents)
|
|
5
|
-
[&message=-17&color=informational&logo=slickpic)](https://github.com/douglasjunior/react-native-pdf-renderer/network/dependents)
|
|
6
|
-
[&message=262&color=informational&logo=slickpic)](https://github.com/douglasjunior/react-native-pdf-renderer/network/dependents)
|
|
7
|
-
|
|
8
|
-
| Repository | Stars |
|
|
9
|
-
| :-------- | -----: |
|
|
10
|
-
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/114444115?s=40&v=4" width="20" height="20" alt=""> [PapillonApp](https://github.com/PapillonApp) / [Papillon](https://github.com/PapillonApp/Papillon) | 136 |
|
|
11
|
-
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/1512341?s=40&v=4" width="20" height="20" alt=""> [douglasjunior](https://github.com/douglasjunior) / [react-native-pdf-renderer](https://github.com/douglasjunior/react-native-pdf-renderer) | 123 |
|
|
12
|
-
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/92865629?s=40&v=4" width="20" height="20" alt=""> [jayasuryard31](https://github.com/jayasuryard31) / [AyurScan](https://github.com/jayasuryard31/AyurScan) | 1 |
|
|
13
|
-
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/79224590?s=40&v=4" width="20" height="20" alt=""> [LeMaitre4523](https://github.com/LeMaitre4523) / [Renard-archive](https://github.com/LeMaitre4523/Renard-archive) | 1 |
|
|
14
|
-
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/1499012?s=40&v=4" width="20" height="20" alt=""> [lukasa1993](https://github.com/lukasa1993) / [react-native-presigned-s3](https://github.com/lukasa1993/react-native-presigned-s3) | 1 |
|
|
15
|
-
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/43969012?s=40&v=4" width="20" height="20" alt=""> [Filahan](https://github.com/Filahan) / [promapp](https://github.com/Filahan/promapp) | 0 |
|
|
16
|
-
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/141116673?s=40&v=4" width="20" height="20" alt=""> [kuldip-trentium](https://github.com/kuldip-trentium) / [expo-crm](https://github.com/kuldip-trentium/expo-crm) | 0 |
|
|
17
|
-
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/161857344?s=40&v=4" width="20" height="20" alt=""> [uzziel-humanly](https://github.com/uzziel-humanly) / [APP-QUEJAS-AGUA-PUEBLA](https://github.com/uzziel-humanly/APP-QUEJAS-AGUA-PUEBLA) | 0 |
|
|
18
|
-
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/26320684?s=40&v=4" width="20" height="20" alt=""> [dariiioz](https://github.com/dariiioz) / [triphub-front](https://github.com/dariiioz/triphub-front) | 0 |
|
|
19
|
-
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/31977125?s=40&v=4" width="20" height="20" alt=""> [hendradedis](https://github.com/hendradedis) / [BacAku](https://github.com/hendradedis/BacAku) | 0 |
|
|
20
|
-
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/150951943?s=40&v=4" width="20" height="20" alt=""> [LoreneMntp](https://github.com/LoreneMntp) / [Triphub-front](https://github.com/LoreneMntp/Triphub-front) | 0 |
|
|
21
|
-
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/139728411?s=40&v=4" width="20" height="20" alt=""> [TPLCarloTaleon](https://github.com/TPLCarloTaleon) / [encrypt-decrypt-pdf](https://github.com/TPLCarloTaleon/encrypt-decrypt-pdf) | 0 |
|
|
22
|
-
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/92579981?s=40&v=4" width="20" height="20" alt=""> [janani-gopi](https://github.com/janani-gopi) / [PDFviewer](https://github.com/janani-gopi/PDFviewer) | 0 |
|
|
23
|
-
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/104327603?s=40&v=4" width="20" height="20" alt=""> [florvillalba21](https://github.com/florvillalba21) / [alfresco-testing](https://github.com/florvillalba21/alfresco-testing) | 0 |
|
|
24
|
-
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/127974191?s=40&v=4" width="20" height="20" alt=""> [typark1234](https://github.com/typark1234) / [nucampsite](https://github.com/typark1234/nucampsite) | 0 |
|
|
25
|
-
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/22235844?s=40&v=4" width="20" height="20" alt=""> [thanhttb](https://github.com/thanhttb) / [vee-app](https://github.com/thanhttb/vee-app) | 0 |
|
|
26
|
-
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/6248392?s=40&v=4" width="20" height="20" alt=""> [pangyujie](https://github.com/pangyujie) / [react-native-pdf-renderer](https://github.com/pangyujie/react-native-pdf-renderer) | 0 |
|
|
27
|
-
|
|
28
|
-
_Generated using [github-dependents-info](https://github.com/nvuillam/github-dependents-info), by [Nicolas Vuillamy](https://github.com/nvuillam)_
|