Git Product home page Git Product logo

Comments (8)

ConardLi avatar ConardLi commented on July 19, 2024

什么错?

from electron-print-demo.

nikolamakin avatar nikolamakin commented on July 19, 2024

./sections/print/printFour.html 这个文件不存在啊

from electron-print-demo.

carpcai avatar carpcai commented on July 19, 2024

mac系统, 我这边是 打开了页面,但是点击webcontent没有效果

from electron-print-demo.

liubrook avatar liubrook commented on July 19, 2024

windows, 系统正常启动但是点击webcontent或者webview没有反应

from electron-print-demo.

Samuel-world avatar Samuel-world commented on July 19, 2024

print1.js
ipcRenderer.on('print-edit', (event, deviceName)=>{}) 这个事件好像没有触发

from electron-print-demo.

ylhlisa avatar ylhlisa commented on July 19, 2024

windows, 系统正常启动但是点击webcontent或者webview没有反应

请问,你最后 解决了吗?

from electron-print-demo.

rocky-191 avatar rocky-191 commented on July 19, 2024

windows, 系统正常启动但是点击webcontent或者webview没有反应

请问,你最后 解决了吗?

同问

from electron-print-demo.

hpyer avatar hpyer commented on July 19, 2024

以上几位点击按钮没反应的兄弟们,我找到问题原因了。是源码还有几处地方需要做修改。

  1. renderer-process/print/index.js文件第8行ipcRenderer.send('print-start', 'GT800'),这里的GT800是打印机名称,要更换为你电脑所连接的打印机的名称(查看打印机名称的方法见下文),或者更改为空字符串,表示调用系统的默认打印机。同理,该文件中第15行、第27行处的GT800也要做对应修改。
  2. sections/print/print1.html文件第33行,require('./index.js');改为require('./print1.js');
  3. 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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.