view PDF files in electron browser windows
Switch branches/tags
Nothing to show
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
pdfjs fix browser history in pdfjs Nov 12, 2016
test fixes url type checking Sep 19, 2017
.gitignore use deep extend for browserwindow props Oct 29, 2016 fixes renderer process usage Feb 14, 2017
index.js fixes url type checking Sep 19, 2017
license init Oct 25, 2016
package.json fixes url type checking Sep 19, 2017
screenshot.png adds screenshot Oct 25, 2016


view PDF files in electron browser windows. this module adds support for viewing PDF files in electron BrowserWindows. it works even if you navigate to a PDF file from a site, or opening a PDF file in a new window. a PDFWindow instance is just a subclass of BrowserWindow so it can be used just like it.

const { app } = require('electron')
const PDFWindow = require('electron-pdf-window')

app.on('ready', () => {
  const win = new PDFWindow({
    width: 800,
    height: 600



$ npm i electron-pdf-window


win = new PDFWindow([opts])

win is an electron BrowserWindow that has support for viewing PDF files.


adds PDF viewing support for win, which is a BrowserWindow instance.

using from the renderer process

Using the PDFWindow class directly from the renderer process is not recommended, because electron doesn't support proper extending of their built-in classes. In order to add PDF support from the renderer, use the addSupport method.

const { BrowserWindow } = require('electron').remote
const PDFWindow = require('electron-pdf-window')

const win = new BrowserWindow({ width: 800, height: 600 })




$ npm test