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

Printing does not work #1

Closed
garrett opened this issue Jan 20, 2021 · 9 comments · Fixed by #2
Closed

Printing does not work #1

garrett opened this issue Jan 20, 2021 · 9 comments · Fixed by #2

Comments

@garrett
Copy link

garrett commented Jan 20, 2021

When I select File → Print from the menu, nothing happens for a few seconds, and then a small dialog appears saying "Could not print: no valid printers available".

However, I have a network-available printer configured on my system and it is available to other applications, including other flatpaks, such as Firefox. Additionally, even without a printer installed, it should be possible to "print to a file" (basically save it as a PDF), which is in the general printing dialogs of other apps too.

I'm assuming this has to do with flatpak sandboxing.

Right now, I don't see the printing system flag enabled. Even after toggling it with Flatseal, Joplin still doesn't show a print dialog, so fixing this is probably not quite that simple.

@catsout
Copy link
Collaborator

catsout commented Jan 21, 2021

Actually, I get a same error with appimage version.
But I solved this by add a virtual local printer on host system.
I use debian kde, and do this by apt install print-manager, and go system-print setting then add it.

But the problem is that I can only see "print to pdf", no printers in flatpak version.

@catsout
Copy link
Collaborator

catsout commented Jan 21, 2021

Right now, I don't see the printing system flag enabled.

What's printing system flag?
I have seen it on Flatseal, but firefox not enable it.

@catsout
Copy link
Collaborator

catsout commented Jan 22, 2021

So, in my test, the error "Could not print: no valid printers available" is not caused by flatpak sandbox.
If you have free time, you can test it with appimage version

In fact, joplin support expose as pdf directly.

@catsout
Copy link
Collaborator

catsout commented Jan 22, 2021

But the problem is that I can only see "print to pdf", no printers in flatpak version.

@tinywrkb your pr fix this for me. But I can only test it with a virtual printer.

@tinywrkb
Copy link
Contributor

tinywrkb commented Jan 22, 2021

@catsout Oh, so that change actually did something, it seems to give access to a local CUPS daemon.
I'm still not sure that this the wanted behavior, I would prefer to get the regular GTK3 print dialog instead of whatever Electron is showing and that it won't fail if CUPS daemon isn't running.
It too late over here to test actual printing.

@catsout
Copy link
Collaborator

catsout commented Jan 22, 2021

I would prefer to get the regular GTK3 print dialog instead of whatever Electron is showing and that it won't fail if CUPS daemon isn't running.

I think it's ok with electron's, as it's the same behavior as joplin appimage version.
Other electron app, like typora(flatpak), will not fail without virtual printer, but only show "print to pdf" too.
So, the error "Could not print: no valid printers available", most likely caused by joplin or it's electron dependencies.

@tinywrkb
Copy link
Contributor

Right, might be an Electron issue electron/electron#24664

Other than that, after playing with the GTK settings.ini and GTK_PATH environment variable it looks like it's working at it should so I'll reopen the PR.

@garrett
Copy link
Author

garrett commented Jan 22, 2021

Thanks for fixing this so quickly! (I try not to print, but occasionally it's needed, and it's good to know it's there now.)


Also: Huge thanks for packaging Joplin as a flatpak! 💖

I first saw Joplin a few months ago, but didn't install it, as there was no good way to do so on Fedora. (AppImages are horrible security-wise, lack integration, and have no proper way to update... and I try to not compile software I rely on every day from source.) So I was very happy to see Joplin show up in the "new & updated" area of Flathub.

I've imported all my existing notes (from Markdown) and even installed the Android app from F-Droid as a result of your efforts. Thanks again!

@pxcask
Copy link

pxcask commented Feb 21, 2022

When I select File → Print from the menu, nothing happens for a few seconds, and then a small dialog appears saying "Could not print: no valid printers available".

I am aware that the topic is closed. A simple solution on Ubuntu solved it for me: Goto "Settings - Applications - Joplin" and permit "print documents".

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.

4 participants