Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'silent: true' for printing not working in version 5. #18123

Closed
MichaelW-Dev opened this issue May 2, 2019 · 33 comments · Fixed by #18979
Closed

'silent: true' for printing not working in version 5. #18123

MichaelW-Dev opened this issue May 2, 2019 · 33 comments · Fixed by #18979
Assignees
Labels
5-0-x bug 🪲 platform/all status/confirmed A maintainer reproduced the bug or agreed with the feature
Projects

Comments

@MichaelW-Dev
Copy link

Hey there

I have upgraded an app to version 5 as in the list of fixes was the silent printing bug, but the issue is still the same.

My code:
printWindow.webContents.print({silent: true});

Results in nothing happening at all. No errors thrown or anything. Changing it back to false, brings up the window to select the printer and then it prints perfectly fine. It's just the silent mode that doesn't work.

I am running this on Windows 10, with Node version 10.15.3. I can not try with a different OS as the printer only has drivers for Windows.

Many thanks,
Michael

@sofianguy sofianguy added this to Unsorted Issues in 5.0.x May 7, 2019
@sofianguy sofianguy added the 5-0-x label May 7, 2019
@Naowut
Copy link

Naowut commented May 14, 2019

Same problem on Ubuntu with Electron 5.0.1
I would really like to see this issue fixed.

@flaticols
Copy link

Same on macOS Mojave

@gclooi
Copy link

gclooi commented May 19, 2019

Hi, I discover something interesting with this bug. I am running electron with window 10.

printWindow.webContents.print({ silent: false, printBackground: false}); -> Print Dialog Appeared

printWindow.webContents.print({ silent: false, printBackground: false, deviceName: 'PRINTER_NAME'}); -> Print Dialog NOT Appear

printWindow.webContents.print({ silent: true, printBackground: false}); ->Print Dialog NOT Appear & No Print Activity

printWindow.webContents.print({ silent: true, printBackground: false, deviceName: 'PRINTER_NAME'}); -> Print Dialog NOT Appear & No Print Activity

@sofianguy, is this issue possible relate to the "deviceName" that is not correct?

Thanks for help and hope this issue can be fix soon.

@StvBB8
Copy link

StvBB8 commented May 23, 2019

I struggled with this issue for hours before realising it might be Electron, not me. I've noticed the same behaviour. Downgraded to 4.*, still an issue. Upgraded to 6 beta, still an issue. After some more testing I've noticed the same as @gclooi , I can only get any print activity when !silent and deviceName is not specified. (Tried on Mojave and Win10)

@hiteshambaliya
Copy link

I have also tested yesterday, exactly as @gclooi written test cases, and same result.
My system Linux Debian (buster).
I was using electron 4.0.1 then upgraded to 4.2.2 but no result then upgraded to 5.0.0 & 5.0.1 but no success found.
Is there any way to do it.

@StvBB8
Copy link

StvBB8 commented May 24, 2019

@hiteshambaliya The only way I've found it to work for now is downgrading to Electron 3.

@hiteshambaliya
Copy link

hiteshambaliya commented May 24, 2019

Ok thank you @StvBB8 . I will check it today and reply here whats happen on Linux Debian buster.

@cxyao
Copy link

cxyao commented May 24, 2019

I have the same problem. I tested under electron 4.2.2 and electron 5.0.2. Only work for electron3, but under electron3, svg doesn't print correctly

@nornagon
Copy link
Member

We would love some help in this area. None of the core Electron maintainers have significant experience with printing. If you're interested in tackling this bug (and/or any of the related printing issues), your help would be very welcome. I'd be happy to help you get set up with a development environment (start here).

@popod
Copy link
Contributor

popod commented May 24, 2019

I've no skills for this.. sorry. But it seems that @brenca had some experiences with printing ?! He begin some works under the brenca/printing-fixes branch in the electron/electron repo.

@hiteshambaliya
Copy link

Cheers...
I have downgraded to Electron V3.1.10, and now its print() function working fine, if we set printer name in argument to print function then that printer get selected by default.

Thank a lot all.

@codebytere codebytere added platform/all status/confirmed A maintainer reproduced the bug or agreed with the feature bug 🪲 labels Jun 19, 2019
@codebytere codebytere self-assigned this Jun 19, 2019
@popod
Copy link
Contributor

popod commented Jun 25, 2019

@codebytere For informations, it seems that @brenca had done some works to fix this issue in brenca/printing-fixes commit b9dcdcd.

@codebytere
Copy link
Member

@popod ah ok, it looks like that's been stalled so i can try to see where it's at or pick it up from him! thanks for the bump :)

@sofianguy sofianguy moved this from Unsorted Issues to Fixed for Next Release in 5.0.x Jul 2, 2019
@agomezb
Copy link

agomezb commented Jul 7, 2019

hi, wich release will include this fix?

@popod
Copy link
Contributor

popod commented Jul 7, 2019

@agomezb The backport which fix the "silent printing" issue is here #19038. Follow this PR to get notified when it will be merged into 5.x.x.

@EmadFani
Copy link

waiting for new here same problem

@misbeliever
Copy link

Still not working on 6.0.0-beta.13 where this PR is merged

@sofianguy sofianguy moved this from Fixed for Next Release to Fixed in 5.0.7 in 5.0.x Jul 16, 2019
@silibdev
Copy link

I tried 6.0.0-beta.13 and it's still not working for me too.

Actually, the callback it's called with true but the print doesn't start

@codebytere
Copy link
Member

codebytere commented Jul 17, 2019

What platform? This is working for me on v6.0.0-beta.13 and v5.0.7 on macOS as tested by https://github.com/popod/electron-quick-start/tree/print-bug-1

@vgribdev
Copy link

vgribdev commented Jul 17, 2019

the silent printing works well for me in v6.0.0-beta, but it doesn't work if deviceName is provided

@misbeliever
Copy link

misbeliever commented Jul 18, 2019

@vgribdev I found the same, that if deviceName is specified it will not work and callback never called, without deviceName it works and pints on the default device

@maikonmatheus
Copy link

Tested v5.0.7 on Windows 10 and callback is never called with deviceName and, if I remove the deviceName the callback is called, but nothing is sent to the printer...

@silibdev
Copy link

@codebytere
I tested v6.0.0-beta.13 and v5.0.7 on Linux Mint 19.1: on both the callback is called with true but nothing is sent to the printer, either I pass deviceName or not.
I'll test with the repo you linked and I'll give you updates

@ibalaji777
Copy link

the silent printing works well for me in v6.0.0-beta, but it doesn't work if deviceName is provided
same problem here, i downgraded 3.1.10,it works well.

@maikonmatheus
Copy link

the silent printing works well for me in v6.0.0-beta, but it doesn't work if deviceName is provided
same problem here, i downgraded 3.1.10,it works well.

No need to downgrade. Update to 8.2.0. It's working now.

@ibalaji777
Copy link

ibalaji777 commented May 29, 2021

the silent printing works well for me in v6.0.0-beta, but it doesn't work if deviceName is provided
same problem here, i downgraded 3.1.10,it works well.

No need to downgrade. Update to 8.2.0. It's working now.

i will check,guys don't use 3.1.10 i tested printer missing lot of content while print huge bug there.

@ibalaji777
Copy link

ibalaji777 commented May 29, 2021

What platform? This is working for me on v6.0.0-beta.13 and v5.0.7 on macOS as tested by https://github.com/popod/electron-quick-start/tree/print-bug-1

still not working with deviceName

These versions v6.0.0-beta.13 and v5.0.7 not responding with deviceName.

@CoWayger
Copy link

Electron 13.1.9 also bugged. Prints ok when silent: false, no success with silent: true. Any workaround or fix?

@elAgala
Copy link

elAgala commented Aug 17, 2021

Electron 13.1.9 also bugged. Prints ok when silent: false, no success with silent: true. Any workaround or fix?

Exactly the same here using Pop_OS! 21.04

@LucasHang
Copy link

Got silent: true working at Electron 13.2.1 with printBackground: false, although deviceName doesn't work and the default printer gets selected.

@i5o
Copy link

i5o commented Aug 23, 2021

No luck on 13.1.6,

{
  silent: true,
  printBackground: false
 }

@ufocruz
Copy link

ufocruz commented Dec 17, 2021

I make it work in linux putting the pageSize implicit.
The size values needs to be in micron.

This example is for a label of 5cm x 9,6cm:

var options = { silent: true, margins: { marginType: 'none' }, deviceName: impressora, pageSize: { height: 50000, width: 96000 } };

@EcotechBrad
Copy link

"electron": "^13.0.0",

print({
silent:true,
margins: { marginType: 'none' },
pageSize: { height: 60000, width: 40000 },
dpi:200,copies:1,landscape:false,color:false,
},
printer receives a command when printing silent, but nothing is actually printed, setting device doesn't change behavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5-0-x bug 🪲 platform/all status/confirmed A maintainer reproduced the bug or agreed with the feature
Projects
No open projects
5.0.x
Fixed in 5.0.7
Development

Successfully merging a pull request may close this issue.