QPdfViewer is an
UI App Extension for Quasar Framework v1. It will not work with legacy versions of Quasar Framework.
This work is currently in
beta and there are expected changes while things get worked out. Your help with testing is greatly appreciated. Suggestions and PRs welcomed.
QPdfViewer allows you to have PDF in your web pages.
To add this App Extension to your Quasar application, run the following (in your Quasar app folder):
quasar ext add @quasar/qpdfviewer
To remove this App Extension from your Quasar application, run the following (in your Quasar app folder):
quasar ext remove @quasar/qpdfviewer
You can use
quasar describe QPdfViewer
In demo folder of app-extension-qpdfviewer.
Can be found here
Be sure to check out the Test Project for more examples.
Using blob data (for
QPdfviewer now has support for native HTML5 PDF viewer and for PDFJS. Use
type="pdfjs". If you previously has this app extension, and want to use the pdfjs, you will need to re-install it. An update will not get the PDFJS for you. If you update, you can run
quasar ext invoke @quasar/qpdfviewer instead of re-installing.
QPdfviewer uses the
<object> tag for displaying the PDF (
type="html5" only). Should the browser not support this, the fallback is to use an
<iframe>. And, should this also not be supported by the browser, then some text will be displayed with a link to the PDF so the user can download it for off-line viewing.
When using PDFJS, the PDF is always displayed in an
QPdfviewer now works with Electron, but you have to use
type="pdfjs" to get this functionality.
QPdfviewer Vue Properties
|value||Boolean||Use v-model to toggle visiblity|
|src||String||Path to the PDF source|
|type||String||PDF engine to use (values:
|error-string||String||Set this if you wish to change from the default error string|
|load||Function||The function to be called when the pdf document has been loaded|
|error||Function||The function to be called when the pdf document has an error|
|content-class||[String, Object, Array]||Style definitions to be attributed to the PDF container|
|content-style||[String, Object, Array]||Style definitions to be attributed to the PDF container|
|inner-content-class||[String, Object, Array]||Style definitions to be attributed to the PDF object|
|inner-content-style||[String, Object, Array]||Style definitions to be attributed to the PDF object|
QPdfViewer has no events or slots.
If you appreciate the work that went into this App Extension, please consider donating to Quasar.