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

electron-pdf-viewer

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

electron-pdf-viewer

use pdf.js preview pdf file in electron

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Electron pdf viewer

A node module for view pdf file in electron applications. Improve from origin project elpdf

screenshot

##Introduction electron-pdf-viewer module use pdf.js library from Mozilla.

When you create a new pdfview object, You get a BrowserWindow instance back from the call.

##Install

npm install electron-pdf-viewer --save

Usage

Used with pdf.js in render process in electron.

var pdfview = require('electron-pdf-viewer');

//set pdf path
var pdfurl ='https://www.canon.com.cn/products/printer/pixma-fax/images/speedtest.pdf';  
// you can get full URL to display PDF by using getPdfHtmlURL() function
const displayPdfUrl = pdfview.getPdfHtmlURL(pdfurl);
const options = {
width: 800,
height: 600,
webPreferences: {
	nodeIntegration: false,
contextIsolation: true
  }
}
// If you dont provive options, default options will be use
var win = pdfview.showpdf(pdfurl, options);
win.show();

Keywords

FAQs

Package last updated on 09 Oct 2020

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