Comparing version 3.0.2 to 3.1.0
{ | ||
"name": "vue-pdf", | ||
"version": "3.0.2", | ||
"version": "3.1.0", | ||
"description": "vue.js pdf viewer", | ||
@@ -5,0 +5,0 @@ "main": "src/pdf.vue", |
@@ -76,2 +76,9 @@ # vue-pdf | ||
### Public static methods | ||
#### createLoadingTask(src) | ||
* `src`: see :src prop | ||
This function creates a PDFJS loading task that can be used and reused as :src property. | ||
##### example | ||
@@ -117,5 +124,32 @@ ``` | ||
##### example with multiple pages | ||
##### example - display multiple pages of the same pdf document | ||
``` | ||
<template> | ||
<div> | ||
<pdf v-for="i in 4" :key="i" :src="pdfSrc" :page="i"></pdf> | ||
</div> | ||
</template> | ||
<script> | ||
import pdf from 'vue-pdf' | ||
export default { | ||
components: { | ||
}, | ||
data() { | ||
return { | ||
pdfSrc: pdf.createLoadingTask('https://cdn.mozilla.net/pdfjs/tracemonkey.pdf') | ||
} | ||
} | ||
} | ||
</script> | ||
``` | ||
##### example - print multiple pages | ||
``` | ||
<template> | ||
<button @click="$refs.myPdfComponent.print(100, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14])">print</button> | ||
@@ -122,0 +156,0 @@ <pdf ref="myPdfComponent" src="https://cdn.mozilla.net/pdfjs/tracemonkey.pdf"></pdf> |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22515
263