public getDocument(source: string, pdfDataRangeTransport?: any, passwordCallback?: (fn: (password: string) => void, reason: string) => string, progressCallback?: (progressData: PDFProgressData) => void): PDFPromise
This is the main entry point for loading a PDF and interacting with it.
NOTE: If a URL is used to fetch the PDF data a standard XMLHttpRequest(XHR)
is used, which means it must follow the same origin rules that any XHR does
e.g. No corss domain requests without CORS.
Parameters
-
source: string
-
pdfDataRangeTransport?: any optional
Used if you want to manually server range requests for data in the PDF. @ee viewer.js for an example of pdfDataRangeTransport's interface.
-
passwordCallback?: (fn: (password: string) => void, reason: string) => string optional
Used to request a password if wrong or no password was provided. The callback receives two parameters: function that needs to be called with new password and the reason.
-
progressCallback?: (progressData: PDFProgressData) => void optional
Progress callback.
Returns
PDFPromise
A promise that is resolved with PDFDocumentProxy object.
public getDocument(source: Uint8Array, pdfDataRangeTransport?: any, passwordCallback?: (fn: (password: string) => void, reason: string) => string, progressCallback?: (progressData: PDFProgressData) => void): PDFPromise
Parameters
-
source: Uint8Array
-
pdfDataRangeTransport?: any optional
-
passwordCallback?: (fn: (password: string) => void, reason: string) => string optional
-
progressCallback?: (progressData: PDFProgressData) => void optional
Returns
PDFPromise
public getDocument(source: PDFSource, pdfDataRangeTransport?: any, passwordCallback?: (fn: (password: string) => void, reason: string) => string, progressCallback?: (progressData: PDFProgressData) => void): PDFPromise
Parameters
-
-
pdfDataRangeTransport?: any optional
-
passwordCallback?: (fn: (password: string) => void, reason: string) => string optional
-
progressCallback?: (progressData: PDFProgressData) => void optional
Returns
PDFPromise