question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Garbled text in Illustrator and Corel Draw

See original GitHub issue

Opening a PDFkit created PDF with embedded TTF subset in Illustrator CS6, CC or Corel Draw X7 shows the raw bytes used for the subsetting instead of the proper characters.

The text Hello Wörld! is shown as !"##$%&'(#)*. This corresponds to the ASCII characters that would map to the bytes used by PDFkit for subsetting, beginning with 33 | 0x21 | !.

Displaying in Mac Preview or Adobe Acrobat X is fine.

The embedded font is a TTF of Univers by Linotype, but the Problem happens with all TTF fonts I tried.

The issue does not occur, if a similar PDF is created using Prawn.

Sample Code PDFkit:

var PDFDocument = require('pdfkit'),
    fs = require('fs'),
    doc = new PDFDocument()

doc.pipe(fs.createWriteStream('hello-pdfkit.pdf'))

doc.font('resources/assets/fonts/LT_21218.ttf')
   .fontSize(12)
   .text('Hello Wörld!', 25, 25)

doc.end()

Sample Code Prawn:

require "prawn"

Prawn::Document.generate("hello-prawn.pdf") do
  font "resources/assets/fonts/LT_21218.ttf" do
    text "Hello Wörld!"
  end
end

Comparing the Prawn and PDFkit PDFs I noticed that they do subsetting/charmaps differently and that the font embedded by prawn has additional headers (prep, fpgm, cvt).

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
devongovettcommented, Aug 27, 2016

fontkit was released in v0.8.0, and should fix this issue.

0reactions
WiLb00Xcommented, Jun 10, 2016

@devongovett have you find a solution? i really need it. 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gibberish text when importing text 'as text', in .eps and .pdf files
I would like to import it to CorelDraw such that the text will be editable. ... .eps file is not corrupted, since it...
Read more >
Missing or garbled text when converting or combining PDF ...
Follow these steps if text does not display or print correctly after you convert or combine documents in Adobe Acrobat 9.
Read more >
Corel Draw X7: Some objects corrupt EPS File Exported, is ...
I see no problem with an export I made and opening it on my version of illustrator, except a font issue. Corel Draw....
Read more >
Why CorelDRAW Claims AI or PDF Files Are Corrupt - YouTube
View all episodes of the Cave Creek Geek at https://graphics-unleashed.com/cave-creek-geek/In this episode the Geek answers viewer questions ...
Read more >
CorelDRAW problems: publishing as AI and EPS - 99Designs
Attention CorelDRAW users: Did you know that serious problems arise when CorelDRAW files are published as an AI (Illustrator file) or EPS? If...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found