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 printing not working in combination with deviceName (in v5.0.7 +) #19474

Closed
3 tasks done
aldalaimi opened this issue Jul 26, 2019 · 11 comments · Fixed by #19598
Closed
3 tasks done

Silent printing not working in combination with deviceName (in v5.0.7 +) #19474

aldalaimi opened this issue Jul 26, 2019 · 11 comments · Fixed by #19598
Assignees

Comments

@aldalaimi
Copy link

aldalaimi commented Jul 26, 2019

Preflight Checklist

Issue Details

  • Electron Version:
    • 5.0.7 and 6.0.0-beta.15
  • Operating System:
    • MacOS Mojave v10.14.4
  • Last Known Working Electron version:
    • 3.1.11

Expected Behaviors

According to the pull request #19038 which was merged in v.5.0.7, silent printing should work.

# Code Expected Behavior
1 webContents.print() Opens the print preview
2 webContents.print({ silent: true }) Prints silently to default printer
3 webContents.print({ silent: true, printBackground: true }) Prints silently with background to default printer
4 webContents.print({ silent: true, deviceName: 'Canon_MF633C_635C' }) Prints silently to my Canon printer
5 webContents.print({ silent: true, deviceName: printBackground: true, deviceName: 'Canon_MF633C_635C' }) Prints silently with background to my Canon printer

Original documentation of WebContents.print() can be found here.

Actual Behaviors

# Actual Behavior
1 ✅ As expected
2 ✅ As expected
3 ✅ As expected
4 ❌ Nothing will happen, callback is never called
5 ❌ Nothing will happen, callback is never called

Unfortunately when providing a deviceName, nothing is send to the printer and the callback will never be called (see image of terminal logs below).

To Reproduce

  1. Clone this fork: https://github.com/ibra038/electron-quick-start
  2. Run yarn install and yarn start
  3. Follow the steps on your screen

Schermafbeelding 2019-07-26 om 12 26 15
Schermafbeelding 2019-07-26 om 13 19 08

Additional Information

For other developers that need to print silently to a predefined printer, the last known version I found to work is v3.1.11.

@codebytere codebytere self-assigned this Jul 27, 2019
@misbeliever
Copy link

yeah, struggling with this issue from v3.1.11

@sarathjasrin
Copy link

This issue is not fixed yet. V6.0.0

@codebytere
Copy link
Member

codebytere commented Jul 31, 2019

@sarathjasrin yes, i'm aware - if it had been fixed, this issue would be closed. I plan to work it on it very soon.

@codebytere
Copy link
Member

codebytere commented Aug 6, 2019

Hey folks, got a PR up targeting master that should ensure it's fixed in v7. I won't be able to port it in its current state back to v6 and v5 owing to some intermediary changes Chromium made but i'll do my best and should hopefully be able to get it fixed in those lines too.

@gozzoo
Copy link

gozzoo commented Aug 6, 2019

Thanks @codebytere, that's very good news. Unfortunately the release of v7 is 3 months away. Lets keep our fingers crossed that we can get some fixes in any of the stable releases sooner because v3 is already getting old in the tooth.

@gozzoo
Copy link

gozzoo commented Sep 3, 2019

Has this been backported to any of the stable releases yet, like v5 or v6?

@cstsortan
Copy link

Any news on fixes for cases 4 and 5 being shipped before v7?

@gozzoo
Copy link

gozzoo commented Oct 11, 2019

It's trange that this issue has been closed but the fix is not avalable in any stable release.

@sarathjasrin
Copy link

@gozzoo It will available from V7. she mentioned above.

Hey folks, got a PR up targeting master that should ensure it's fixed in v7. I won't be able to port it in its current state back to v6 and v5 owing to some intermediary changes Chromium made but i'll do my best and should hopefully be able to get it fixed in those lines too.

@gozzoo
Copy link

gozzoo commented Oct 16, 2019

@sarathjasrin well, but v7 has not been released.

My point is that this issue has been closed, but we can not consider it fixed yet, because the fix is not available in any stable release. It's good to know that a fix exists and it will be included in the future version, but v7 is not production ready yet. And when v7 eventually gets releaed it will come with its own set of issues (as the history of electron has shown), and it will take some time before it gets wide adoption. I don't expect to be able to use v7 before the start of next year, possible much latter.

Some people are still struggling to upgrade to v6, which was announced as stable few months ago. (see vscode - and they didn't even try v5)

That's why I think that it's very important for this fix to be backported to some of the stable releases, at least v6. Most projects that use printing (as mentioned in some comments above) are still stuck with v3.

Not many (if any) of the big adopters of electron (slack, vscode,, skype, WhatsApp, atom, ...) use printing in their products and there is no strong push to make printing work properly. Obviously It doesn't get as much love as some other more demanded features. As a result printing has been a chronic problem of electron for quite some time.

I hope you see now why I'm a little bit sceptical about such promise: don't worry, it's fixed, you'll get it in the next version, case closed.

@sarathjasrin
Copy link

@gozzoo I can understand. I'm also struggled with this issue ended up creating console application for printing in C#.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants