Printing problem with 20.04

Well I confirmed the initial printing issue. I have not confirmed that anyone else can’t make my fix work, though. @HMollerCl @kc2bez @guiverc @apt-ghetto want to try it out?

I can confirm that your fix works. I edited the exec line to have the following:
Exec=env SAL_VCL_QT5_USE_CAIRO=true libreoffice --writer %U
In the desktop file /usr/share/applications/libreoffice-writer.desktop
I used sudo vim /usr/share/applications/libreoffice-writer.desktop to edit the file but you can use any editor you like. sudo nano or sudo featherpad would also be able to edit and save the file.

I then launched writer using “LibreOffice Writer” from the menu. Upon inspection of the about page I was able to verify my change worked. You can see the VCL: qt5+cairo
screenshot23

I then proceeded to craft a document, I inserted a few special characters for good measure. I was able to export the document as a PDF. The document looked as it appeared on my display. I added my printer to the system a, Xerox 3260. I was also able to print the document and it too appeared the same as my display.

1 Like

Please never start a graphical application with sudo, because there are several downsides.
Theoretically there is lxqt-sudo, but this is almost as bad as sudo.

It isn’t necessary to run the graphical application with elevated privileges, you only need elevated privileges for the write (and sometimes read) actions.

The best way to edit files with elevated privileges is (I took the file /etc/fstab as an example, because it is less typing for me):

VISUAL=featherpad sudoedit /etc/fstab

This will start the editor, which you have defined in the variable VISUAL, with normal user permissions. Of course you can define every other editor, you prefer. You can even define a non-graphical editor such as nano or vim, although in this cases it might be better to use EDITOR=vim instead of VISUAL=vim.

If you use always the same editor, you can add to the file ~/.bashrc the following line:

export VISUAL=featherpad

and after reopening the terminal you need only

sudoedit /etc/fstab

which opens your favourite editor without elevated privileges.

2 Likes

Here is a second confirm. I used the method as per @kc2bez above post. i.e using vim.

Should we not file a bug report on this?

2 Likes

Excellent points. Thank you for the corrections.

1 Like

I think this is an extension or at least related to the bug report mentioned in the release notes as that’s where the proposed fix came from. It was a wild guess on my part.

1 Like

Overlooked by me… :upside_down_face:sorry

1 Like

No, I think you’re kind of right. The bug report at least should be edited to include a larger scope. Feel free!

1 Like

An even better solution: add it to the LXQt environment variables.

1 Like

Thank you, now it works. But now I get the following screen everytime I try to open LibreOffice (and not open the odt through PCMan):
grafik
It doesn’t matter if I close the message or press “OK” - it reappears every single time and doesn’t open.
It says that LibreOffice has crashed and tries to restore the following documents - well, none.

Probably a LibreOffice bug. This may prove to be a solution.

Yes, that’s the downside of changing thr env variable, you cannot run office alone. You need to run an app (writer, calc, etc…)
Maybe @scro problem is that he edited writer .desktop but he opened lo with other .desktop?

@kc2bez there is another way like this: https://www.linuxuprising.com/2018/04/gksu-removed-from-ubuntu-heres.html

2 Likes

There’s a new version of Libreoffice (6.4.3) which should fix the bug. If I use the shell with sudo apt-get install libreoffice it says that I already have the newest version (6.4.2). If I try to download 6.4.3 through discover, it always dies at 7% though. It doesn’t find the 6.4.3 version in “software”.
Is there a reason why that version isn’t referenced yet?

Ok, download with discover works, just takes forever.

That’s because it’s not a Debian package, but a Snap package.

Hi, @scro

I am no expert at all. Just I also had this problem. The solution provided by @wxl worked smoothly for a while and suddenly, out of the blue, it stopped exporting PDF. Then I found this solution in Ask LibreOffice and now I am back on the road! It can help you momentarily until we figure out what is really happening.

My suspect is LibreOffice.

AskLibreOffice :: Cannot print anything…

Yes, that works! Thank you very much!

That works because you removed libreoffice-qt so you have gtk or default vcl

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.