zoukankan      html  css  js  c++  java
  • 利用electron实现pdf转html pdf2html

    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()
    });
  • 相关阅读:
    MSDN相关下载地址
    显示代码的博客
    unittest 结合 ddt
    python 学习2 测试报告
    python pytest
    Yaml 的python 应用
    linux 面试题
    面试 常见问题
    Python 内建的filter()函数用于过滤序列。
    python reduce & map 习题
  • 原文地址:https://www.cnblogs.com/bigben0123/p/13954350.html
Copyright © 2011-2022 走看看