From 5cf7f334156c4eddbd47eef12e8a76e0bd840ecc Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Sun, 12 May 2024 15:27:41 +0200 Subject: [PATCH] Use the new `PDFViewerApplication.open()` signature; fixes #18056. --- Frequently-Asked-Questions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Frequently-Asked-Questions.md b/Frequently-Asked-Questions.md index b20a8d7..2278c7d 100644 --- a/Frequently-Asked-Questions.md +++ b/Frequently-Asked-Questions.md @@ -22,7 +22,7 @@ ## Can I specify a different PDF in the default viewer? You can modify the `defaultUrl` app option in the `web/app_options.js` file or you can append the `?file=` query string to the viewer URL, e.g. `http://mozilla.github.com/pdf.js/web/viewer.html?file=compressed.tracemonkey-pldi-09.pdf`. In the latter case, the PDF path/URL must be encoded using `encodeURIComponent()`. -The viewer can be started without any PDF loaded by setting the `defaultUrl` app option to an empty string or by using the `?file=` query string without any location specified. Use `PDFViewerApplication.open(file)` to load the PDF file later. +The viewer can be started without any PDF loaded by setting the `defaultUrl` app option to an empty string or by using the `?file=` query string without any location specified. Use `PDFViewerApplication.open({ url: file });` to load the PDF file later. You can use raw binary data to open a PDF document: use Uint8Array instead of URL in the `PDFViewerApplication.open` call. If you have base64 encoded data, please [decode](https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding) it first -- not all browsers have `atob` or data URI scheme support. (The base64 conversion operation uses more memory, so we recommend delivering raw PDF data as typed array in first place.)