Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@gabrielbu/vue-pdf-viewer

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gabrielbu/vue-pdf-viewer

Vue viewer component built on top of pdfjs

  • 0.1.19
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
increased by400%
Maintainers
1
Weekly downloads
 
Created
Source

@gabrielbu/vue-pdf-viewer

Vue PDF viewer components implemented using PDFJS.

Install

npm install --save @gabrielbu/vue-pdf-viewer

Usage in vue

<template>
  <div id="app" style="height:100vh;width:100vw; position:fixed;">
    <PDFView :src.sync="src" ref="pdfView" fileName="order" :scale.sync="scale">
      <template slot="right-toolbox"></template>
      <!-- Add more buttons/features on the right side of the toolbar -->
      <template slot="left-toolbox"></template>
      <!-- Add more buttons/features on the left side of the toolbar -->
      <template slot="error"></template>
      <!-- Change the error message design -->
      <template slot="loading"></template>
    </PDFView>
  </div>
</template>
<script>
import {PDFView} from '@gabrielbu/vue-pdf-viewer';
export default {
  components:{
  // ...
    PDFView
  },
  data(){
    return {
      scale: "1.25"
    }
  }
}
</script>

API

Props

:src String / Object - default: null

src accepts the following values:

  • URL - example: https://example.com/pdf-content.pdf

  • PDF Uint8Array Buffer

  • PDFDataRangeTransport

  • DocumentInitParameters

  • Base64 encoded PDF buffer

  • Base64 string - data:application/pdf;base64, ....

  • You can also drag/drop pdf files into the viewer utilizing my own vue-dropzone directive!

for more details see PDFJS.getDocument().

:toolbarVisible Boolean - default: true

Toggle toolbar visibility.

:downloadFeatureVisible Boolean - default: true

Toggle download button feature visibility.

:sidebarFeatureVisible Boolean - default: true

Toggle sidebar (page navigation bar) visibility.

:dropzoneFeatureVisible Boolean - default: true

Enable/disable the dropzone(drag-n-drop PDF files) feature.

:scale String - default: "1.25"

Set the initial scale of the viewer. You can use it with :scale.sync for enabling two-way data binding.

:fileName String - default: "{Date.now()}.pdf"

Name of the file used when download function is triggered.

Keywords

FAQs

Package last updated on 18 Apr 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc