PREFACE
I understand this is a little harder since I can't provide the actual pdf, but the question boils down to a more general ghostscript config question so I don't think the pdf is needed.
I have a pdf. I am trying to repair with ghostscript. It is trying to use the font
STHeitiSC-Light
which is supposed to be embedded in the pdf, but it doesn't appear to be correctly embedded. I tried to fix it with popplerutils; when I run
pdftocairo -pdf bad_pdf.pdf repaired.pdf
I get this super informative error message:
some font thing failed
some font thing failed
gs -o repaired.pdf -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress bad_pdf.pdf
I get
**** Warning: can't process font stream, loading font by the name.
Can't find CID font "STHeitiSC-Light
".
Attempting to substitute CID font/Adobe-Identity
for/STHeitiSC-Light
,
seedoc/Use.htm#CIDFontSubstitution
.
The substitute CID font "Adobe-Identity
" is not provided either.
attempting to use fallbackCIDFont
.Seedoc/Use.htm#CIDFontSubstitution
.
The fallback CID font "CIDFallBack
" is not provided.
Finally attempting to useArtifexBullet
.
**** Error reading a content stream. The page may be incomplete.
**** File did not complete the page properly and may be damaged
So, I made sure I have STHeitiSC-Light installed on my system. I added a ttf to
/usr/share/fonts/truetype/STHeitiSC-Light.ttf
And I updated my cidfmap with
/STHeitiSC-Light << /FileType /TrueType /Path (/usr/share/fonts/truetype/STHeitiSC-Light.ttf) /SubfontID 0 /CSI [(Identity) 0] >> ;
But the error still persists, so I'm not sure what to do. There is some text in the pdf using this font, I don't even care that the font is preserved, but currently, the pdf is rendered with that text blanked out.
STHeitiSC-Light
. Usingmutool clean -d
if necessary, identify the embedded font in the original pdf in an editor, and replace with the correct stream from the other pdf. Fixup object table withpdftk
or whatever comes handy. (It's hard to answer this question without being able to look at the damaged pdf).