Package Exports
- @quasar/quasar-app-extension-qpdfviewer
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@quasar/quasar-app-extension-qpdfviewer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
QPdfViewer (@quasar/qpdfviewer)
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.
Info
QPdfViewer allows you to have markdown in your web pages. You can either use the standard default slot or use the property src to define your markdown.
Install
To add this App Extension to your Quasar application, run the following (in your Quasar app folder):
quasar ext add @quasar/qpdfviewerUninstall
To remove this App Extension from your Quasar application, run the following (in your Quasar app folder):
quasar ext remove @quasar/qpdfviewerDescribe
You can use quasar describe QPdfViewer
Test Project
Can be found here.
Demo
Can be found here.
Example Code
Be sure to check out the Test Project for more examples.
<q-pdfviewer
v-model="show"
src="'https://www.ets.org/Media/Tests/GRE/pdf/gre_research_validity_data.pdf'"
content-class="absolute"
/>
or
<template>
<div class="container q-pa-lg">
<q-pdfviewer
v-model="show"
:src="src"
content-class="fit container"
inner-content-class="fit container"
/>
</div>
</template>
<script>
export default {
name: 'Container',
props: {
src: String
},
data () {
return {
show: true
}
}
}
</script>
<style>
.container {
max-width: 50%;
max-height: 70%;
min-width: 400px;
min-height: 600px;
width: 100%;
height: 100%;
}
</style>
NOTE:
QPdfviewer uses the <object> tag for displaying the PDF. 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.
QPdfviewer Vue Properties
| Vue Property | Type | Description |
|---|---|---|
| value | Boolean | Use v-model to toggle visiblity |
| src | String | Path to the PDF source |
| error-string | String | Set this if you wish to change from the default error string |
| 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.