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

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

A custom element, based on [PDF.js default viewer](https://mozilla.github.io/pdf.js/web/viewer.html). Supported in all [major browsers](https://caniuse.com/custom-elementsv1) and works with most [JS frameworks](https://custom-elements-everywhere.com/). Se

  • 2.3.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
821
increased by12.01%
Maintainers
1
Weekly downloads
 
Created
Source

pdfjs-viewer-element

A custom element, based on PDF.js default viewer. Supported in all major browsers and works with most JS frameworks. See examples of usage in the different frameworks.

⚠️ pdfjs-viewer-element requires 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).

Status

npm version Package Quality Published on webcomponents.org

Docs

Getting started

Api

Live examples

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 - PDF file URL, should refer to the same origin

viewer-path - Path to PDF.js prebuilt

locale - Specifies which language to use in the viewer UI. For a list of the available locales, see all l10n files

text-layer - Text layer, that is used for text selection

page - Page number

search - Search text

phrase - Search by phrase

zoom - Zoom level

pagemode - Page mode

For more clarity, see the Api docs page.

License

MIT.

Keywords

FAQs

Package last updated on 08 Sep 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