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

duyansoft-pdfjs-dist

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

duyansoft-pdfjs-dist

mirror of pdfjs-dist, bundled and exposed as ES module

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
27
increased by125%
Maintainers
1
Weekly downloads
 
Created
Source

pdfjs-dist

This is a mirror of pdfjs-dist, bundled and exposed as an ES module

Install

npm install duyansoft-pdfjs-dist

Use

import pdfjs from "duyansoft-pdfjs-dist/build/pdf";
import viewer from "duyansoft-pdfjs-dist/web/pdf_viewer";

pdfjs.GlobalWorkerOptions.workerSrc =
  "duyansoft-pdfjs-dist/pdf.worker.js";

var url = "basicapi.pdf";
var loadingTask = pdfjs.getDocument(url);
//...

Important: Unlike in the original build, the pdfjs.GlobalWorkerOptions.workerSrc is mandatory. We recommend supplying the worker via CDN.

Overview

Structure

├── build/
│   ├── pdf.js                    - display layer
│   └── pdf.worker.js             - core layer
└── web/
    ├── pdf_viewer.js             - top-level viewer import, containing all necessary setup
    ├── module.js                 - pdf-viewer module, transformed from UMD to ESM
    └── util.js                   - utility module for setup

Background

PDFJS is a library by Mozilla, created to facillitate client-side rendering of PDF documents.

Currently, the primary build for this project is provided as UMD-style modules at pdfjs/pdfjs-dist.

Support for es modules in the main project has been requested here (#10317)

Building

# https://github.com/FredKSchott/rollup-plugin-polyfill-node/issues/61
npm i --legacy-peer-deps
npm run build

FAQs

Package last updated on 22 Nov 2022

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