Set font encoding when saving to PDF

Hi,

is it possible to specify encoding of the font in the exported PDF.
When I check the document properties in the Adobe Reader I can see that fonts have Ansi or Identity-H encoding (please find attached print screen).
I need to embbed font with custom endoding.

Thanks in advance.
Best regards,

Jakub

Hi Jakub,

Thanks for your inquiry. Please set PdfSaveOptions.EmbedFullFonts property to true to embed fonts into output Pdf. Please check following code example. Hope this helps you.

//
Load the document to render.
Document doc = new Document(MyDir + "Rendering.doc");
// Aspose.Words embeds full fonts by default when EmbedFullFonts is set to true. The property below can be changed
// each time a document is rendered.
PdfSaveOptions options = new PdfSaveOptions();
options.EmbedFullFonts = true;
// The output PDF will be embedded with all fonts found in the document.
doc.Save(MyDir + "Rendering.EmbedFullFonts Out.pdf");

If you still face problem, please share your input document, custom fonts and encoding, and expected output document. We will then provide you more information about this.

Hi,

as you can see in the attached screen fonts are embedded o it’s not the problem. I was asking about font encoding.

Br,
Jakub

Hi Jakub,

Thanks for your inquiry. Please note that Aspose.Words mimics the same behaviour as MS Word does. If you convert your document to Pdf using MS Word and Aspose.Words, the font’s encoding is added in output Pdf.

Please use latest version of Aspose.Words for Java 16.10.0 and let us know if you face any issue. If you still face problem, please share your input document, custom fonts and encoding, and expected output document. We will then provide you more information about this.