{"id":17658689,"url":"https://github.com/xcarpentier/rn-pdf-reader-js","last_synced_at":"2025-05-15T19:08:53.242Z","repository":{"id":31440038,"uuid":"126957996","full_name":"xcarpentier/rn-pdf-reader-js","owner":"xcarpentier","description":"📄 PDF reader in JavaScript only for Expo - Android \u0026 iOS capable","archived":false,"fork":false,"pushed_at":"2024-07-15T08:09:40.000Z","size":7458,"stargazers_count":391,"open_issues_count":28,"forks_count":165,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-07T05:36:11.296Z","etag":null,"topics":["expo","pdf-reader","pdf-viewer","pdfjs","react-native","react-pdf"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xcarpentier.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"xcarpentier","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2018-03-27T08:56:51.000Z","updated_at":"2025-05-07T03:11:49.000Z","dependencies_parsed_at":"2023-12-22T16:11:02.174Z","dependency_job_id":"d743b3c3-2b84-4197-be71-e7a0a1e1e766","html_url":"https://github.com/xcarpentier/rn-pdf-reader-js","commit_stats":{"total_commits":136,"total_committers":19,"mean_commits":7.157894736842105,"dds":"0.16176470588235292","last_synced_commit":"d660e8a4f9a31503bc2f8eb7a6b9ea162177d8f3"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xcarpentier%2Frn-pdf-reader-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xcarpentier%2Frn-pdf-reader-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xcarpentier%2Frn-pdf-reader-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xcarpentier%2Frn-pdf-reader-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xcarpentier","download_url":"https://codeload.github.com/xcarpentier/rn-pdf-reader-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254404357,"owners_count":22065641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["expo","pdf-reader","pdf-viewer","pdfjs","react-native","react-pdf"],"created_at":"2024-10-23T15:28:26.607Z","updated_at":"2025-05-15T19:08:53.115Z","avatar_url":"https://github.com/xcarpentier.png","language":"TypeScript","funding_links":["https://github.com/sponsors/xcarpentier"],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003ePDF Reader\u003c/h1\u003e\n\u003cp align=\"center\"\u003eAndroid support 🚀\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n   \u003cimg width=\"250\" src=\"https://thumbs.gfycat.com/DeadPoisedBrownbutterfly-max-14mb.gif\" /\u003e\n   \u003cbr/\u003e\n   \u003cbr/\u003e\n   \u003cbr/\u003e\n   \u003cbr/\u003e\n   \u003ca href=\"https://www.npmjs.com/package/rn-pdf-reader-js\"\u003e\u003cimg alt=\"npm version\" src=\"https://badge.fury.io/js/rn-pdf-reader-js.svg\"/\u003e\n   \u003ca href=\"https://www.npmjs.com/package/rn-pdf-reader-js\"\u003e\n  \u003cimg alt=\"npm downloads\" src=\"https://img.shields.io/npm/dm/rn-pdf-reader-js.svg\"/\u003e\u003c/a\u003e\n\u003ca href=\"http://reactnative.gallery/xcarpentier/rn-pdf-reader-js\"\u003e\u003cimg src=\"https://img.shields.io/badge/reactnative.gallery-%F0%9F%8E%AC-green.svg\"/\u003e\u003c/a\u003e\n\u003c/a\u003e\n  \u003ca href=\"#hire-an-expert\"\u003e\u003cimg src=\"https://img.shields.io/badge/%F0%9F%92%AA-hire%20an%20expert-brightgreen\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# Read a PDF just with JS (no native libs needed)\n\n## Requirements\n\n- 👉**Install react-native-webview** on your own!\n- 👉**Install expo-file-system** on your own!\n- 👉**Install expo-constants** on your own!\n- Use it into Expo app (from expo client, Standalone app or ExpoKit app).\n- Only React-Native 0.59-0.60+ support, **Expo SDK 33-36+**\n\n[PRs are welcome...](https://github.com/xcarpentier/rn-pdf-reader-js/pulls)\n\n## Example\n\n```tsx\nimport * as React from 'react'\nimport { View } from 'react-native'\nimport PDFReader from 'rn-pdf-reader-js'\n\nexport default class App extends React.Component {\n  render() {\n    return (\n      \u003cPDFReader\n        source={{\n          uri: 'http://gahp.net/wp-content/uploads/2017/09/sample.pdf',\n        }}\n      /\u003e\n    )\n  }\n}\n```\n\nSee more detailed example into `App.tsx` file.\n\n## Props\n\n```tsx\ninterface Source {\n  uri?: string // can be local or served on the web (ie. start with `https://` or `file://`)\n  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...`\n  headers?: { [key: string]: string }\n}\n\ninterface Props {\n  source: Source\n  style?: View['props']['style'] // style props to override default container style\n  webviewStyle?: WebView['props']['style'] // style props to override default WebView style\n  webviewProps?: WebView['props']\n  noLoader?: boolean\n  useGoogleReader?: boolean // If you are not worried about confidentiality\n  withScroll?: boolean // Can cause performance issue\n  withPinchZoom?: boolean\n  customStyle?: {\n    readerContainer?: CSS.Properties\n    readerContainerDocument?: CSS.Properties\n    readerContainerNumbers?: CSS.Properties\n    readerContainerNumbersContent?: CSS.Properties\n    readerContainerZoomContainer?: CSS.Properties\n    readerContainerZoomContainerButton?: CSS.Properties\n    readerContainerNavigate?: CSS.Properties\n    readerContainerNavigateArrow?: CSS.Properties\n  }\n  onLoad?(): void // callback that runs after WebView is loaded\n  onLoadEnd?(): void // callback that runs after WebView is loaded\n  onError?(): void // callback that runs when WebView is on error\n}\n```\n\n## Possibilities\n\n| Render type         | Platform     | Source prop   |\n| ------------------- | ------------ | ------------- |\n| Custom PDF reader   | Android      | uri or base64 |\n| Direct from WebView | iOS          | uri or base64 |\n| Google PDF Reader   | Android, iOS | uri           |\n\n## What rn-pdf-reader-js use?\n\n- react-pdf (pdf.js)\n- WebView\n- Base64\n\n## FAQ\n\n- [Why the component doesn't render PDF?](https://github.com/xcarpentier/rn-pdf-reader-js/issues/15#issuecomment-397306743)\n\n## Hire an expert!\n\nLooking for a ReactNative freelance expert with more than 12 years experience? Contact me from my [website](https://xaviercarpentier.com)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxcarpentier%2Frn-pdf-reader-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxcarpentier%2Frn-pdf-reader-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxcarpentier%2Frn-pdf-reader-js/lists"}