I am running the following command to add bookmarks to a pdf file. The file
bookmarks.txt
contains bookmarks in Chinese characters and in pdfmarks format. The output of gs
shows that there seem to be some problem with the font. Is there some way to solve the problem? Thanks in advance!
$ gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=out.pdf note.pdf bookmarks.txt
GPL Ghostscript 9.05 (2012-02-08)
Copyright (C) 2010 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 102.
Page 1
Substituting font Times-Bold for Times New Roman,Bold.
Loading NimbusRomNo9L-Medi font from /usr/share/fonts/type1/gsfonts/n021004l.pfb... 2889932 1499918 3254752 1759198 3 done.
Substituting font Times-Roman for Times New Roman.
Loading NimbusRomNo9L-Regu font from /usr/share/fonts/type1/gsfonts/n021003l.pfb... 2993796 1627069 4166144 2692107 3 done.
Page 2
Substituting font Times-Roman for Times New Roman.
Page 3
Substituting font Times-Roman for Times New Roman.
Page 4
Can't find (or can't open) font file /usr/share/ghostscript/9.05/Resource/Font/Arial-BoldMT.
Can't find (or can't open) font file Arial-BoldMT.
Can't find (or can't open) font file /usr/share/ghostscript/9.05/Resource/Font/Arial-BoldMT.
Can't find (or can't open) font file Arial-BoldMT.
Querying operating system for font files...
Loading Arial-BoldMT font from /usr/share/fonts/truetype/msttcorefonts/arialbd.ttf... 3073992 1671962 5497244 3026723 3 done.
Loading ArialMT font from /usr/share/fonts/truetype/msttcorefonts/Arial.ttf... 3074368 1692578 5853472 3515223 3 done.
Substituting font Times-Roman for Times New Roman.
Page 5
Substituting font Times-Roman for Times New Roman.
Page 6
Substituting font Times-Roman for Times New Roman.
Page 7
Page 8
Loading Arial-BoldMT font from /usr/share/fonts/truetype/msttcorefonts/arialbd.ttf... 3074180 1679830 4371296 2897061 3 done.
Substituting font Times-Roman for Times New Roman.
Page 9
Substituting font Times-Roman for Times New Roman.
Substituting font Times-Bold for Times New Roman,Bold.
Loading Arial-BoldMT font from /usr/share/fonts/truetype/msttcorefonts/arialbd.ttf... 3073992 1671819 4631712 2938526 3 done.
Loading ArialMT font from /usr/share/fonts/truetype/msttcorefonts/Arial.ttf... 3073992 1672099 4987940 3383317 3 done.
Page 10
Loading ArialMT font from /usr/share/fonts/truetype/msttcorefonts/Arial.ttf... 3094652 1711038 3749692 2384326 3 done.
The font map files of my GhostScript is under /usr/share/ghostscript/9.05/Resource/Init
, and can be viewed here
[Fontmap](https://dl.dropboxusercontent.com/u/13029929/fonts/Fontmap) and
[Fontmap.GS](https://dl.dropboxusercontent.com/u/13029929/fonts/Fontmap.GS) .
I have installed ttf-mscorefonts-installer
, and
$ ls /usr/share/fonts/truetype/msttcorefonts/
Andale_Mono.ttf Georgia.ttf
andalemo.ttf georgiaz.ttf
arialbd.ttf impact.ttf
arialbi.ttf Impact.ttf
Arial_Black.ttf timesbd.ttf
Arial_Bold_Italic.ttf timesbi.ttf
Arial_Bold.ttf timesi.ttf
Arial_Italic.ttf Times_New_Roman_Bold_Italic.ttf
ariali.ttf Times_New_Roman_Bold.ttf
arial.ttf Times_New_Roman_Italic.ttf
Arial.ttf Times_New_Roman.ttf
ariblk.ttf times.ttf
comicbd.ttf trebucbd.ttf
Comic_Sans_MS_Bold.ttf trebucbi.ttf
Comic_Sans_MS.ttf Trebuchet_MS_Bold_Italic.ttf
comic.ttf Trebuchet_MS_Bold.ttf
courbd.ttf Trebuchet_MS_Italic.ttf
courbi.ttf Trebuchet_MS.ttf
Courier_New_Bold_Italic.ttf trebucit.ttf
Courier_New_Bold.ttf trebuc.ttf
Courier_New_Italic.ttf Verdana_Bold_Italic.ttf
Courier_New.ttf Verdana_Bold.ttf
couri.ttf verdanab.ttf
cour.ttf Verdana_Italic.ttf
Georgia_Bold_Italic.ttf verdanai.ttf
Georgia_Bold.ttf verdana.ttf
georgiab.ttf Verdana.ttf
Georgia_Italic.ttf verdanaz.ttf
georgiai.ttf webdings.ttf
georgia.ttf Webdings.ttf
***********************************
updated
The error is that in [the generated pdf file](https://dl.dropboxusercontent.com/u/13029929/fonts/out.pdf) , the bookmarks are not Chinese characters but unrecognizable (if you view it in evince, click side pane and then index). I suspect the substitution is the reason (or do I misunderstand the cause of the problem?)
Here is the updated [Fontmap.GS](https://dl.dropboxusercontent.com/u/13029929/fonts/Fontmap.GS) , after adding the font files for the four types of Times New Roman fonts
Here is [the output of running the above command using gs
](https://dl.dropboxusercontent.com/u/13029929/fonts/output_gs.txt)
Asked by user66259
Apr 26, 2014, 11:21 PM
Last activity: May 22, 2023, 05:06 PM
Last activity: May 22, 2023, 05:06 PM