
Security News
NIST Under Federal Audit for NVD Processing Backlog and Delays
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
@hashiprobr/expo-pdf-reader
Advanced tools
A wrapper around Xavier Carpentier's rn-pdf-reader-js that gracefully degrades in the web
A wrapper around Xavier Carpentier's rn-pdf-reader-js that gracefully degrades in the web
Simply import PDFReader
from '@hashiprobr/expo-pdf-reader'
instead of
'rn-pdf-reader-js'
. In the web, the component gracefully degrades to an
object that
uses the browser built-in PDF viewer if available. While much more limited, this
allows Expo to preview the app in a browser without errors.
This is for development purposes only. Projects that need a proper PDF viewer for the web should use better solutions like React-PDF instead.
{
"expo": "45.0.0",
"expo-constants": "13.1.1",
"expo-file-system": "14.0.0",
"react": "17.0.2",
"react-native": "0.68.2",
"react-native-webview": "11.18.1",
"rn-pdf-reader-js": "4.1.1"
}
With npm:
npm install @hashiprobr/expo-pdf-reader
With yarn:
yarn add @hashiprobr/expo-pdf-reader
With expo:
expo install @hashiprobr/expo-pdf-reader
If using Expo, add the module to webpack.config.js
:
const createExpoWebpackConfigAsync = require('@expo/webpack-config');
module.exports = async function (env, argv) {
const config = await createExpoWebpackConfigAsync({
...env,
babel: {
dangerouslyAddModulePathsToTranspile: [
'@hashiprobr/expo-pdf-reader',
],
},
}, argv);
return config;
};
If webpack.config.js
does not exist, create it with:
expo customize:web
import React from 'react';
import PDFReader from '@hashiprobr/expo-pdf-reader';
export default function MyComponent(props) {
return (
<PDFReader source={{ uri: 'uri/to/a/pdf' }} />
);
}
FAQs
A wrapper around Xavier Carpentier's rn-pdf-reader-js that gracefully degrades in the web
The npm package @hashiprobr/expo-pdf-reader receives a total of 53 weekly downloads. As such, @hashiprobr/expo-pdf-reader popularity was classified as not popular.
We found that @hashiprobr/expo-pdf-reader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.
Security News
TypeScript Native Previews offers a 10x faster Go-based compiler, now available on npm for public testing with early editor and language support.