LibreOffice export to PDF has no text

In LibreOffice in Lubuntu 20.04, when I Export to PDF, the PDF has no text. Lines and boxes, if the original had them, but no text. Open up LibreOffice Writer, write “hello world”, export to PDF, and it will generate a PDF and give the impression that all went well, as there is no error or warning message. But the PDF will be blank.

This likely means fonts are missing, or LibreOffice can’t find them.

Export to PDF works fine in Lubuntu 18.04.

Anyone else seeing this problem in 20.04?

Known bug mentioned in the release notes.

1 Like

Best solution/workaround at present seems to be this…
Go to LUBUNTU MENU: Preferences -> LXQt settings -> Session settings -> Environment variables

Then, add this:
Variable Name: SAL_VCL_QT5_USE_CAIRO
Fill the Value with: true

Restart your computer, and it will resolve the fonts rendering while exporting documents to a PDF on LibreOffice.
(There is just one small inconvenience – see below).

A few other people have hit this too, however it has been reported and discussed elsewhere as problem with PRINTING from LibreOffice (see “Printing problem with 20.04” in this forum). The connection between these two manifestations of a problem is that LibreOffice generates a PDF, which is then sent to be printed via CUPS. Without the above (or similar) fix, the generated PDF is invalid, because the required fonts fail to get embedded.

A MINOR INCONVENIENCE : with this “fix” in place, you will always have to start either LibreOffice-writer, LibreOffice-calc, -draw, -impress, etc, because trying to start “bare” LibreOffice will throw an error. In my opinion this is a minor inconvenience compared to not being able to export to PDF, or print anything at all.

1 Like

That workaround made things much worse. Perhaps it’s because I’ve fiddled a bit with the system font settings. When I run LibreOffice like this:

SAL_VCL_QT5_USE_CAIRO=true libreoffice --writer

And load a real short text file, less than 100 bytes, this is what I see:

libreofficefontbug

That looks like a graphics error more than anything. I would try adding compositing by turning Compton on to first see if that doesn’t fix it.

I had the same problem on a 20.04 installation, for me what helped was to unset SAL_USE_VCLPLUGIN or change it to SAL_USE_VCLPLUGIN=kf5

With SAL_USE_VCLPLUGIN=qt5 it always produced PDFs with invisible text, so there may be something wrong with that.

1 Like

I fixed all my problems with Libreoffice on Lubuntu doing:

sudo apt remove --purge libreoffice-qt5

I think the community need do maintenance this package.

6 Likes

I found a simple enough workaround for the graphics problem: maximize/unmaximize the window. The graphics scramble occurs immediately after loading a file, and only with the USE_CAIRO flag. Maximizing (or unmaximizing if the window started maximized) clears it up

Export to PDF works correctly.

kf5 works perfectly. No screwed up graphics, and the PDF has text.

1 Like

Thank you ailtonbsj!, this worked on my newly installed Lubuntu 20.04 and LibreOffice 6.4.3.2

3 Likes

Thank you for your advice. It worked fine.

2 Likes

thanks, this worked for me :slight_smile:

2 Likes

The Terminal command recommended by ailtonbsj worked for me (after closing and reopening LibreOffice); many thanks. Having done this step, I printed a document successfully.

Side-effect: the icons and ‘skin’ of LibreOffice change as a result of this action (presumably, this is because the qt5 theme within LibreOffice is lost – in my case, this resulted in the graphics becoming larger and a bit clearer).

This raises a further question: will libreoffice-qt5 remain removed upon installing further system upgrades within 20.04 LTS?

2 Likes

Also worked for me; now I can export PDF works without problems.

3 Likes