
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
pdfjs-viewer-element
Advanced tools
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
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).
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>
<pdfjs-viewer-element src="/file.pdf" viewer-path="/path-to-viewer"></pdfjs-viewer-element>
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.
MIT.
FAQs
Custom element that embeds [PDF.js default viewer](https://mozilla.github.io/pdf.js/web/viewer.html) using the `iframe`.
The npm package pdfjs-viewer-element receives a total of 1,220 weekly downloads. As such, pdfjs-viewer-element popularity was classified as popular.
We found that pdfjs-viewer-element demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.