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

Desktop: Fixes #8240: Fix print on Linux #9810

Merged

Conversation

personalizedrefrigerator
Copy link
Collaborator

@personalizedrefrigerator personalizedrefrigerator commented Jan 31, 2024

Summary

Fixes File > Print on Linux by using window.print() instead of webContents.print. (Fixes #8240).

Notes

Note

For now, this pull request is partly intended for discussion. The current approach works around what seem to be two Electron bugs. An alternative approach would be to

  1. Print to PDF
  2. Show that PDF in a window labelled "print preview" (as suggested here)

Testing plan

  1. Create notes with the following contents:
    1. A very long note (I used this book from Project Gutenberg)
    2. A note with math (KaTeX) and at least one image
  2. Print both to files and verify that the files have the expected content.

This has been tested successfully on Ubuntu 23.10. (Untested on Windows/MacOS).

@personalizedrefrigerator personalizedrefrigerator marked this pull request as ready for review February 1, 2024 16:08
@laurent22 laurent22 merged commit bc8392a into laurent22:dev Feb 2, 2024
10 checks passed
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 this pull request may close these issues.

Not able to print under Linux
2 participants