How to fix font loading

Product: .NET

Product Version: V9.0.7.7522

Please give a brief summary of your issue:

Some font files cannot be loaded using this method: public static bool AddFontSubst(string fontname, string fontpath);

But it can be used :public static bool AddFontSubst(CharacterOrdering ordering, string fontpath);

However, text without embedded fonts is still not displayed correctly,

How to fix it.



字体-未嵌入.pdf (28.4 KB)

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

However, text without embedded fonts is still not displayed correctly,

Correct, with out the Fonts embedded in the PDF, no PDF reader can guarantee that the PDF will look the same on every platform/device.

How to fix it.

Ideally the author of the PDF embeds the fonts.

Otherwise, you would have to embed the fonts, by processing the PDF on a machine that has all the required fonts. Please see this forum post on how to do that.

Also, if you update to newer versions of PDFNet that PDFNet.AddResourceSearchPath is probably an easier/better API to use over AddFontSubst functions.
https://www.pdftron.com/api/PDFTronSDK/dotnet/pdftron.PDFNet.html#pdftron_PDFNet_AddResourceSearchPath_System_String_

The font file path should not contain Chinese characters. We look forward to your subsequent versions to fix this problem.

We look forward to your subsequent versions to fix this problem.

There is no problem to fix, at least as described so far.

If you think there is a problem with the SDK , then to investigate further could you please provide the following information.

  1. Input file(s)
  2. Generated output file(s)
  3. Code and settings used to generate (2) from (1)
  4. Screenshots showing the output, and clearly indicating what you expected to get instead, and also clearly indicating the application/browser being used to view.