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

pdf-vue3

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pdf-vue3

vue3 pdf viewer

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.3K
increased by21.94%
Maintainers
1
Weekly downloads
 
Created
Source

pdf-vue3

English中文

vue3 pdf viewer

example: https://hymhub.github.io/pdf-vue3/

Install

  npm i pdf-vue3

Usage

<script setup>
import PDF from "pdf-vue3";
</script>

<template>
  <PDF src="/demo.pdf" />
  <!-- <PDF :src="BASE64" /> -->
  <!-- <PDF :src="Uint8Array" /> -->
</template>

Config API

Props

AttributeDescriptionType
srcThe URL or binary data(Uint8Array) or BASE64-encoded of the PDF.string | Uint8Array | BASE64
showProgressWhether to download the progress bar. The default value is true.boolean
progressColorDownload progress bar color. The default value is #87ceeb.string
showPageTooltipWhether to show page tooltips. The default value is true.boolean
showBackToTopBtnWhether to show back to the top button. The default value is true.boolean
scrollThresholdScrolling distance over how much to display the back to top button. The default value is 300.number
pdfWidthpdf page width. The default value is 100%.string
rowGapLine spacing between pdf pages. The default value is 8.number
httpHeadersBasic authentication headers.object
withCredentialsIndicates whether or not cross-site Access-Control requests should be made using credentials such as cookies or authorization headers. The default is false.boolean
passwordFor decrypting password-protected PDFs.string
useSystemFontsWhen true, fonts that aren't embedded in the PDF document will fallback to a system font. The default value is true in web environments and false in Node.js; unless disableFontFace === true in which case this defaults to false regardless of the environment (to prevent completely broken fonts).boolean
stopAtErrorsReject certain promises, e.g. getOperatorList, getTextContent, and RenderTask, when the associated PDF data cannot be successfully parsed, instead of attempting to recover whatever possible of the data. The default value is false.boolean
disableFontFaceBy default fonts are converted to OpenType fonts and loaded via the Font Loading API or @font-face rules. If disabled, fonts will be rendered using a built-in font renderer that constructs the glyphs with primitive path commands. The default value is false in web environments and true in Node.js.boolean
disableRangeDisable range request loading of PDF files. When enabled, and if the server supports partial content requests, then the PDF will be fetched in chunks. The default value is false.boolean
disableStreamDisable streaming of PDF file data. By default PDF.js attempts to load PDF files in chunks. The default value is false.boolean
disableAutoFetchDisable pre-fetching of PDF file data. When range requests are enabled PDF.js will automatically keep fetching more data even if it isn't needed to display the current page. The default value is false. NOTE: It is also necessary to disable streaming, see above, in order for disabling of pre-fetching to work correctly.boolean

Events

Event NameDescriptionParameters
onProgresslisten to the pdf download progress, the parameters for 0-100.loadRatio: number
onCompletepdf download complete.-
onScrollListen to the pdf scrolling, the parameter is the current scrollTop value.scrollOffset: number

Slots

Slot NameDescriptionParameters
progressCustomized progress barloadRatio: number
pageTooltipCustomized page tooltipscurrentPage: number, totalPages: number
backToTopBtnCustomize the Back to Top buttonscrollOffset: number

Keywords

FAQs

Package last updated on 22 Jun 2023

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