opening pdf files in electron

橙三吉。 提交于 2019-12-02 00:45:20

If you're OK with UI provided by chrome PDF extension you can use it from electron.

See this question

const {app, BrowserWindow} = require('electron')

app.once('ready', () => {
  let win = new BrowserWindow({
    webPreferences: {
      plugins: true
    }
  })
  win.loadURL(__dirname + '/test.pdf')
})

Note, that electron's native PDF support is available only since version 1.6.4. Before that you can use electron-pdf-window

You should checkout gerhardberger's electron-pdf-window

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!