Chinese characters appear garbled when Adobe Illustrator opens a PDF created using reportlab

85 Views Asked by At

I used reportlab to create a pdf file that contains a Chinese text. I have registered the Chinese font file. There is no problem when the pdf is opened directly through the browser, and the Chinese text is displayed normally. Opend by brower

However, when it is opened using Adobe Illustrator, the Chinese text is garbled. I don't know why. Opend by Adobe Illustrator

```python

from reportlab.pdfgen import canvas

from reportlab.pdfbase import pdfmetrics

from reportlab.pdfbase.ttfonts import TTFont

pdfmetrics.registerFont(TTFont('SimSun', 'SimSun.ttf'))



c = canvas.Canvas('output.pdf')

c.setFont('SimSun', 12)

c.drawString(100, 100, '水果超级大卖场') 

c.save()

```

I hope that Chinese can be displayed normally in Adobe Illustrator

1

There are 1 best solutions below

0
herrstrietzel On

Embedded font subsets are not supposed to be usable fonts

Frankly most vector applications struggle with embedded fonts when opening a pdf in an editable mode.

The main reason why pdf embedded font subsets don't work in most applications – it's also intended to prevent font piracy.
Keep in mind Adobe is also a font distributor. If a pdf containing long copy text set in a licensed – maybe rather expensive – fonts could easily be "ripped".

But you can instead create a new document - using the same document size as the pdf and import the file via place operation.

You get an uneditable object frame showing the pdf as it is.

Then you can use the flatten transparency option to include the external file in your new document.

Check Convert all text to outlines option to convert all text elements to paths.

flatten transparency

Alternative: open in inkscape

Inkscape provides an option to convert text to paths in the opening dialog

inkscape