From d32acba060f67e410d37936b384514ab87636fa4 Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Tue, 18 Feb 2020 23:58:51 +0100 Subject: [PATCH] Created Third-party viewer usage (markdown) --- Third-party-viewer-usage.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Third-party-viewer-usage.md diff --git a/Third-party-viewer-usage.md b/Third-party-viewer-usage.md new file mode 100644 index 0000000..c664bf9 --- /dev/null +++ b/Third-party-viewer-usage.md @@ -0,0 +1,12 @@ +The default viewer is built on the display layer and is the UI for PDF viewer in Firefox and the other browser extensions within the project. It can be a good starting point for building your own viewer. However, we do ask if you plan to embed the viewer in your own site, that it not just be an unmodified version. Please re-skin it or build upon it. + +### Initialization promise +For custom deployment it is often necessary to know when the viewer is fully initialized. Previously this was possible by listening to the `localized` event, but pull request #11607 implemented a simpler way to do this: + +``` +document.addEventListener("webviewerloaded", function() { + PDFViewerApplication.initializedPromise.then(function() { + // The viewer has now been initialized. + }) +}); +``` \ No newline at end of file