Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
@tuttarealstep/vue-pdf.js
Advanced tools
A Vue component for displaying PDF files using the standard `pdf.js` viewer. This package provides a simple and powerful integration to embed PDF viewers in Vue applications.
vue-pdfjs
is a Vue 3 component for displaying PDF files using the standard pdf.js
viewer. This package provides a simple and powerful integration to embed PDF viewers in Vue applications.
pdf.js
To install the package, run:
npm install @tuttarealstep/vue-pdf.js
<script setup lang="ts">
import { reactive, useTemplateRef } from 'vue'
import { VuePDFjs } from '@tuttarealstep/vue-pdf.js'
import '@tuttarealstep/vue-pdf.js/dist/style.css'
import enUS_FTL from '@tuttarealstep/vue-pdf.js/l10n/en-US/viewer.ftl?raw'
const pdf = new URL('./path/to/custom.pdf', import.meta.url).href
const vuepdfjs = useTemplateRef<typeof VuePDFjs>('vuepdfjs')
const options = reactive({
locale: {
code: 'en-US',
ftl: enUS_FTL
}
})
const onPdfAppLoaded = () => {
console.log('pdf-app:loaded')
console.log(vuepdfjs.value?.pdfApp)
if (!vuepdfjs.value?.pdfApp) {
return
}
vuepdfjs.value.pdfApp.eventBus.on('pagesloaded', (e: any) => {
vuepdfjs.value?.pdfApp.eventBus.dispatch('find', {
query: ['Dynamic languages such as JavaScript are more difficult to compile than statically typed ones.'],
caseSensitive: false,
entireWord: false,
highlightAll: true
})
})
}
</script>
<template>
<div id="app">
<VuePDFjs ref="vuepdfjs" :source="pdf" :options="options" @pdf-app:loaded="onPdfAppLoaded" />
</div>
</template>
<style>
html,
body,
#app {
height: 100%;
width: 100%;
}
body {
margin: 0;
padding: 0;
}
</style>
<script setup lang="ts">
import { reactive, useTemplateRef } from 'vue'
import { VuePDFjs, usePDF } from '@tuttarealstep/vue-pdf.js'
import '@tuttarealstep/vue-pdf.js/dist/style.css'
import enUS_FTL from '@tuttarealstep/vue-pdf.js/l10n/en-US/viewer.ftl?raw'
const vuepdfjs = useTemplateRef<typeof VuePDFjs>('vuepdfjs')
const options = reactive({
locale: {
code: 'en-US',
ftl: enUS_FTL
}
})
const onPdfAppLoaded = () => {
console.log('pdf-app:loaded')
console.log(vuepdfjs.value?.pdfApp)
if (!vuepdfjs.value?.pdfApp) {
return
}
vuepdfjs.value.pdfApp.eventBus.on('pagesloaded', (e: any) => {
vuepdfjs.value?.pdfApp.eventBus.dispatch('find', {
query: ['Dynamic languages such as JavaScript are more difficult to compile than statically typed ones.'],
caseSensitive: false,
entireWord: false,
highlightAll: true
})
})
}
const { pdf, info, pages} = usePDF(new URL('./path/to/custom.pdf', import.meta.url).href) // or any other source type
console.log(document, info, pages)
</script>
<template>
<div id="app">
<VuePDFjs ref="vuepdfjs" :source="pdf" :options="options" @pdf-app:loaded="onPdfAppLoaded" />
</div>
</template>
<style>
html,
body,
#app {
height: 100%;
width: 100%;
}
body {
margin: 0;
padding: 0;
}
</style>
MIT
FAQs
A Vue component for displaying PDF files using the standard `pdf.js` viewer. This package provides a simple and powerful integration to embed PDF viewers in Vue applications.
The npm package @tuttarealstep/vue-pdf.js receives a total of 114 weekly downloads. As such, @tuttarealstep/vue-pdf.js popularity was classified as not popular.
We found that @tuttarealstep/vue-pdf.js 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.
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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.