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 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. You may specify the path to this directory with viewer-path property (/pdfjs by default).

Install

npm install --save pdfjs-viewer-element
yarn add pdfjs-viewer-element

or

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

Usage

Place PDF.js prebuilt files to some directory of your project (pdfjs used as the standard name). See demo example. You may call the directory as you want, but then you should specify the viewer-path property.

import 'pdfjs-viewer-element'
<pdfjs-viewer-element src="/compressed.tracemonkey-pldi-09.pdf" viewer-path="/path-to-viewer"></pdfjs-viewer-element>

Properties

src - path to pdf file.

viewer-path - path to prebuilt directory (/pdfjs by default).

locale - language localization (e.g. 'en', 'en-US', 'es', 'de'), see pdf.js i10n files (the language of your browser by default)

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 11 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