Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TrueType standard fonts #13585

Closed
kmcclellan opened this issue Jun 18, 2021 · 0 comments · Fixed by #13589
Closed

TrueType standard fonts #13585

kmcclellan opened this issue Jun 18, 2021 · 0 comments · Fixed by #13589

Comments

@kmcclellan
Copy link

Attach (recommended) or Link to PDF file here: helloworld-ttf.pdf

Configuration:

  • Web browser and its version: NodeJS v14.17.0
  • Operating system and its version: Windows 10.0.18363 Build 18363
  • PDF.js version: 5d251a3
  • Is a browser extension: no

Steps to reproduce the problem:

  1. Run the attached PDF through the pdf2png.js example.

What is the expected behavior? (add screenshot)

My company works with PDFs that come from publishers which sometimes use the 14 standard fonts. When they do, they are referenced using the "TrueType" format, instead of the "Type1" that PDF.js implementation in #12726 expects.

4 0 obj
<<
  /Type /Font
  /Subtype /TrueType
  /BaseFont /TimesNewRomanPSMT
  /FontDescriptor 5 0 R
  /Widths[250 333 0 0 0 0 778 0 333 333 0 0 250 333 250 278 500 500 500 500 500 500 500 500 500 500 0 278 0 0 0 444 0 722 667 667 722 611 556 722 722 333 389 722 611 889 722 722 556 0 667 556 611 0 722 944 722 0 611 333 0 333 0 0 0 444 500 444 500 444 333 500 500 278 278 500 278 778 500 500 500 0 333 389 278 500 500 722 500 500 444 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 333 0 0 0 0 1000 0 980 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 760]
  /FirstChar 32
  /LastChar 169
  /Encoding /WinAnsiEncoding
>>
endobj

What went wrong? (add screenshot)

Prints warnings and visible text is not rendered:

Warning: getPathGenerator - ignoring character: "Error: Requesting object that isn't resolved yet Times_path_H.".
Warning: getPathGenerator - ignoring character: "Error: Requesting object that isn't resolved yet Times_path_e.".
Warning: getPathGenerator - ignoring character: "Error: Requesting object that isn't resolved yet Times_path_l.".
Warning: getPathGenerator - ignoring character: "Error: Requesting object that isn't resolved yet Times_path_o.".
Warning: getPathGenerator - ignoring character: "Error: Requesting object that isn't resolved yet Times_path_,.".
Warning: getPathGenerator - ignoring character: "Error: Requesting object that isn't resolved yet Times_path_ .".
Warning: getPathGenerator - ignoring character: "Error: Requesting object that isn't resolved yet Times_path_w.".
Warning: getPathGenerator - ignoring character: "Error: Requesting object that isn't resolved yet Times_path_r.".
Warning: getPathGenerator - ignoring character: "Error: Requesting object that isn't resolved yet Times_path_d.".
Warning: getPathGenerator - ignoring character: "Error: Requesting object that isn't resolved yet Times_path_!.".

If I remove the if (type === "Type1") from this line and rebuild, this issue is resolved. I suspect the exclusion of "TrueType" is just an oversight and that this is an easily fixed bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants