react-native-pdf-jsi 4.1.0 → 4.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 +6 -1
- package/ios/RNPDFPdf/RNPDFPdfView.mm +4 -23
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ High-performance React Native PDF viewer with JSI (JavaScript Interface) acceler
|
|
|
21
21
|
### Core Functionality
|
|
22
22
|
- Read PDFs from URL, blob, local file, or asset with caching support
|
|
23
23
|
- Horizontal and vertical display modes
|
|
24
|
-
-
|
|
24
|
+
- **Pinch-to-zoom** and drag with double-tap support (iOS & Android)
|
|
25
25
|
- Password-protected PDF support
|
|
26
26
|
- Programmatic page navigation
|
|
27
27
|
- Cross-platform support (iOS, Android, Windows)
|
|
@@ -408,6 +408,11 @@ MIT License - see [LICENSE](LICENSE) file for details.
|
|
|
408
408
|
- **Issues**: [GitHub Issues](https://github.com/126punith/react-native-pdf-jsi/issues)
|
|
409
409
|
- **Author**: Punith M ([@126punith](https://github.com/126punith))
|
|
410
410
|
|
|
411
|
+
## Recent Fixes
|
|
412
|
+
|
|
413
|
+
### iOS Pinch-to-Zoom (v4.1.1)
|
|
414
|
+
Fixed critical issue where pinch-to-zoom gestures were not working on iOS. The fix removes interfering custom gesture recognizers and enables PDFView's native pinch-to-zoom functionality, which now works smoothly on both iOS and Android.
|
|
415
|
+
|
|
411
416
|
## Changelog
|
|
412
417
|
|
|
413
418
|
See [CHANGELOG.md](CHANGELOG.md) for a complete list of changes and version history.
|
|
@@ -74,7 +74,6 @@ const float MIN_SCALE = 1.0f;
|
|
|
74
74
|
NSArray<NSString *> *_changedProps;
|
|
75
75
|
UITapGestureRecognizer *_doubleTapRecognizer;
|
|
76
76
|
UITapGestureRecognizer *_singleTapRecognizer;
|
|
77
|
-
UIPinchGestureRecognizer *_pinchRecognizer;
|
|
78
77
|
UILongPressGestureRecognizer *_longPressRecognizer;
|
|
79
78
|
UITapGestureRecognizer *_doubleTapEmptyRecognizer;
|
|
80
79
|
|
|
@@ -255,7 +254,6 @@ using namespace facebook::react;
|
|
|
255
254
|
// remove old recognizers before adding new ones
|
|
256
255
|
[self removeGestureRecognizer:_doubleTapRecognizer];
|
|
257
256
|
[self removeGestureRecognizer:_singleTapRecognizer];
|
|
258
|
-
[self removeGestureRecognizer:_pinchRecognizer];
|
|
259
257
|
[self removeGestureRecognizer:_longPressRecognizer];
|
|
260
258
|
[self removeGestureRecognizer:_doubleTapEmptyRecognizer];
|
|
261
259
|
|
|
@@ -655,7 +653,6 @@ using namespace facebook::react;
|
|
|
655
653
|
|
|
656
654
|
_doubleTapRecognizer = nil;
|
|
657
655
|
_singleTapRecognizer = nil;
|
|
658
|
-
_pinchRecognizer = nil;
|
|
659
656
|
_longPressRecognizer = nil;
|
|
660
657
|
_doubleTapEmptyRecognizer = nil;
|
|
661
658
|
}
|
|
@@ -808,10 +805,11 @@ using namespace facebook::react;
|
|
|
808
805
|
|
|
809
806
|
- (void)onScaleChanged:(NSNotification *)noti
|
|
810
807
|
{
|
|
811
|
-
|
|
812
808
|
if (_initialed && _fixScaleFactor>0) {
|
|
813
|
-
|
|
814
|
-
|
|
809
|
+
float newScale = _pdfView.scaleFactor/_fixScaleFactor;
|
|
810
|
+
// Only notify if scale changed significantly (threshold of 0.01 to prevent excessive callbacks)
|
|
811
|
+
if (fabs(_scale - newScale) > 0.01f) {
|
|
812
|
+
_scale = newScale;
|
|
815
813
|
[self notifyOnChangeWithMessage:[[NSString alloc] initWithString:[NSString stringWithFormat:@"scaleChanged|%f", _scale]]];
|
|
816
814
|
}
|
|
817
815
|
}
|
|
@@ -923,16 +921,6 @@ using namespace facebook::react;
|
|
|
923
921
|
|
|
924
922
|
}
|
|
925
923
|
|
|
926
|
-
/**
|
|
927
|
-
* Pinch
|
|
928
|
-
*
|
|
929
|
-
*
|
|
930
|
-
* @param sender The pinch gesture recognizer
|
|
931
|
-
*/
|
|
932
|
-
-(void)handlePinch:(UIPinchGestureRecognizer *)sender{
|
|
933
|
-
[self onScaleChanged:Nil];
|
|
934
|
-
}
|
|
935
|
-
|
|
936
924
|
/**
|
|
937
925
|
* Do nothing on long Press
|
|
938
926
|
*
|
|
@@ -971,13 +959,6 @@ using namespace facebook::react;
|
|
|
971
959
|
|
|
972
960
|
[singleTapRecognizer requireGestureRecognizerToFail:doubleTapRecognizer];
|
|
973
961
|
|
|
974
|
-
UIPinchGestureRecognizer *pinchRecognizer = [[UIPinchGestureRecognizer alloc] initWithTarget:self
|
|
975
|
-
action:@selector(handlePinch:)];
|
|
976
|
-
[self addGestureRecognizer:pinchRecognizer];
|
|
977
|
-
_pinchRecognizer = pinchRecognizer;
|
|
978
|
-
|
|
979
|
-
pinchRecognizer.delegate = self;
|
|
980
|
-
|
|
981
962
|
UILongPressGestureRecognizer *longPressRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self
|
|
982
963
|
action:@selector(handleLongPress:)];
|
|
983
964
|
// Making sure the allowable movement isn not too narrow
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-pdf-jsi",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.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",
|
|
@@ -64,8 +64,7 @@
|
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"crypto-js": "4.2.0",
|
|
67
|
-
"deprecated-react-native-prop-types": "^2.3.0"
|
|
68
|
-
"react-native-pdf-jsi": "^2.2.4"
|
|
67
|
+
"deprecated-react-native-prop-types": "^2.3.0"
|
|
69
68
|
},
|
|
70
69
|
"devDependencies": {
|
|
71
70
|
"@babel/core": "^7.20.2",
|