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.
@boooooob/vue3-pdfjs
Advanced tools
Forked from https://github.com/randolphtellis/vue3-pdfjs
and enhanced a little.
npm i vue3-pdfjs
or
yarn add vue3-pdfjs
import { createApp } from 'vue'
import App from './App.vue'
import VuePdf from 'vue3-pdfjs'
const app = createApp(App)
app.use(VuePdf)
app.mount('#app')
export interface VuePdfPropsType {
// The source of the pdf. Accepts the following types `string | URL | Uint8Array | PDFDataRangeTransport | DocumentInitParameters`
src: string | URL | Uint8Array | PDFDataRangeTransport | DocumentInitParameters;
// The page number of the pdf to display.
page?: number;
// Whether to display all pages. Ignore the prop `page` if true
allPages?: boolean;
// The scale (zoom) of the pdf. Setting this will also disable auto scaling and resizing.
scale?: number;
// Whether to enable text selection
enableTextSelection?: boolean;
// Whether to enable annotations (clickable links)
enableAnnotations?: boolean;
// page wrapper id prefix, default is `vue-pdf-page`
wrapperIdPrefix?: string;
}
Import components from the esm
folder to enable tree shaking.
Please note that Mozilla's pdfjs npm package does not export tree-shakeable ES modules. Info here - https://github.com/mozilla/pdf.js/issues/12900
<script lang="ts">
import { defineComponent, onMounted, reactive, ref } from 'vue';
import { VuePdf, createLoadingTask } from 'vue3-pdfjs/esm';
import { VuePdfPropsType } from 'vue3-pdfjs/components/vue-pdf/vue-pdf-props'; // Prop type definitions can also be imported
import { PDFDocumentProxy } from 'pdfjs-dist/types/src/display/api';
export default defineComponent({
name: 'Home',
components: { VuePdf },
setup() {
const pdfSrc = ref<VuePdfPropsType['src']>('https://raw.githubusercontent.com/mozilla/pdf.js/ba2edeae/web/compressed.tracemonkey-pldi-09.pdf')
return {
pdfSrc
}
}
});
</script>
<template>
<VuePdf :src="pdfSrc" all-pages />
</template>
FAQs
PDF Reader for Vue 3 using Mozilla's PDF.js
The npm package @boooooob/vue3-pdfjs receives a total of 23 weekly downloads. As such, @boooooob/vue3-pdfjs popularity was classified as not popular.
We found that @boooooob/vue3-pdfjs 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
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.