mozilla / pdf.js

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

Japanese Font Displaying Different Characters #17597

Open srshupe opened 9 months ago

srshupe commented 9 months ago

Attach (recommended) or Link to PDF file here: 10899169_NoEmbeddedFont_20210907TEST2D 1.pdf

Configuration: - Web browser and its version: Chrome v120, also latest versions of Edge and Firefox - Operating system and its version: Windows 11 - PDF.js version: 4.1.111 - Is a browser extension: no

Steps to reproduce the problem:

  1. Open the attached PDF in Adobe and in PDF.js (v4.1.111). The Japanese characters are different.

What is the expected behavior? (add screenshot) A Japanese font (that is not embedded) displays correctly in Adobe but shows up garbled in PDF.js. The characters should be the same in either.

This is how it looks in Adobe: image

And this is how it looks in PDF.js v4.1.111: image

PDF.js is displaying characters, but they are the incorrect ones, it looks like.

What went wrong? (add screenshot) There are no error messages.

Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension): https://mozilla.github.io/pdf.js/web/viewer.html

Snuffleupagus commented 9 months ago

A Japanese font (that is not embedded) displays correctly in Adobe but shows up garbled in PDF.js. The characters should be the same in either.

Please note that the only way to guarantee that it works correctly is by embedding all fonts in the PDF document.