New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-native-pdf

Package Overview
Dependencies
Maintainers
1
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-pdf - npm Package Compare versions

Comparing version 6.6.2 to 6.7.0

android/src/main/java/org/wonday/pdf/PdfManager.java

2

index.d.ts

@@ -38,2 +38,4 @@ /**

horizontal?: boolean,
showsHorizontalScrollIndicator?: boolean,
showsVerticalScrollIndicator?: boolean,
spacing?: number,

@@ -40,0 +42,0 @@ password?: string,

52

index.js

@@ -13,3 +13,2 @@ /**

import {
requireNativeComponent,
View,

@@ -21,3 +20,5 @@ Platform,

} from 'react-native';
import PdfViewNativeComponent, {
Commands as PdfViewCommands,
} from './fabric/RNPDFPdfNativeComponent';
import ReactNativeBlobUtil from 'react-native-blob-util'

@@ -52,2 +53,4 @@ import {ViewPropTypes} from 'deprecated-react-native-prop-types';

enableAnnotationRendering: PropTypes.bool,
showsHorizontalScrollIndicator: PropTypes.bool,
showsVerticalScrollIndicator: PropTypes.bool,
enablePaging: PropTypes.bool,

@@ -86,2 +89,4 @@ enableRTL: PropTypes.bool,

enableAnnotationRendering: true,
showsHorizontalScrollIndicator: true,
showsVerticalScrollIndicator: true,
enablePaging: false,

@@ -115,3 +120,2 @@ enableRTL: false,

progress: 0,
isSupportPDFKit: -1
};

@@ -143,10 +147,2 @@

this._mounted = true;
if (Platform.OS === "ios") {
const PdfViewManagerNative = require('react-native').NativeModules.PdfViewManager;
PdfViewManagerNative.supportPDFKit((isSupportPDFKit) => {
if (this._mounted) {
this.setState({isSupportPDFKit: isSupportPDFKit ? 1 : 0});
}
});
}
this._loadFromSource(this.props.source);

@@ -245,3 +241,3 @@ }

this.setState({
path: uri.replace(/file:\/\//i, ''),
path: unescape(uri.replace(/file:\/\//i, '')),
isDownloaded: true,

@@ -356,5 +352,15 @@ });

}
this.setNativeProps({
page: pageNumber
});
if (!!global?.nativeFabricUIManager ) {
if (this._root) {
PdfViewCommands.setNativePage(
this._root,
pageNumber,
);
}
} else {
this.setNativeProps({
page: pageNumber
});
}
}

@@ -418,3 +424,3 @@

):(
this.props.usePDFKit && this.state.isSupportPDFKit === 1?(
this.props.usePDFKit ?(
<PdfCustom

@@ -449,18 +455,10 @@ ref={component => (this._root = component)}

if (Platform.OS === "android") {
if (Platform.OS === "android" || Platform.OS === "ios") {
var PdfCustom = PdfViewNativeComponent;
} else if (Platform.OS === "windows") {
var PdfCustom = requireNativeComponent('RCTPdf', Pdf, {
nativeOnly: {path: true, onChange: true},
})
} else if (Platform.OS === "ios") {
var PdfCustom = requireNativeComponent('RCTPdfView', Pdf, {
nativeOnly: {path: true, onChange: true},
})
} else if (Platform.OS === "windows") {
var PdfCustom = requireNativeComponent('RCTPdf', Pdf, {
nativeOnly: {path: true, onChange: true},
})
}
const styles = StyleSheet.create({

@@ -467,0 +465,0 @@ progressContainer: {

{
"name": "react-native-pdf",
"version": "6.6.2",
"version": "6.7.0",
"summary": "A react native PDF view component",

@@ -35,4 +35,11 @@ "description": "A react native PDF view component, support ios and android platform",

"devDependencies": {
"@babel/core": "^7.20.2",
"@babel/runtime": "^7.20.1",
"prop-types": "^15.7.2"
},
"peerDependencies": {
"react": "*",
"react-native": "*",
"react-native-blob-util": ">=0.13.7"
},
"files": [

@@ -51,4 +58,13 @@ "android/",

"PinchZoomView.js",
"react-native-pdf.podspec"
]
"react-native-pdf.podspec",
"fabric/"
],
"codegenConfig": {
"name": "rnpdf",
"type": "components",
"jsSrcsDir": "./fabric",
"android": {
"javaPackageName": "org.wonday.pdf"
}
}
}

@@ -117,10 +117,10 @@ # react-native-pdf

Q1. After installation and running, I can not see the pdf file.
Q1. After installation and running, I can not see the pdf file.
A1: maybe you forgot to excute ```react-native link``` or it does not run correctly.
You can add it manually. For detail you can see the issue [`#24`](https://github.com/wonday/react-native-pdf/issues/24) and [`#2`](https://github.com/wonday/react-native-pdf/issues/2)
Q2. When running, it shows ```'Pdf' has no propType for native prop RCTPdf.acessibilityLabel of native type 'String'```
Q2. When running, it shows ```'Pdf' has no propType for native prop RCTPdf.acessibilityLabel of native type 'String'```
A2. Your react-native version is too old, please upgrade it to 0.47.0+ see also [`#39`](https://github.com/wonday/react-native-pdf/issues/39)
Q3. When I run the example app I get a white/gray screen / the loading bar isn't progressing .
Q3. When I run the example app I get a white/gray screen / the loading bar isn't progressing .
A3. Check your uri, if you hit a pdf that is hosted on a `http` you will need to do the following:

@@ -155,6 +155,6 @@

Q4. why doesn't it work with react native expo?.
Q4. why doesn't it work with react native expo?.
A4. Expo does not support native module. you can read more expo caveats [`here`](https://facebook.github.io/react-native/docs/getting-started.html#caveats)
Q5. Why can't I run the iOS example? `'Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65.'`
Q5. Why can't I run the iOS example? `'Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65.'`
A5. Run the following commands in the project folder (e.g. `react-native-pdf/example`) to ensure that all dependencies are available:

@@ -174,2 +174,8 @@ ```

v6.7.0
1. Fixed: fix(iOS): center page at tap point after double tap to zoom
2. Fixed: add PDFKit to podspec to make ios compile
3. Improved: Update build.gradle to support RN 0.71 on new arch
4. Fixed: fix some small bugs and documents.
v6.6.2

@@ -206,38 +212,2 @@ 1. Fixed: Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'

v6.2.2
1. Fixed incorrect type of onPageSingleTap and onScaleChanged argument
2. Fixed included missing setPage method in TypeScript and Flow types
3. fixed Xcode 12 compatibility
v6.2.1
1. Fixed typescript `onLoadComplete()` definition
2. Switched the AndroidPdfViewer dependency from Barteksc repo to TalbotGooday
3. Add singlePage property
v6.2.0
1. Fixed ReferenceError, url should be source.uri
2. Dependency bump to support React-Native >= 0.62
v6.1.2
1. Fixed wrong scale returned from onScaleChanged()
2. Fixed iOS Double Tap zoom
3. Fixed Some critical typo fixes
v6.1.1
1. Fixed undefined is not an object, crashing on ios
v6.1.0
1. Fixed react-native warning on `componentWill*`
2. Fixed onPageSingleTap
3. Set the PDF View background color to be transparent On iOS
v6.0.1
1. Expose prop to trust self-signed SSL certs
2. Use ViewStyleProp in index.js.flow, not deprecated StyleSheet.Styles
v6.0.0
1. Add JS callback onPressLink for pdf link press listener
2. Fix calling setState while unmounted
[[more]](https://github.com/wonday/react-native-pdf/releases)

@@ -321,2 +291,4 @@

| horizontal | bool | false | draw page direction, if you want to listen the orientation change, you can use [[react-native-orientation-locker]](https://github.com/wonday/react-native-orientation-locker)| ✔ | ✔ | ✔ | <3.0 |
| showsHorizontalScrollIndicator | bool | true | shows or hides the horizontal scroll bar indicator on iOS| ✔ | | | 6.6 |
| showsVerticalScrollIndicator | bool | true | shows or hides the vertical scroll bar indicator on iOS| ✔ | | | 6.6 |
| fitWidth | bool | false | if true fit the width of view, can not use fitWidth=true together with scale| ✔ | ✔ | ✔ | <3.0, abandoned from 3.0 |

@@ -323,0 +295,0 @@ | fitPolicy | number | 2 | 0:fit width, 1:fit height, 2:fit both(default)| ✔ | ✔ | ✔ | 3.0 |

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc