Socket
Socket
Sign inDemoInstall

vue_pdfjs_viewer

Package Overview
Dependencies
310
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vue_pdfjs_viewer

Vue viewer component built on top of pdfjs


Version published
Weekly downloads
35
increased by52.17%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

vue_pdfjs_viewer

Installation

npm install vue_pdfjs_viewer

Usage in vue


<template>
  <div id="app" style="height:593px">
    <PDFView
      :src.sync="src" // Valid PDF Source (read below for more info)
      ref="pdfView"
      fileName="order" // Name of the file that's going to be downloaded (default: {Date.now()}.pdf )
      :sidebarFeatureVisible="false" // Should the sidebar feature be visible ? (default: true)
      :downloadFeatureVisible="false" // Should the download button feature be active ? (default: true)
      :dropzoneFeatureVisible="false" // Should the pdf dropzone feature be active ? (default: true)
      :toolbarVisible="false" // Should the toolbar be visible ? (default: true)
      scale.sync="scale" // String value for the page scale ["0.75", "1", "1.25", "1.5", "auto"] are supported 
    > 
        <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> <!-- Change the pdf loader design -->
    </PDFView>
  </div>
</template>
<script>
import {PDFView} from 'vue_pdfjs_viewer';
export default {
  components:{
  // ...
    PDFView
  },
  data(){
    return {
      scale: "1.25"
    }
  }
}
</script>

Valid PDF source

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

  • PDF Uint8Array Buffer

  • PDFDataRangeTransport

  • DocumentInitParameters

  • Base64 encoded PDF buffer

  • data:application/pdf;base64, ....

  • You can also drag/drop pdf files into the viewer !

Keywords

FAQs

Last updated on 18 Apr 2022

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc