Skip to content

Dimonka2/electron-pdf-viewer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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();

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 94.2%
  • CSS 4.2%
  • HTML 1.6%