mozilla / pdf.js

PDF Reader in JavaScript
https://mozilla.github.io/pdf.js/
Apache License 2.0
48.62k stars 10k forks source link

[Bug]: Warning: Cannot load system font: AdobeSongStd-Light, installing it could help to improve PDF rendering. #18362

Open plainnany opened 4 months ago

plainnany commented 4 months ago

Attach (recommended) or Link to PDF file

problem.pdf

Web browser and its version

chrome 126.0.6478.127

Operating system and its version

MacOS Monterey 12.6

PDF.js version

4.4.170

Is the bug present in the latest PDF.js version?

Yes

Is a browser extension

No

Steps to reproduce the problem

  1. https://mozilla.github.io/pdf.js/web/viewer.html upload the file
  2. some text disappeared, and the console output “Warning: Cannot load system font: AdobeSongStd-Light, installing it could help to improve PDF rendering.” demo

What is the expected behavior?

render normal

What went wrong?

some text disappeared、

Link to a viewer

No response

Additional context

how to add new custom font?https://github.com/adobe-type-tools/cmap-resources/tree/master/ in adobe cmap-resources,I can't find AdobeSongStd-Light

THausherr commented 4 months ago

Yeah it's missing in Root/Pages/Kids/[0]/Resources/XObject/Xi16/Resources/Font/AdobeSongStd-Light/DescendantFonts/[0]/FontDescriptor. You'll have to buy it from Adobe, or ask the creator of the PDF ("hangzhou esign Group") to embed it to avoid troubles like this, or use a different font that is free (and embed it).

timvandermeij commented 4 months ago

Based on the above, I don't think there is much we can do here other than perhaps using a fallback font? Fonts should always be embedded in PDF files to avoid such issues.