Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@valli_/rn-pdf-reader-js
Advanced tools
Fork From PDF reader for Expo - Xavier Carpentier <xcapetir@gmail.com> (https://xaviercarpentier.com/)
Android support 🚀
import * as React from 'react'
import { View } from 'react-native'
import PDFReader from 'rn-pdf-reader-js'
export default class App extends React.Component {
render() {
return (
<PDFReader
source={{
uri: 'http://gahp.net/wp-content/uploads/2017/09/sample.pdf',
}}
/>
)
}
}
See more detailed example into App.tsx
file.
interface Source {
uri?: string // can be local or served on the web (ie. start with `https://` or `file://`)
base64?: string // should start with `data:application/pdf;base64,`. A base64 encoded pdf file tends to start with `JVBERi0xL` so your complete string should look something like this: `data:application/pdf;base64,JVBERi0xL...`
headers?: { [key: string]: string }
}
interface Props {
source: Source
style?: View['props']['style'] // style props to override default container style
webviewStyle?: WebView['props']['style'] // style props to override default WebView style
webviewProps?: WebView['props']
noLoader?: boolean
useGoogleReader?: boolean // If you are not worried about confidentiality
withScroll?: boolean // Can cause performance issue
withPinchZoom?: boolean
customStyle?: {
readerContainer?: CSS.Properties
readerContainerDocument?: CSS.Properties
readerContainerNumbers?: CSS.Properties
readerContainerNumbersContent?: CSS.Properties
readerContainerZoomContainer?: CSS.Properties
readerContainerZoomContainerButton?: CSS.Properties
readerContainerNavigate?: CSS.Properties
readerContainerNavigateArrow?: CSS.Properties
}
onLoad?(): void // callback that runs after WebView is loaded
onLoadEnd?(): void // callback that runs after WebView is loaded
onError?(): void // callback that runs when WebView is on error
}
Render type | Platform | Source prop |
---|---|---|
Custom PDF reader | Android | uri or base64 |
Direct from WebView | iOS | uri or base64 |
Google PDF Reader | Android, iOS | uri |
Looking for a ReactNative freelance expert with more than 12 years experience? Contact me from my website!
FAQs
Fork From PDF reader for Expo - Xavier Carpentier <xcapetir@gmail.com> (https://xaviercarpentier.com/)
We found that @valli_/rn-pdf-reader-js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.