
Research
NPM targeted by malware campaign mimicking familiar library names
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
vue3-to-pdf
Advanced tools
npm i vue3-to-pdf
or pnpm
pnpm i vue3-to-pdf
or yarn
yarn add vue3-to-pdf
import vue3ToPdf from 'vue3-to-pdf'
Vue.use(vue3ToPdf)
<v-pdf ref="pdf" :options="pdfOptions" :filename="exportFilename">
<h2>HTML Table</h2>
<table>
<tr>
<th>Company</th>
<th>Contact</th>
<th>Country</th>
</tr>
<tr>
<td>Alfreds Futterkiste</td>
<td>Maria Anders</td>
<td>Germany</td>
</tr>
<tr>
<td>Centro comercial Moctezuma</td>
<td>Francisco Chang</td>
<td>Mexico</td>
</tr>
<tr>
<td>Ernst Handel</td>
<td>Roland Mendel</td>
<td>Austria</td>
</tr>
<tr>
<td>Island Trading</td>
<td>Helen Bennett</td>
<td>UK</td>
</tr>
<tr>
<td>Laughing Bacchus Winecellars</td>
<td>Yoshi Tannamuri</td>
<td>Canada</td>
</tr>
<tr>
<td>Magazzini Alimentari Riuniti</td>
<td>Giovanni Rovelli</td>
<td>Italy</td>
</tr>
</table>
<img src="base64 image or url" />
<!-- You can loop to display page number as you want -->
<div class="html2pdf__page-number">1</div>
<!-- Break page pdf -->
<div class="html2pdf__page-break"></div>
</v-pdf>
...
// Props
pdfOptions = {
margin: 15,
image: {
type: 'jpeg',
quality: 1,
},
html2canvas: { scale: 3 },
jsPDF: {
unit: 'mm',
format: 'a4',
orientation: 'p',
},
},
exportFilename: 'my-custom-file.pdf'
...
<style scoped>
table {
font-size: 14px;
text-align: center;
border: 1px solid #ccc;
border-collapse: collapse;
th {
background: #ddd;
font-weight: bold;
}
td,
th {
padding: 8px;
border: 1px solid #ccc;
}
}
... Any other styles here;
</style>
Call start download pdf with Options api
this.$refs.pdf.download()
Call start download pdf with Composition api
const pdf = ref(true)
const download = () => {
pdf.value.download()
}
Call pdf in new tab with Options api
this.$refs.pdf.openInNewTab()
Call pdf in new tab with Composition api
const pdf = ref(true)
const openInNewTab = () => {
pdf.value.openInNewTab()
}
To break page, use html2pdf__page-break
<div class="html2pdf__page-break"></div>
To add page number, use html2pdf__page-number
<div class="html2pdf__page-number">{{ pageNumber }}</div>
The MIT License
To run the project and test its workflow, follow these steps:
cd test
pnpm install
pnpm link ../
pnpm run dev
FAQs
Export to PDF using vue3 and html2pdf.js
The npm package vue3-to-pdf receives a total of 139 weekly downloads. As such, vue3-to-pdf popularity was classified as not popular.
We found that vue3-to-pdf demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
Research
Socket's research uncovers three dangerous Go modules that contain obfuscated disk-wiping malware, threatening complete data loss.
Research
Socket uncovers malicious packages on PyPI using Gmail's SMTP protocol for command and control (C2) to exfiltrate data and execute commands.