swftools-common
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Swftools-common] on convert pdf which has Chinese characters


From: oyster
Subject: [Swftools-common] on convert pdf which has Chinese characters
Date: Wed, 29 Sep 2010 21:46:52 +0800

I am using the python bind to convert a pdf into pictures, and the
code( which you can find at the end) is from
http://www.swftools.org/gfx_tutorial.html
for my pdf files which have Chinese characters in it, I get tons of
messy characters on the picture. and the prompt shows the following
msg
I think that is about the Chinese Font, but how can I set the correct
font in my python code? thanks in advance


[quote msg]
Error: Unknown font tag 'F0'
Error: Unknown font tag 'F0'
Error: Unknown character collection 'Adobe-GB1'
Error: Couldn't find 'GBK-EUC-H' CMap file for 'Adobe-GB1' collection
Error: Unknown CMap 'GBK-EUC-H' for character collection 'Adobe-GB1'
Error: Unknown character collection 'Adobe-GB1'
Error: Couldn't find 'GBK-EUC-H' CMap file for 'Adobe-GB1' collection
Error: Unknown CMap 'GBK-EUC-H' for character collection 'Adobe-GB1'
Error: Unknown character collection 'Adobe-GB1'
Error: Couldn't find 'GBK-EUC-H' CMap file for 'Adobe-GB1' collection
Error: Unknown CMap 'GBK-EUC-H' for character collection 'Adobe-GB1'
Error: Unknown font tag 'F0'
Error (76239): No font in show
Error (76253): No font in show
Error (76424): No font in show
Error (76760): No font in show
[/quote]


[code]
#!/usr/bin/python
import gfx
doc = gfx.open("pdf", "document.pdf")
img = gfx.ImageList()
img.setparameter("antialise", "1") # turn on antialising
page1 = doc.getPage(1)
img.startpage(page1.width,page1.height)
page1.render(img)
img.endpage()
img.save("thumbnail80x80.png")
[/code]



reply via email to

[Prev in Thread] Current Thread [Next in Thread]