Socket
Socket
Sign inDemoInstall

pdfjs-viewer-element

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pdfjs-viewer-element

[![npm version](https://img.shields.io/npm/v/pdfjs-viewer-element?logo=npm&logoColor=fff)](https://www.npmjs.com/package/pdfjs-viewer-element) [![Package Quality](https://packagequality.com/shield/pdfjs-viewer-element.svg)](https://packagequality.com/#?pa


Version published
Weekly downloads
617
increased by10.57%
Maintainers
1
Weekly downloads
 
Created
Source

pdfjs-viewer-element

npm version Package Quality

A web component for viewing pdf files in the browser. The package is based on PDF.js default viewer build and works with any framework. See demo.

⚠️ pdfjs-viewer-element uses PDF.js prebuilt, that includes the generic build of PDF.js and the viewer. To use the package you should download and place the prebuilt files to some directory of your project. Then specify the path to this directory with viewer-path property (/pdfjs by default).

Install

Using module bundlers:

# With npm
npm install pdfjs-viewer-element
# With yarn
yarn add pdfjs-viewer-element
import 'pdfjs-viewer-element'

Using browser:

<script type="module" src="https://cdn.skypack.dev/pdfjs-viewer-element"></script>

Usage

<pdfjs-viewer-element src="/file.pdf" viewer-path="/path-to-viewer"></pdfjs-viewer-element>

Properties

src - Path to pdf file

viewer-path - Path to PDF.js prebuilt

locale - Language of the interface

page - Page number

search - Search text

phrase - Search by phrase

zoom - Zoom level

pagemode - Page mode

For more clarity, see the demo playground.

License

For this package - MIT.

For the pdf.js library - https://github.com/mozilla/pdf.js/blob/master/LICENSE.

Keywords

FAQs

Package last updated on 19 Mar 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