标签:webp lin ref ctr man 实现 errors context dex
1,
下载:https://github.com/gerhardberger/electron-pdf-window
存到目录下,如d:\dev
2,用electron执行nodejs文件
electron.exe index.js
index.js
const { app, BrowserWindow, Menu } = require("electron"); process.env.NODE_TLS_REJECT_UNAUTHORIZED = ‘0‘; process.on(‘uncaughtException‘, (err) => { console.error(`Unhandled Error: err=${err}, stack = ${err.stack}`); }); app.commandLine.appendSwitch(‘ignore-certificate-errors‘); app.on(‘ready‘, () => { console.info(`${__dirname}`); let win = new BrowserWindow({ webPreferences: { nodeIntegration: true, // preload: __dirname + "/renderer/app.js", contextIsolation: true, webSecurity: false } }); win.loadURL("file:///D:/dev/electron-pdf-window/pdfjs/web/viewer.html?file=http%3A%2F%2Fwww.wuhan.gov.cn%2Fzwgk%2Fszfgz%2F202004%2FP020200408575137783412.pdf"); //win.webContents.openDevTools(); }); // Menu.setApplicationMenu(Menu.buildFromTemplate(devMenu.getTemplate())); app.on(‘window-all-closed‘, () => { app.quit() });
标签:webp lin ref ctr man 实现 errors context dex
原文地址:https://www.cnblogs.com/bigben0123/p/13954350.html