GuidesModules

PDF viewer

Display a local or remote PDF with the native PDF viewer

  • Stable unknown
  • Release candidate since 1.16.1-rc.3
  • Development since 1.16.1-dev.2111+9796905

Use PDFViewer when a mobile screen needs to display a PDF document. Import it from the pdf subpath so apps that do not use PDF rendering do not need to reference this feature. The application remains responsible for obtaining the document URL or file and enforcing access to it.

import { PDFViewer } from "@ovok/native/pdf";

<PDFViewer
  sourceURI={documentUrl}
  onLoadComplete={(pages, path) => setPageCount(pages)}
  onError={handleDocumentError}
/>

Install and configure the react-native-pdf peer dependency using its platform setup instructions. For authenticated files, provide a URL or headers supported by the viewer and avoid logging signed URLs. Give users a retry or an alternate download path when loading fails.

References

API reference

Every export of @ovok/native/pdf, with signatures, props and types, is in the pdf API reference.

Last updated on

On this page