Comments (8)
什么错?
from electron-print-demo.
./sections/print/printFour.html 这个文件不存在啊
from electron-print-demo.
mac系统, 我这边是 打开了页面,但是点击webcontent没有效果
from electron-print-demo.
windows, 系统正常启动但是点击webcontent或者webview没有反应
from electron-print-demo.
print1.js
ipcRenderer.on('print-edit', (event, deviceName)=>{}) 这个事件好像没有触发
from electron-print-demo.
windows, 系统正常启动但是点击webcontent或者webview没有反应
请问,你最后 解决了吗?
from electron-print-demo.
windows, 系统正常启动但是点击webcontent或者webview没有反应
请问,你最后 解决了吗?
同问
from electron-print-demo.
以上几位点击按钮没反应的兄弟们,我找到问题原因了。是源码还有几处地方需要做修改。
renderer-process/print/index.js
文件第8行ipcRenderer.send('print-start', 'GT800')
,这里的GT800
是打印机名称,要更换为你电脑所连接的打印机的名称(查看打印机名称的方法见下文),或者更改为空字符串,表示调用系统的默认打印机。同理,该文件中第15行、第27行处的GT800
也要做对应修改。sections/print/print1.html
文件第33行,require('./index.js');
改为require('./print1.js');
index.html
文件第22行,src="./sections/print/printFour.html"
改为src="./sections/print/print2.html"
这样就可以正常打印了。
附,查看打印机名称的方法:
main.js
文件第60行处,加入下面代码,就可以在项目启动的时候看到电脑所连接的所有打印机信息。name
属性就是需要的打印机名称。
console.log('printers', demoWindow.webContents.getPrinters());
详细代码见 #2
from electron-print-demo.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from electron-print-demo.