electron-print | Library to print from electron app | 3D Printing library
kandi X-RAY | electron-print Summary
kandi X-RAY | electron-print Summary
Library to print from electron app.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Prints text to the screen .
electron-print Key Features
electron-print Examples and Code Snippets
Community Discussions
Trending Discussions on electron-print
QUESTION
I'm working on a software project which I've created with Electron and React. I didn't create the project from scratch, I am using a boilerplate which uses Webpack.
The software is for managing (selling & redeeming) vouchers, so I also have to print some receipts. Using the printer over network is working fine, just as it should. For printing I'm using the node-thermal-printer
package (https://www.npmjs.com/package/node-thermal-printer).
But some of the printers don't have a network interface, just USB or Serial.
When using the node-thermal-printer
with a USB connected printer, you have to provide a "driver" to be able to print. They suggest either the electron-printer
or printer
module, which both seem to be native NodeJS modules.
The boilerplate seems to compile the native modules for the architecture that is currently used and creates a *.node
file, which is copied to the .wepback/
folder during the build phase. But as soon as I want to use the package, I get an error that the module could not be found.
I'm importing the module with the following line:
const printerDriver = require("printer");
When running npm start
the native dependencies are compiled and a node_printer.node
file is created and copied to .webpack/main/native_modules/lib/node_printer.node
.
As soon as I click the button for printing, I receive the following error:
...ANSWER
Answered 2022-Jan-04 at 15:33Instead of hardcoding the absolute path in the require you can just reconstruct it using a solution like:
QUESTION
I'm getting this error after I've updated the packages in my package JSON file.
ANSWER
Answered 2021-Oct-29 at 05:21As discussed in the comments you should update your webpack configuration to handle loading svg files. inside the module.rules
array you should add the following:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install electron-print
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page