electron icon indicating copy to clipboard operation
electron copied to clipboard

[Bug]: pageSize not work when silent print on windows 10

Open sunchanglong opened this issue 3 years ago • 43 comments

Preflight Checklist

Electron Version

16.0.0-beta.6

What operating system are you using?

Windows

Operating System Version

windows 10

What arch are you using?

x64

Last Known Working Electron version

none

Expected Behavior

pageSize works when silent print.

Actual Behavior

webContents.print({silent:true, pageSize: 'A5'}) pageSize not works when silent print. it always use printer default pageSize.

#29532 #29334 #31489

other print options has been fixed, except pageSize.

Testcase Gist URL

No response

Additional Information

No response

sunchanglong avatar Nov 04 '21 03:11 sunchanglong

header also doesn't work. See comment here

pushkin- avatar Nov 04 '21 13:11 pushkin-

Tested on both 15.x and 16.x. I cannot reproduce this. It works perfectly fine for me. I suggest providing a reproducible Gist.

m4heshd avatar Nov 18 '21 08:11 m4heshd

Test Gist: https://gist.github.com/sunchanglong/7c307aeb031e823ed8273ae44e861d45

My printer support both A4, A5 papers.

  • Print options pageSize: 'A5'
  • System printer default pageSize 'A4'
  • Expect print with A5 papers. Result in A4 print, don't honor electron print options pageSize.

Print task queue image

sunchanglong avatar Nov 19 '21 03:11 sunchanglong

I have test in chrome with a5 print using the same printer, it works.

sunchanglong avatar Nov 19 '21 03:11 sunchanglong

@sunchanglong I tried your Gist with Adobe PDF and the output dimensions are correct. Can you try the same or with Microsoft Print to PDF? It would narrow the issue down to physical device interfaces.

m4heshd avatar Nov 19 '21 19:11 m4heshd

@m4heshd I tried to print with Microsoft Print to PDF and the output dimensions are correct too. When print to physical device, Notice the system print task queue, the print properties is not same with specified in code.

sunchanglong avatar Nov 22 '21 03:11 sunchanglong

Ah. Then this definitely is an issue which needs to be addressed.

m4heshd avatar Nov 22 '21 07:11 m4heshd

Just tested this and can confirm. These settings are being completely ignored when printed to non-emulated devices. @codebytere, @nornagon can we get some assistance on this? Printing is such a vital task for a majority of Electron apps. I truly hope this can be addressed soon because since #31489 I've written thousands of lines of code around this whole functionality without the knowledge of this being an issue.

m4heshd avatar Nov 26 '21 11:11 m4heshd

Hello @codebytere , same issue on Linux. Also custom page sizes like "62X1" for pos printers for example are not supported.

ghost avatar Dec 16 '21 11:12 ghost

Any update on this issue? It's ~insanely difficult~ impossible to replace this functionality with third-party libraries.

m4heshd avatar Dec 30 '21 09:12 m4heshd

I think this is related to the print driver(all the ones with the red lines are affected). It doesn't seem like there is any way to workaround the issue currently. image

Hedwig188 avatar Dec 31 '21 19:12 Hedwig188

Hedwig188

Did you test this on chrome browser?Chrome seems works right.

sunchanglong avatar Jan 04 '22 02:01 sunchanglong

Hedwig188

Did you test this on chrome browser?Chrome seems works right.

Yes, I've also confirmed paper size is correctly being respected in Chrome when printing to those affected printers.

Hedwig188 avatar Jan 04 '22 03:01 Hedwig188

Kyocera FS-CS3500DN KX driver is also broken.

Hedwig188 avatar Jan 07 '22 15:01 Hedwig188

hello @codebytere, is there any timeline on this issue? thanks.

sunchanglong avatar Feb 08 '22 08:02 sunchanglong

#22066 #22014 #33190 #29532 All above are printing pageSize bugs. pageSize bug makes printing in electron nearly not work. @codebytere hopes this would be solved.

sunchanglong avatar Apr 19 '22 02:04 sunchanglong

Hello, Is it in the plan?

moom-en avatar Jul 08 '22 02:07 moom-en

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

github-actions[bot] avatar Nov 28 '22 02:11 github-actions[bot]

Is there a plan to fix this issue?

Hedwig188 avatar Nov 28 '22 03:11 Hedwig188

Is there a plan to fix this issue?

andredealmei avatar Dec 06 '22 13:12 andredealmei

It's not work in electron 22.0.0(windows 10)

moom-en avatar Dec 09 '22 05:12 moom-en

@codebytere, @ckerr, @nornagon can one of you please look into this issue? I don't get why this is being ignored for such a long period of time. This issue was there since forever and it's undeniably a most needed feature for desktop applications.

m4heshd avatar Dec 10 '22 03:12 m4heshd

Is there a plan to fix this issue?

Xavier9896 avatar Jan 07 '23 03:01 Xavier9896

Is there a plan to fix this issue?

mingyangzhu avatar Feb 23 '23 07:02 mingyangzhu

Bump

jhetuts avatar Apr 19 '23 13:04 jhetuts

image image image I have specified the paper size using parameters. But the parameter does not take effect on the printing device. I've noticed that this problem has persisted for a very long time. The print function is a common function. There are so many places where this functionality is needed, so it's very important to us. Hope to fix it soon

490465044 avatar May 15 '23 04:05 490465044

It is unbelievable that a problem lasted so long. Neither was fixed.

490465044 avatar May 15 '23 05:05 490465044

@codebytere, Yes, you're gonna get pinged constantly because you're assigned to this issue. So pinging you again, can we get this fixed because it works completely fine on Chromium. This is not a small issue. Electron apps are made for desktop and a lot of those desktop tasks require printing. How this issue gets ignored is beyond my imagination.

m4heshd avatar May 15 '23 16:05 m4heshd

It's hard to believe that this issue has not been fixed since version 8.x

moom-en avatar May 22 '23 08:05 moom-en

It's still a problem on some printers. Can't silent print perform the same set of paper sizes as non-silent print?

1339240789 avatar Jun 27 '23 09:06 1339240789