electron-pos-printer icon indicating copy to clipboard operation
electron-pos-printer copied to clipboard

[1092:0605/115531.410:ERROR:print_render_frame_helper.cc(2264)] Printing failed.

Open janafsal opened this issue 1 year ago • 17 comments

[1092:0605/115531.410:ERROR:print_render_frame_helper.cc(2264)] Printing failed. @Hubertformin could you please advice about this error

janafsal avatar Jun 05 '23 08:06 janafsal

this error occured when print while silent is true and while it is false it prints correctly

janafsal avatar Jun 16 '23 10:06 janafsal

Same error occurred on me when printing in silent.

Jerald042615 avatar Jun 20 '23 12:06 Jerald042615

I could print correctly when i change pageSize: '80mm' instead of width property but the the error still shows in the terminal

janafsal avatar Jun 20 '23 12:06 janafsal

Ow really? What printer are you using? Mine shows error and not printing.

Jerald042615 avatar Jun 20 '23 12:06 Jerald042615

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

Jerald042615 avatar Jun 20 '23 12:06 Jerald042615

When silent is equals to false, I can print with print dialog. Which is not the behavior I want to.

Jerald042615 avatar Jun 20 '23 12:06 Jerald042615

What version are you using by the way?

Jerald042615 avatar Jun 20 '23 12:06 Jerald042615

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);
   
    });

janafsal avatar Jun 20 '23 14:06 janafsal

What version are you using by the way?

"electron-pos-printer": "^1.3.6"

janafsal avatar Jun 20 '23 14:06 janafsal

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

janafsal avatar Jun 20 '23 14:06 janafsal

Ow really? What printer are you using? Mine shows error and not printing.

it can print any printer like thermal or normal A4 printer

janafsal avatar Jun 20 '23 14:06 janafsal

[1092:0605/115531.410:ERROR:print_render_frame_helper.cc(2264)] Printing failed. even though i could print the error is still there....

janafsal avatar Jun 20 '23 14:06 janafsal

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.

thsckdghks13 avatar Jun 29 '23 06:06 thsckdghks13

But i am using electron 21.0 not 25

janafsal avatar Jun 29 '23 10:06 janafsal

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?

Jerald042615 avatar Jun 29 '23 10:06 Jerald042615

2520

The corresponding error occurred in [email protected]

2220

The error did not occur in the [email protected]

210

The [email protected] produces an error, but prints.

thsckdghks13 avatar Jun 30 '23 00:06 thsckdghks13

@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.

helhablouj avatar Aug 05 '23 08:08 helhablouj