Version 1.6.2 - March 3, 2025
-
Added:
debugMode
option, a value indicating whether to show details in text box in the addition to the main message on error dialog.
So from now on, by default, error details should not be shown on PdfViewer's error dialog, for example no details should be shown on local PDF opening errors:If you explicitly set this option to
true
, it will show details in text box in the addition to the main message on error dialog. This was the default behavior before v1.6.2:This can be useful for debugging purpose.
-
Improved:
failed
event can now be canceled viae.preventDefault()
to suppress showing default error dialog.
For example,e.detail.message
can be examined and a custom message can be shown viapdfViewer._showError()
method.var pdfViewer = new PdfViewer({ events: { failed: pdfViewerFailed } }); function pdfViewerFailed(e) { var pdfViewer = e.target; if (e.detail.message == "some specific message") { //Canceling this event, to suppress showing error dialog with default error message. e.preventDefault(); //Show your custom message with error dialog pdfViewer._showError("customMessage"); //Or write to browser console console.log("customMessage"); } }