Custom font does not embed into output PDF using .NET

We are trying to preserve custom fonts when converting a .doc to .pdf using Aspose.Words (although we do have the full Aspose collection available).

We are using Doc Load options:

oLoadOptions = NEW Aspose.Words.LoadOptions().
oLoadOptions:LoadFormat = Aspose.Words.LoadFormat:Doc.

And setting the following properties of the save options:

oSaveOptions = NEW Aspose.Words.Saving.PdfSaveOptions().
oSaveOptions:SaveFormat = Aspose.Words.SaveFormat:Pdf.
oSaveOptions:EmbedFullFonts = TRUE.
oSaveOptions:FontEmbeddingMode = Aspose.Words.Saving.PdfFontEmbeddingMode:EmbedAll.
oSaveOptions:EmbedStandardWindowsFonts = TRUE.

We are setting the following properties on the document font info:

oDoc:FontInfos:EmbedTrueTypeFonts = TRUE.
oDoc:FontInfos:SaveSubsetFonts = TRUE.
oDoc:FontInfos:EmbedSystemFonts = TRUE.

By cycling through the fonts on the document fontinfo, we can confirm that the custom font is embedded in the original document and is set as a True Type font.

However, Adobe Acrobat Reader does not display the custom font in the list of fonts in the document properties.

Please advise as to what we are missing to enable the custom font to be embedded in the pdf document.

@sam.marlow

To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document.
  • Please attach the output PDF file that shows the undesired behavior.
  • Please attach the custom fonts used in your document.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

DocToPdf-FSMatthew.zip (1.2 MB)

Good morning,

I have uploaded the requested files.

Please also advise how we can raise a Support Ticket, as we have a full licence.

Thank you.

@sam.marlow

We have tested the scenario using the latest version of Aspose.Words for .NET 20.2 and have not found the shared issue. So, please use Aspose.Words for .NET 20.2.

Please will you send me your PDF file so that we can check the working output?

Thanks

@sam.marlow

Please get the output PDF file generated by latest version of Aspose.Words in attachment. 20.2.pdf (728.7 KB)

If you still have it available, please will you provide the script that you used to successfully create the output?

Thank you,
Sam

@sam.marlow

We used the following C# code example to generate the PDF file.

Document doc = new Document(MyDir + "input.docx");
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
pdfSaveOptions.EmbedFullFonts = true;
pdfSaveOptions.FontEmbeddingMode = PdfFontEmbeddingMode.EmbedAll;

doc.Save(MyDir + "20.2.pdf", pdfSaveOptions);

Excellent. Thank you very much for your help