Skip to content

Open Document

Method: openDocument(document : string, password : string, configuration : string)

Used to present a PDF document.

Parameters:

NameTypeDescription
documentstringThe path to the PDF document to be presented.
passwordstringPDF document password.
configurationstringConfiguration objects to customize the appearance and behavior of ComPDFKit.
  • (Android) For local storage file path:
tsx
document = '/storage/emulated/0/Download/PDF_document.pdf'
ComPDFKit.openDocument(document, '', ComPDFKit.getDefaultConfig({}))
  • (Android) For content Uri:
tsx
document = 'content://...'
ComPDFKit.openDocument(document, '', ComPDFKit.getDefaultConfig({}))
  • (Android) For assets path:
tsx
document = "file:///android_asset/..."
ComPDFKit.openDocument(document, '', ComPDFKit.getDefaultConfig({}))
  • (iOS) For app bundle file path:
tsx
document = 'pdf_document.pdf'
ComPDFKit.openDocument(document, '', ComPDFKit.getDefaultConfig({}))