Not sure if this should be added to previous Libre Office printing problems thread.
Libre Office as packaged with 20.04.2 Lubuntu initially printed odt documents as expected of but would not produce usable PDF exports. Instead garbage characters were created. But as of the last few apt updates it will not print to paper any documents without producing garbage characters. On same computer running the same Lubuntu 20.04.(4?) Firefox prints from web or PDF files as expected.
When I reboot into 20.04.3 Xubuntu there are none of the odd behaviors above are evident. Printing and PDF export work as expected.
One thing odd that I noticed is that despite both installations of Writer showing identical v6.4.7.2 and build 1.6.4.7 0ubuntu 0.20.04.2, the pick list for output paper sizes shows very differently. And the Writer installation on the Lubuntu boot does not save the output print paper size as saved with the document but reverts to A4 210.297mm, which is the first (default) choice in the drop down list.
Regarding the “it was working before” statement I should add that I managed to get it to work only by meticulously checking CUPS printer, and Writer global printer settings and on the fly document settings each time I printed the same document. Otherwise the paper size in all three locations defaulted back to the A4 210 x297 setting. But with latest 2-3 updates updates the CUPS printer (Preferences/Printers/localhost) setup dialogue and Writer printer setup retain the desired 8.5x11 paper size but the print dialogue defaults to A4 210x297. However, changing to 8.5 x1 before starting the print job still results in garbage character printer output from Writer. Printing from Firefox prints as expected. Another nuance is Export to PDF and Export Directly to PDF both produce blank documents (view PDF after save selected.)
I recommend others having Libre Office Writer on Lubuntu (of any version) printing problems check all three places to assure that the proper output size shows what you want. Seems like a problem with the (driver?) code that does the print rendering, maybe due to installed stack differences.
Regarding the problem with PDF exports, this is a known issue being tracked and is still mentioned in the latest release notes for Lubuntu 20.04.4:
Known Issues
Please also check the known bugs reported in the Ubuntu Release Notes for more common bugs affecting all Ubuntu flavors.
LibreOffice Exporting Documents as a PDF
There is a bug where certain fonts do not render in exported PDF documents. As a workaround, LibreOffice applications can be launched from the commandline with the following environment variable SAL_VCL_QT5_USE_CAIRO=true. For example, to launch writer issue SAL_VCL_QT5_USE_CAIRO=true libreoffice –writer.
As for the printing problems… I cannot really say much there.
The bug as documented in the release notes is in Qt5; thus impacted both Kubuntu (KDE/KF5/Qt5) & Lubuntu (LXQt/Qt5), but not GTK3 desktops like Ubuntu (GNOME/GTK3) or Xubuntu (Xfce/GTK3) - which is why it works in Xubuntu 20.04.
There are multiple ways to work around this issue mentioned on this site (its an issue that exists only in 20.04); from using the snap version of LibreOffice, to replacing libraries (GTK replacing Qt5) or the lightest (less resource intensive) way is mentioned in the release notes & by @That_Random_Guy’s answer.
Thank you for sharing your findings though, so others could benefit from them.
I would like to point out that the printing problems I am reporting for Libre Office 6.4 are not bugs listed on either Ubuntu or Lubuntu release notes for 20.04.4. 20.04.4 is listed as LTS until April of 2023 on the Lubuntu Release notes. As @That_Random_Guy stated “as for the printing problems I cannot help you there.” So is nobody working on print problems with Libre Office on either flavor of Ubuntu? Not being able to convert to PDF is a nuisance but not having print capabilities from the packaged office suite seems like something an LTS release should have working by now.
But even at that, after trying PDF exports by changing the source doc to several different fonts then running the export gives the same behavior: blank page as PDF output. I didn’t try every font primarily because relatively few were common English fonts. I did observe that many of the non English fonts wrote over the previous font in the sample line such that both were visible. So maybe the bug mangles any font when rendering a doc for processing from the original. Note that repeating the same gymnastics for print operations gives me a mostly blank page with a few random characters. To me that indicates there may be more than one code issue sabotaging both print and export.
One question: my assumption is that applying available updates by sudo apt update/upgrade brings me up to 20.04.4 or later image specifications. Is that correct? That is interesting to me because I initially installed an earlier posted image. At that time, before applying several updates I at least got a page full of random characters when printing or exporting, not just a few.
The bottom line is this: is the Lubuntu 20.04.4 printing with Libre Office getting fixed or not before LTS expires?
The issues I believe you’re talking about were fixed before Lubuntu 20.10 was released; but that’s how the upstream issue was fixed (in later version of Qt5). It wasn’t deemed to be a security issue, so wasn’t back-ported to Qt 5.12 LTS which is the Qt5 version Ubuntu 20.04 uses. Thus the work-arounds that are documented for existing 20.04 users.
apt upgrade has limits on what it can upgrade; just like apt-get upgrade did. With apt-get you had the option of dist-upgrade to install all upgrades; that still works the same with apt; however the documented way with apt is
upgrade (apt-get(8))
upgrade is used to install available upgrades of all packages currently installed on the system from the sources configured via sources.list(5). New packages will be
installed if required to satisfy dependencies, but existing packages will never be removed. If an upgrade for a package requires the removal of an installed package the
upgrade for this package isn't performed.
full-upgrade (apt-get(8))
full-upgrade performs the function of upgrade but will remove currently installed packages if this is needed to upgrade the system as a whole.
ie. apt upgrade works within limits; and will leave upgraded packages for a full-upgrade if packages need to be removed; allowing you to install them later when you decide it’s an appropriate time (ie. giving you the option to check if this will have consequences for your install)
View man apt to read the full detail (it maybe easier than what I’ve provided which is from my own jammy box; what you get will also perfectly match your release too)
I finally gave up and installed the SNAP of 6.4.7.2 Libre Office Writer on my 20.04 Lubuntu installation and can print to an HP Inkjet 1000 J100 from any document types. Now, in the quest to get an almost mint condition Brother HL-2350 laser going I find that there is no usable driver included in 20.04 distro for that Brother model. So I installed 18.04 on a scratch system and found the proper driver and was able to print PDF files from browsers and apps. Ironically though, it will not print any ODT files created with Libre Office 7.3.2.2 as available in the latest SNAP on the Libre Office site. That Writer version does not inherit the installed 18.04 system printers but only offers GENERIC Printer from within Libre Office. The topper is that Abiword in 18.04 lets me choose the laser to print ODT files created with Writer 7.3.2.2 (which won’t).
WIndows XP Home dutifully prints PDFs and any other type of file when the Laser is plugged into that system- probably because it has a better driver I suppose.
However, physically removing the laser from any of the mentioned Lubuntu versions requires a complete re-installation of the printer (after re-attachment) if it has been booted sans printer in the interim. Using GUI CUPS to Delete the “old” instance of the laser shows the auto-discovered printer quickly. Another thing I notice is that though I delete printers in one window in GUI CUPS, they remain in the Add printer pick list even after several reboots with the printer deleted and physically disconnected from the system box. Trial and error attempts leave me with several phantom versions of the same printer I can’t get rid of. This seems abnormal and for me casts doubt on whether GUI CUPS is fully baked. I.E. if it has been deleted and disconnected why does it show up in the GUI CUPS pick list?
So how can I get rid of the phantom printers and start over?
Is there a way to add the driver (firmware) working in 18.04 to my 20.04 installation? Note that I tried several drivers on 22.04 but of course it too does not have the correct driver or a substitute.