Displaying Chinese documents with missing fonts.

Q:

I have a PDF with Chinese text. The font is not embedded (i.e. it is
missing).
The font used is Simsun, but the printed copy does not shows the
correct text.

I use the following code it add my font substitutes:

PDFNet.Initialize();
bool found = pdftron.PDFNet.SetResourcesPath
(@"C:\Invoicing\PDFNetDemo\PDFNetDemo\resources");

PDFNet.AddFontSubst("SimSun",
"C:/WINDOWS/Fonts/AdobeSongStd-Light.otf");
PDFNet.AddFontSubst("Adobe Sans MM",
"C:/WINDOWS/Fonts/AdobeMingStd-Light.otf");

pdfdoc = new pdftron.PDF.PDFDoc(FilePath);
pdfdoc.InitSecurityHandler();
...
---
A:

The test file you sent is not displaying properly even in Acrobat with
Asian Font Pack.

The problem is that the text is using custom encoding and not Unicode
'Identity' coding. This is probably a bug in the software that
generated your PDF. These days there are so many poor quality PDF
generation APIs and a great care needs to be put in selecting the right
library.

You could use CosEdit utility (www.pdftron.com/cosedit) to fix this
type of problems.
Basically you would need to replace the 'Ordering' entry in
CIDSystemInfo dictionary to 'CNS1' (CIDSystemInfo is located under
'trailer/Root/Pages/Kids/0/Resources/Font/F5/DescendantFonts/0/CIDSystemInfo').

You can find the fixed file in the attachment.

Using PDFNet SDK (www.pdftron.com/net) it is also possible to fix this
type of problems programmatically (prior to rasterization) using
SDF/Cos API.