Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
electron-pdf-window-s
Advanced tools
View pdf in new browser windows.
Use npm or yarn:
# Use npm
npm install electron-pdf-window-s -D
# Use yarn
yarn add electron-pdf-window-s -D
A simple example:
const { app } = require('electron')
// Use defualt export so you could get intelligent completion
const PDFWindow = require('electron-pdf-window-s').default
app.on('ready', () => {
const win = new PDFWindow({
width: 800,
height: 600
})
win.loadURL('http://mozilla.github.io/pdf.js/web/compressed.tracemonkey-pldi-09.pdf')
})
You will see pdf window is show.
new PDFWindow(options)
Create a pdf window instance. The option is same as BrowserWindow's option.
Then, you could use loadURL()
to load a PDF file or url.
PDFWindow.viewerPath
Static property, specifies path for the pdfjs viewer.
Default is path.join(__dirname, '../viewer/web/viewer.html')
PDFWindow.addSupport(browserWindow)
Static method, enable normal BrowserWindow to support loading pdf by loadURL()
.
Special thanks to @gerhardberger. This project is based on his electron-pdf-window. But unfortunately, that library no longer seems to be maintained. So I froked it and created new one.
will-navigate
and new-window
events anymore.At least >=8.0.0
version.
Website: http://mozilla.github.io/pdf.js/
Version: Stable(v2.10.377)
Options wiki: Viewer options · mozilla/pdf.js Wiki
Changes in this library:
validateFileURL()
function in viewer.js
).Now is unknow
We have modify some codes to support signature feature. But we didn't do that in the latest version.
2.0.1 - 2021-11-28
FAQs
View pdf in new browser windows.
We found that electron-pdf-window-s demonstrated a not healthy version release cadence and project activity because the last version was released 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
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.