Closed Bug 1796997 Opened 1 year ago Closed 9 months ago

The PDF viewer does not show any text, only some background colours - if browser.display.use_document_fonts false is set

Categories

(Firefox :: PDF Viewer, defect, P3)

defect

Tracking

()

RESOLVED DUPLICATE of bug 1563678

People

(Reporter: pufiad, Unassigned)

References

Details

Attachments

(1 file)

7.50 KB, application/pdf
Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:106.0) Gecko/20100101 Firefox/106.0

Steps to reproduce:

Open certain PDF files that were received as an attachment.

Actual results:

The PDF viewer does not show any text, only some background colours.

Expected results:

The PDF viewer should show the text as well.

These PDF files are properly rendered in Firefox 106. If Thunderbird uses the same PDF viewer software, perhaps it can be updated.

Thunderbird 102 follows what Firefox 102 ESR uses. If you need something newer, you need to use Thunderbird beta which uses the version corresponding to Firefox beta.

Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Resolution: --- → INVALID

Hello Magnus, thank you for your response. I finally found time to install Thunderbird 107.0b2 (64-bit) and it has the same problem as Thunderbird 102. It only shows some background colours and a logo image, but no text. It only happens with particular PDF files.

Checking the properties, the PDF file uses PDF version 1.4 and was created by:

iText® 5.5.12 ©2000-2017 iText Group NV (BELCENTRALE BV; licensed version)

As I said before: the problem is absent in Firefox 107 and eVince 42.3.

If Thunderbird 107.0b2 differs from Firefox 107.0b2, then something else is playing in - the pdf.js code used is the same. Perhaps hardware acceleration (try disable/enable in the Thunderbird settings).

You're right, something else is playing in. I tried turning off hardware acceleration and troubleshooting mode, but the problem persisted: no text. In a new profile it did work fine, so I started looking at the modified settings in the config editor.

Turning on browser.display.use_document_fonts made it work. This corresponds with the GUI option "Allow messages to use other fonts".

The same thing happens in Firefox 107: the text disappears when I turn off the option "Allow pages to choose their own fonts, instead of your selections above".

For the same PDF file eVince gives the following warning in the Fonts tab of the Properties window:

This document contains non-embedded fonts that are not from the PDF Standard 14 fonts. If the substitute fonts selected by fontconfig are not the same as the fonts used to create the PDF, the rendering may not be correct.

So, I propose to render the text with a local font and perhaps show a warning similar to eVince when browser.display.use_document_fonts is turned off.

Component: Untriaged → PDF Viewer
Product: Thunderbird → Firefox
Summary: PDF viewer out-of-date → The PDF viewer does not show any text, only some background colours - if browser.display.use_document_fonts false is set
Version: Thunderbird 102 → unspecified

I see that this ticket is closed and that the product is changed from Thunderbird to Firefox, so I am not sure how to continue with this. Should I open a new ticket for Firefox or can this ticket be re-opened?

I did some more investigation. The PDF file refers to some fonts that are not embedded in the PDF file.

With browser.display.use_document_fonts off, no text is shown at all.

With browser.display.use_document_fonts on, Thunderbird uses the default font for the given encoding. Since the PDF file encoding is WinAnsi, it uses the default font for the Latin encoding from Thunderbird. I verified that by changing that particular font and it is reproducible.

So I believe it is a bug: with browser.display.use_document_fonts off it should also default to some available font, just as it does when the option is on.

Could you attach an example PDF where you're seeing this bug? It won't be easy for us to debug otherwise.

Status: RESOLVED → REOPENED
Ever confirmed: true
Flags: needinfo?(pufiad)
Resolution: INVALID → ---
See Also: → 1563678, 1658975
Attached file test.pdf

This is a fabricated PDF file that shows a number of letters overlapping on the same position at the start of the line. The letters overlap, because I had to mangle the PDF file to remove the embedded fonts. The letters disappear (and only a line remains) if browser.display.use_document_fonts is off, both in Firefox and Thunderbird.

Flags: needinfo?(pufiad)

The console shows a bunch of warnings related to this when loading the pdf with use_document_fonts disabled:

Web fonts are disabled: unable to use embedded PDF fonts. viewer.js:2658:15
PDF 05430fc8093223423a402641d63b61c0 [1.6 LibreOffice 7.3 / Writer] (PDF.js: 3.1.6 [e42e1cde6]) viewer.js:2219:13
Warning: getPathGenerator - ignoring character: "Error: Requesting object that isn't resolved yet BAAAAA+LiberationSans_path_P.". pdf.js:444:13
Warning: getPathGenerator - ignoring character: "Error: Requesting object that isn't resolved yet BAAAAA+LiberationSans_path_D.". pdf.js:444:13
Warning: getPathGenerator - ignoring character: "Error: Requesting object that isn't resolved yet BAAAAA+LiberationSans_path_F.". pdf.js:444:13
Warning: getPathGenerator - ignoring character: "Error: Requesting object that isn't resolved yet BAAAAA+LiberationSans_path_ .". pdf.js:444:13
Warning: getPathGenerator - ignoring character: "Error: Requesting object that isn't resolved yet BAAAAA+LiberationSans_path_t.". pdf.js:444:13
Warning: getPathGenerator - ignoring character: "Error: Requesting object that isn't resolved yet BAAAAA+LiberationSans_path_e.". pdf.js:444:13
Warning: getPathGenerator - ignoring character: "Error: Requesting object that isn't resolved yet BAAAAA+LiberationSans_path_s.". pdf.js:444:13
Warning: getPathGenerator - ignoring character: "Error: Requesting object that isn't resolved yet BAAAAA+LiberationSans_path_f.". pdf.js:444:13
Warning: getPathGenerator - ignoring character: "Error: Requesting object that isn't resolved yet BAAAAA+LiberationSans_path_i.". pdf.js:444:13
Warning: getPathGenerator - ignoring character: "Error: Requesting object that isn't resolved yet BAAAAA+LiberationSans_path_l.". pdf.js:444:13

Calixte, can we use some kind of fallback here instead of dropping the characters altogether? Obviously, it won't be "right" but it'd be preferable to losing the text altogether, in general.

Flags: needinfo?(cdenizet)

Or alternatively, maybe pdf.js should internally override the browser.display.use_document_fonts and gfx.downloadable_fonts.enabled prefs, because displaying PDFs without using the right fonts doesn't really make much sense.

The font is not embedded in the pdf and neither glyph widths nor a font bbox are defined.
The missing widths explained why all the glyphes are drawn at the same place: by default the width value is 0 (MissingWidth):
https://christianhaider.de/dokuwiki/lib/exe/fetch.php?media=pdf:pdf32000_2008.pdf#page=290&zoom=auto,-75,12
For your information, nothing is rendered in Preview, Acrobat (which displays an error) and Chrome on mac 13.0.
:jfkthame, yes we've a better job to do with missing fonts, it's on our roadmap.

Flags: needinfo?(cdenizet)

Calixte, can we use some kind of fallback here instead of dropping the characters altogether? Obviously, it won't be "right" but it'd be preferable to losing the text altogether, in general.

Please note that Firefox falls back to a default font when browser.display.use_document_fonts is on, but not when it is off.

The severity field is not set for this bug.
:calixte, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(cdenizet)
Severity: -- → S3
Flags: needinfo?(cdenizet)
Priority: -- → P3
Duplicate of this bug: 1828488
Status: REOPENED → RESOLVED
Closed: 1 year ago9 months ago
Duplicate of bug: 1539074
Resolution: --- → DUPLICATE
Status: RESOLVED → REOPENED
No longer duplicate of bug: 1539074
Resolution: DUPLICATE → ---
Status: REOPENED → RESOLVED
Closed: 9 months ago9 months ago
Duplicate of bug: 1563678
Resolution: --- → DUPLICATE
No longer duplicate of this bug: 1828488
You need to log in before you can comment on or make changes to this bug.