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

Please, make printing work with Electron ! #17523

Open
popod opened this issue Mar 23, 2019 · 20 comments
Open

Please, make printing work with Electron ! #17523

popod opened this issue Mar 23, 2019 · 20 comments

Comments

@popod
Copy link
Contributor

@popod popod commented Mar 23, 2019

Problem Description

There are many printing problems since Electron 3 and this prevents people who need a working print solution to use Electron 3, 4 or 5 !

So please, can you take a look at all this printings issues and trying to fix it ? We are a lot of developers waiting for this since a long time..

Thanks a lot for your work ! And I hope you could give us some feedback about this.

cc: @codebytere @MarshallOfSound @nornagon

Related issues

All this issues seems related to webContents.print() which seems to be buggy:

  • #17265 webContents.print() callback always return false ✔️
    • Fixed since v5.0.5
  • #16085 Fix callback for webContents.print() cancel event ✔️
    • Fixed since v5.0.5
  • #18123 'silent: true' for printing not working in version 5
    • #18858 webContents.print() doesn't respond when adding parameters
    • #17670 Don't ask user for print settings.
    • #16362 Silent print not working in mac/osX
    • Fixed since v5.0.7
  • #18980 Better callback value for webContents.print()
    • Available since v7
  • #18917 print blurring
    • Fixed since v7 (by #18984 feat: add a series of new printing options)
  • webContents.print() doesn't work when deviceName is provided and silent: true

Other printing issues:

  • #16813 Unable to print large documents in Electron 4, 5
  • #16534 webview.print() not working properly in 4.0.X
    • Seems to be fixed since v5.0.5
  • #15847 webContents.print() random missing letters
  • #7849 Printing needs more options
    • #15568 Add error information to webContents.print() callback
    • Available since v7
  • #19056 Add an option to choose the paper format (size) on webContents.print()
  • #18093 webContents.printToPDF() regression in v5
  • #19108 Electron crashed after print
    • Fixed by #19598
    • Will be released in v6.0.2 and v5.0.10

(Non-exhaustive list)

@mojason-81

This comment has been minimized.

Copy link

@mojason-81 mojason-81 commented Apr 12, 2019

Just thought I'd leave some more info here. I'm having similar issues on v4.1.4 (and 4.0.x before). The print dialog will open, but only intermittently. It will open several times in a row, then not open for a while and maybe open again once or twice, but ultimately seems to stop opening altogether.

EDIT: Also, tried to just force silent printing by passing true as that option to the print function along with a device name. This seems to have no effect and the print dialog still opens on the first try and continues to be intermittent. See also: #16362

@brenca brenca self-assigned this Apr 17, 2019
@baconbrad

This comment has been minimized.

Copy link
Contributor

@baconbrad baconbrad commented May 1, 2019

This is out of my abilities to fix. I see it was self assigned by @brenca 2 weeks ago. I am just curious if there is any progress on these issues. Particularly in regards to using a deviceName and having webContents.print() work as expected. Until they are resolved my projects and many others will be blocked to Electron 3.X.X. I apologize I have nothing to contribute to these issues and I don't want this comment to come off as unappreciative nagging. I am just interested to see how they are coming along. Thank you.

@baconbrad

This comment has been minimized.

Copy link
Contributor

@baconbrad baconbrad commented May 28, 2019

@gozzoo

This comment has been minimized.

Copy link

@gozzoo gozzoo commented May 29, 2019

It doesn't seem so 😞

PR descrption says:

Updating Chromium to 964c4bca8de5c320534d95606c861 (lkgr).
Fixes #18409

@codebytere codebytere self-assigned this May 29, 2019
@popod

This comment has been minimized.

Copy link
Contributor Author

@popod popod commented Jun 25, 2019

Hooray ! It seems that printing problems with Electron will soon be only old memories!

Some problems have already been fixed in Electron 5.0.5 and others seem to be soon. Thanks to @codebytere for her work!

@JonaMX

This comment has been minimized.

Copy link

@JonaMX JonaMX commented Jul 1, 2019

I just tested 5.0.5 and silent print still not working

@codebytere

This comment has been minimized.

Copy link
Member

@codebytere codebytere commented Jul 1, 2019

@JonaMX yes, that is expected. It has not been backported to that release line yet and remains in flight; if it had you would have been able to see it in the release notes.

@craftzdog

This comment has been minimized.

Copy link

@craftzdog craftzdog commented Jul 10, 2019

It still does not work in 5.0.6.
I tried webview.getWebContents().print as a workaround but did not work.
A print dialog properly opens but nothing is produced.
When I chose 'Save as PDF', it outputs an empty file.
webView.printToPDF does nothing.

@baconbrad

This comment has been minimized.

Copy link
Contributor

@baconbrad baconbrad commented Jul 10, 2019

@craftzdog As expected. According to the releases notes this change was not pushed in 5.0.6.

@craftzdog

This comment has been minimized.

Copy link

@craftzdog craftzdog commented Jul 11, 2019

@baconbrad thx for letting me know. hope it will be pushed to 5.x soon!

@ebmbook

This comment has been minimized.

Copy link

@ebmbook ebmbook commented Jul 12, 2019

Just in case this helps someone, the only stable version which works with printing is v3.0.10.

@gozzoo

This comment has been minimized.

Copy link

@gozzoo gozzoo commented Jul 13, 2019

@ebmbook yes, it seems that the supposed fix has not been ported to any release branch.

Actually this is an umbrella issue covering many more specific problems and without a chance to test this fix I'm very spectical that it fixes all of them. These issues have been dragging for quite a while and it's obvious that prining has a very low priority in the development plans.

We are also stuck with v3.0.x and I don't see our project upgrading to a newer electron version any time soon.

@misbeliever

This comment has been minimized.

Copy link

@misbeliever misbeliever commented Jul 15, 2019

Same here stuck on v3 because silent printing still does not work correctly on any newer version.

@codebytere

This comment has been minimized.

Copy link
Member

@codebytere codebytere commented Aug 8, 2019

@JonaMX v5.0.7 fixes silent printing.

#19598 was also recently merged and fixes a slew of issues, which y'all can test in v7.0.0-beta.2

I'll be porting portions of that fix back as soon as i can for v6 and v5.

@JonaMX

This comment has been minimized.

Copy link

@JonaMX JonaMX commented Aug 8, 2019

Thanks @codebytere I'll test this out and let you know how it went.

@baconbrad

This comment has been minimized.

Copy link
Contributor

@baconbrad baconbrad commented Sep 25, 2019

Just tested our POS with v6.0.10 and most everything works with the exception when we specify a deviceName. Just waiting for either the fixes for PR #19598 to make it to v6 or a stable release of v7. I appreciate the hard work of everyone that addressed the issues. Thank you! Looking forward to ditching v3 for good.

@barbalex

This comment has been minimized.

Copy link

@barbalex barbalex commented Sep 25, 2019

Don't know if this is the right place to add this but printBackground: true seems to be completely ignored inside webContents.print.

It does work when using webContents.printToPDF.

This has been rather consistent for us since we use electron (v3).

@cxyao

This comment has been minimized.

Copy link

@cxyao cxyao commented Oct 14, 2019

We also meet the same problem under v5.0.11 @barbalex
webContents.print({ printBackground: true } )not work.
@codebytere @popod could you help us ?

@shabeer-mdy

This comment has been minimized.

Copy link

@shabeer-mdy shabeer-mdy commented Oct 16, 2019

Hi .
is there any way to print bar code using this method

@seksitha

This comment has been minimized.

Copy link

@seksitha seksitha commented Dec 3, 2019

@JonaMX v5.0.7 fixes silent printing.

#19598 was also recently merged and fixes a slew of issues, which y'all can test in v7.0.0-beta.2

I'll be porting portions of that fix back as soon as I can for v6 and v5.

I test the beta and it works. Thank you very much. no more printToPdf and say goodby to exec pdfToPrinter.exe with a long lagging. the process of printing the barcode label is fast now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.