react-native-pdf-jsi 4.3.0 → 4.3.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
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
[](https://expo.dev)
|
|
13
13
|
[](https://www.npmjs.com/package/react-native-pdf-jsi)
|
|
14
14
|
[](https://www.npmjs.com/package/react-native-pdf-jsi)
|
|
15
|
+
[](https://www.npmjs.com/package/react-native-pdf-jsi)
|
|
15
16
|
[](https://github.com/126punith/react-native-pdf-jsi)
|
|
16
17
|
[](https://github.com/126punith/react-native-pdf-jsi/blob/main/LICENSE)
|
|
17
18
|
|
|
@@ -456,6 +457,9 @@ MIT License - see [LICENSE](LICENSE) file for details.
|
|
|
456
457
|
|
|
457
458
|
## Recent Fixes
|
|
458
459
|
|
|
460
|
+
### Android PDF Preserved on Navigation (v4.3.1)
|
|
461
|
+
Fixed issue where the PDF instance was destroyed on Android when navigating away and returning to the screen ([#20](https://github.com/126punith/react-native-pdf-jsi/issues/20)). The PDF is now preserved in memory during navigation (matching iOS behavior) and only recycled when the component unmounts.
|
|
462
|
+
|
|
459
463
|
### Expo Support (v4.3.0)
|
|
460
464
|
Added Expo config plugin for seamless integration with Expo development builds. The package now works with `npx expo prebuild` and `npx expo run:ios/android`.
|
|
461
465
|
|
|
@@ -349,6 +349,18 @@ public class PdfView extends PDFView implements OnPageChangeListener,OnLoadCompl
|
|
|
349
349
|
this.drawPdf();
|
|
350
350
|
}
|
|
351
351
|
|
|
352
|
+
/**
|
|
353
|
+
* Override to prevent barteksc PDFView's recycle() on navigation.
|
|
354
|
+
* The parent class calls recycle() in onDetachedFromWindow, which destroys the PDF
|
|
355
|
+
* when the view is temporarily detached (e.g., navigating to another screen).
|
|
356
|
+
* We only recycle when PdfManager.onDropViewInstance is called (component unmount).
|
|
357
|
+
*/
|
|
358
|
+
@Override
|
|
359
|
+
protected void onDetachedFromWindow() {
|
|
360
|
+
// Intentionally skip super to prevent barteksc PDFView's recycle() which destroys
|
|
361
|
+
// the PDF on navigation. We only recycle when PdfManager.onDropViewInstance is called.
|
|
362
|
+
}
|
|
363
|
+
|
|
352
364
|
public void drawPdf() {
|
|
353
365
|
|
|
354
366
|
// FIX: Check if we actually need to reload the document
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-pdf-jsi",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.1",
|
|
4
4
|
"summary": "High-performance React Native PDF viewer with JSI acceleration - up to 80x faster than traditional bridge",
|
|
5
5
|
"description": "🚀 Ultra-fast React Native PDF viewer with JSI (JavaScript Interface) integration for maximum performance. Features lazy loading, smart caching, progressive loading, and zero-bridge overhead operations. Perfect for large PDF files with 30-day persistent cache and advanced memory optimization. Google Play 16KB page size compliant for Android 15+. Supports iOS, Android, and Windows platforms.",
|
|
6
6
|
"main": "index.js",
|