electron-pos-printer
electron-pos-printer copied to clipboard
[1092:0605/115531.410:ERROR:print_render_frame_helper.cc(2264)] Printing failed.
[1092:0605/115531.410:ERROR:print_render_frame_helper.cc(2264)] Printing failed. @Hubertformin could you please advice about this error
this error occured when print while silent is true and while it is false it prints correctly
Same error occurred on me when printing in silent.
I could print correctly when i change pageSize: '80mm' instead of width property but the the error still shows in the terminal
Ow really? What printer are you using? Mine shows error and not printing.
const options = { silent: true, preview: false, margin: '0 0 0 0', copies: 1, printerName: 'POS-80C', timeOutPerLine: 4000, pageSize: "80mm" // page size }
const data = [{
type: 'text', // 'text' | 'barCode' | 'qrCode' | 'image' | 'table
value: 'SAMPLE HEADING',
style: {fontWeight: "700", textAlign: 'center', fontSize: "24px"}
}]
PosPrinter.print(data, options).then(response => console.log(response)).catch(error => console.log(error))
this is my configuration,
And my error shows,
[23996:0620/204757.414:ERROR:print_render_frame_helper.cc(2302)] Printing failed. [TimedOutError] Make sure your printer is connected
When silent is equals to false, I can print with print dialog. Which is not the behavior I want to.
What version are you using by the way?
const options = { silent: true, preview: false, margin: '0 0 0 0', copies: 1, printerName: 'POS-80C', timeOutPerLine: 4000, pageSize: "80mm" // page size }
const data = [{ type: 'text', // 'text' | 'barCode' | 'qrCode' | 'image' | 'table value: 'SAMPLE HEADING', style: {fontWeight: "700", textAlign: 'center', fontSize: "24px"} }] PosPrinter.print(data, options).then(response => console.log(response)).catch(error => console.log(error)) this is my configuration,
And my error shows,
[23996:0620/204757.414:ERROR:print_render_frame_helper.cc(2302)] Printing failed. [TimedOutError] Make sure your printer is connected
try this code below
const { PosPrinter } = require("electron-pos-printer");
data = [
{
type: "text", // 'text' | 'barCode' | 'qrCode' | 'image' | 'table
value: "||---",
style: {textAlign:'left',fontSize:'12px',margin:'0'},
},
{
type: "text", // 'text' | 'barCode' | 'qrCode' | 'image' | 'table
value: "Test print
",
style: {textAlign:'center',fontWeight:'700',fontSize:'18px',margin:'0'},
},
{
type: "text", // 'text' | 'barCode' | 'qrCode' | 'image' | 'table
value: "My printer",
style: {textAlign:'center',fontWeight:'bold',fontSize:'14px',margin:'0'},
},
{
type: "text", // 'text' | 'barCode' | 'qrCode' | 'image' | 'table
value: "
"+ new Date(),
style: {textAlign:'center',fontWeight:'bold',fontSize:'14px',margin:'0'},
},
{
type: "text", // 'text' | 'barCode' | 'qrCode' | 'image' | 'table
value: "---||",
style: {textAlign:'right',fontSize:'12px',margin:'0'}
},
]
const options = {
preview: false, // Preview in window or print
pageSize: '80mm',// width of content body
margin: "0 0 0 0", // margin of content body
copies: 1, // Number of copies to print
printerName: printerName, // printerName: string, check it at webContent.getPrinters()
timeOutPerLine: 2000,
silent: true,
};
const d = [...data];
PosPrinter.print(d,options)
.then(() => {
console.log('printed successfully')
})
.catch((error) => {
console.error(error);
});
What version are you using by the way?
"electron-pos-printer": "^1.3.6"
const options = { silent: true, preview: false, margin: '0 0 0 0', copies: 1, printerName: 'POS-80C', timeOutPerLine: 4000, pageSize: "80mm" // page size }
const data = [{ type: 'text', // 'text' | 'barCode' | 'qrCode' | 'image' | 'table value: 'SAMPLE HEADING', style: {fontWeight: "700", textAlign: 'center', fontSize: "24px"} }] PosPrinter.print(data, options).then(response => console.log(response)).catch(error => console.log(error)) this is my configuration,
And my error shows,
[23996:0620/204757.414:ERROR:print_render_frame_helper.cc(2302)] Printing failed. [TimedOutError] Make sure your printer is connected
this might be printer issues, check whether you have installed the latest driver...or check that your printer is online
Ow really? What printer are you using? Mine shows error and not printing.
it can print any printer like thermal or normal A4 printer
[1092:0605/115531.410:ERROR:print_render_frame_helper.cc(2264)] Printing failed. even though i could print the error is still there....
Results of searching for information about ERROR:print_render_frame_helper.cc (2264) Judging by an error related to chromium embedded with electron
I downgraded my previous electron @25.2.0 to electron @22.2.0 and there is no problem. Try downgrading the electron version.
But i am using electron 21.0 not 25
Results of searching for information about ERROR:print_render_frame_helper.cc (2264) Judging by an error related to chromium embedded with electron
I downgraded my previous electron @25.2.0 to electron @22.2.0 and there is no problem. Try downgrading the electron version.
You mean this specific version of electron resolves the issue?
The corresponding error occurred in [email protected]
The error did not occur in the [email protected]
The [email protected] produces an error, but prints.
@thsckdghks13 Thank you, I had the exact same issue (printing not working when silent is true with the same error messages), and I managed to solve it by downgrading Electron to version 22.2 as you mentioned.