Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@tato30/vue-pdf
Advanced tools
VuePDF is a Vue 3 wrapper for pdf.js that enable you to display pdf pages in your project. this package consist in two parts: PDFProxy Composable and VuePDF Component, will be explained in more details later in this document.
No install info yet.
This package is for Vue 3 and supports the same browsers as Vue 3. If you want a package for Vue 2 or older browsers check this project from FranckFreiburger: vue-pdf.
<template>
<VuePDF :pdf="pdf" :page="1" />
</template>
<script>
import {PDFProxy, VuePDF} from 'VuePDF'
export default {
components: {
VuePDF
},
setup(){
const onProgress = ({loaded, total}) => {
console.log(`${loaded / total * 100}% Loaded`);
}
const onPassword = (updatePassword, _) => {
updatePassword('password')
}
const { pdf } = PDFProxy("document.pdf", onProgress, onPassword)
return {
pdf
}
}
}
</script>
This function is the pdf loader, let you get the basic information and properties about pdf document.
Type: string | URL | TypedArray
This param is the same src
of pdf.js
Type: function
Callback function to enable loading progress monitor
Type: function
Callback function to request document password
Type: PDFDocumentLoadingTask
The loading task of document, see PDFDocumentLoadingTask for more details
Type: int
Pages number of document
Type: object
Info about document
This is the component to render a pdf page.
Type: PDFDocumentLoadingTask
Required: True
The PDFDocumentLoadingTask obtained from PDFProxy
<VuePDF :pdf="pdf" />
Type: int
Default: 1
Page to render, this prop must be the page number starting at 1
<VuePDF :pdf="pdf" :page="2" />
Type: int
Default: 1
Scale to render page
<VuePDF :pdf="pdf" :page="1" :scale="0.5" />
Type: boolean
Default: false
Enable text selection in page
<VuePDF :pdf="pdf" :page="1" text-layer />
Type: boolean
Default: false
Enable document annotations like links, popups, etc.
<VuePDF :pdf="pdf" :page="1" annotation-layer />
object
Emitted when page has finishes rendering in view
<template>
<VuePDF :pdf="pdf" :page="2" @loaded="loadedEvent" />
</template>
const loadedEvent = (value) => {
console.log(value);
},
object
Emitted when user has interaction with any annotation in document view
<template>
<VuePDF :pdf="pdf" :page="2" @annotation="annotationEvent" />
</template>
const annotationEvent = (value) => {
console.log(value);
},
FAQs
PDF component for Vue 3
The npm package @tato30/vue-pdf receives a total of 13,005 weekly downloads. As such, @tato30/vue-pdf popularity was classified as popular.
We found that @tato30/vue-pdf demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.