小编Har*_*abu的帖子

电子PDF查看器

我有一个从PHP服务器加载URL的Electron应用程序.该页面包含一个具有PDF源代码的iFrame.在普通的网络浏览器中,PDF页面似乎绝对正常,但要求在Electron中下载.有帮助吗?

我的html页面代码是

<h1>Hello World!</h1>
Some html content here...
<iframe src="http://mozilla.github.io/pdf.js/web/compressed.tracemonkey-pldi-09.pdf" width="1200" height="800"></iframe>
Run Code Online (Sandbox Code Playgroud)

我的js代码是这样的

mainWindow = new BrowserWindow({width: 800, height: 600})
mainWindow.loadURL(url.format({
pathname: path.join(__dirname, 'index.html'),
protocol: 'file:',
slashes: true
}))

app.on('ready', createWindow)
Run Code Online (Sandbox Code Playgroud)

任何帮助都会非常棒......

pdf node.js electron

12
推荐指数
2
解决办法
2万
查看次数

标签 统计

electron ×1

node.js ×1

pdf ×1