A Vue.js wrapper component for PDF.js

Overview

vue-pdfjs-wrapper

A simple Vue.js wrapper component for PDF.js.

Note

This component installs and uses pdfjs-dist, and loads its worker using the worker-loader webpack module.

Install

npm install --save vue-pdfjs-wrapper

Import it into a specific component:

import VuePdfjsWrapper from 'vue-pdfjs-wrapper'
export default {
  components: { VuePdfjsWrapper },
  ...
}

You can also use it globally using the {plugin} export:

import Vue from 'vue'
import { plugin } from 'vue-pdfjs-wrapper'
Vue.use(plugin)

API

Props

pdf-src

Type: [ String ]
Required
The source of the PDF file, should be anything pdfjs.getDocument() Accepts.

scale

Type: Number
Default: 1
Float number describing the scale of the document to be rendered.
Passed to getViewport({ scale })

is-render-text

Type: Boolean
Default: false
This decides whether the text layer should be rendered

Emits

@loaded

Emits: void
Emitted once the pdf is fully loaded and rendered

Example

Component.vue

">
<template>
  <div>
    <vue-pdfjs-wrapper
      :pdf-src="src"
      :scale="getScale"
      :is-render-text="isRenderText"
      @loaded="onDocumentLoaded"
    />
  </div>
</template>

<script>
  import VuePdfjsWrapper from 'vue-pdfjs-wrapper'

  export default {
    components: { VuePdfjsWrapper },
    data() {
      return {
        src: 'http://url/to/file.pdf',
        scale: 1.5,
        isRenderText: true
      }
    },
    methods: {
      onDocumentLoaded () {
        // Do stuff after document loads
      }
    }
  }
</script>
You might also like...
A PDFMake Plugin for Vue 3.x

Vue PDFMake A PDFMake plugin for 3.x Install yarn add vue3-pdfmake OR npm install vue3-pdfmake in main.(js|ts) import { createApp } from 'vue'; import

A small electron based pdf reader to test out the capabilities of Vue.js, Electron and PDF.js.
A small electron based pdf reader to test out the capabilities of Vue.js, Electron and PDF.js.

A small electron based pdf reader to test out the capabilities of Vue.js, Electron and PDF.js.

PDF Reader for Vue 3 using Mozilla's PDF.js

PDF Reader for Vue 3 using Mozilla's PDF.js

A simple pdf viewer based on mozilla's PDF.js

A simple pdf viewer based on mozilla's PDF.js

💫 Awesome module to generate PDF files and manage PDF inyour Nuxt application.

Generate PDF files directly from your content on your website, can be used for offline downloadable documentation pages.

A Vue.js wrapper component for PDF.js

vue-pdfjs-wrapper A simple Vue.js wrapper component for PDF.js. Note This component installs and uses pdfjs-dist, and loads its worker using the worke

PDF embed component for Vue 2 and Vue 3

This package is compatible with both Vue 2 and Vue 3, but is delievered in separate builds. Use dist/vue2-pdf-embed.js for Vue 2 and dist/vue3-pdf-embed.js for Vue 3. The default export of the package is for Vue 3.

PDF viewer component for Vue 2 and Vue 3

📄 pdf-viewer-vue PDF viewer component for Vue 2 and Vue 3 Compatibility This package is compatible with both Vue 2 and Vue 3. The default exported bu

Vue Pdf Renderer is a component that allows you to render PDFs from file uploads in most modern browsers

Vue Pdf Renderer is a component that allows you to render PDFs from file uploads in most modern browsers

vue.js pdf viewer

vue-pdf vue.js pdf viewer Install npm install --save vue-pdf Example - basic template pdf src="./static/relativity.pdf"/pdf /template scri

Export charts created by vue-chartjs to PDF files
Export charts created by vue-chartjs to PDF files

vue-chartjs-exporter Export charts created by vue-chartjs to PDF files. Demo here. Read the Requirements section below before proceeding, because it c

Vue.js pdf viewer

Vue.js pdf viewer

Vue - HTML - Puppeteer PDF rendering service

Vue - HTML - Puppeteer PDF rendering service

Annotation layer for pdf.js in vue

Annotation layer for pdf.js in vue

📄 Display your resume by web. 可以被打印成 PDF 的 Web 简历。

Web-Resume Vite + Vue3 + sass + iconify + YAML + Chrome Feature 在 Web 端显示你的简历 可以被打印成 A4 PDF 通过 yml 配置你的简历内容 理论上可以任意换肤,但是抱歉目前还只有这一种 hhh 在线解析 yaml 验证,提供

A simple and free tool to create timelines. Using JSON files and export it to PDF.
A simple and free tool to create timelines. Using JSON files and export it to PDF.

Timeline Maker A simple tool to make timelines and export them as JSON or PDF. Click here to try it! Project setup npm install Compiles and hot-reloa

☀️ Free [Tencent cloud OSS] for map bed, PDF files and other attachment management

Tauri is not finished yet, you can use the Web side map bed, I will release the Tauri version later Live Demo English | 简体中文 Features ☀️ Free [Tencent

Convert HTML DOM Element to PDF

Convert HTML DOM Element to PDF. You can save a specified element as PDF File, print it directly, or preview as PDF.

it`s a pdf viewer base on pdfjs

it`s a pdf viewer base on pdfjs

Owner
Niv Guler
A JavaScript TypeScript developer.
Niv Guler
A simple pdf viewer based on mozilla's PDF.js

A simple pdf viewer based on mozilla's PDF.js

Caligares Miguel Augusto 0 Mar 4, 2021
A Vue.js wrapper component for PDF.js

vue-pdfjs-wrapper A simple Vue.js wrapper component for PDF.js. Note This component installs and uses pdfjs-dist, and loads its worker using the worke

Niv Guler 1 Mar 6, 2022
PDF embed component for Vue 2 and Vue 3

This package is compatible with both Vue 2 and Vue 3, but is delievered in separate builds. Use dist/vue2-pdf-embed.js for Vue 2 and dist/vue3-pdf-embed.js for Vue 3. The default export of the package is for Vue 3.

Aliaksei Hrynko 129 Oct 1, 2022
PDF viewer component for Vue 2 and Vue 3

?? pdf-viewer-vue PDF viewer component for Vue 2 and Vue 3 Compatibility This package is compatible with both Vue 2 and Vue 3. The default exported bu

null 5 Apr 4, 2022
Vue Pdf Renderer is a component that allows you to render PDFs from file uploads in most modern browsers

Vue Pdf Renderer is a component that allows you to render PDFs from file uploads in most modern browsers

Eddie A. Rodriguez 0 Jan 28, 2020
vue.js pdf viewer

vue-pdf vue.js pdf viewer Install npm install --save vue-pdf Example - basic <template> <pdf src="./static/relativity.pdf"></pdf> </template> <scri

Franck Freiburger 1.9k Sep 27, 2022
Vue -> HTML -> Puppeteer PDF rendering service

Vue -> HTML -> Puppeteer PDF rendering service

MOLGENIS - open source solutions for scientific data 1 Jul 23, 2021
Annotation layer for pdf.js in vue

Annotation layer for pdf.js in vue

null 1 Jan 26, 2021
it`s a pdf viewer base on pdfjs

it`s a pdf viewer base on pdfjs

Yang Wangwang 2 Nov 1, 2019
Export/Download Vue3 using html2pdf.js. Easy to custom any pdf style because it is exported from real HTML.

Export/Download Vue3 using html2pdf.js. Easy to custom any pdf style because it is exported from real HTML.

Sango Technologies Inc 5 Aug 26, 2022