We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Does Aspose.PDF follow OpenType or TrueType specification

Hi,

We want to use “Arial Unicode MS” while convert html to pdf using Aspose.PDF. And we want to embed the font into pdf.
Does Aspose.PDF follow the rules and restrictions defined in the OpenType or TrueType specification? Can we use “Arial Unicode MS” in pdf file and embed font into pdf? Do you have suggestion for us?

@lucy.hq

You can achieve your requirements by using the below sample code snippet:

// Instantiate Document object
Document docc = new Document();
// Add a page to pages collection of PDF file
Page page = docc.getPages().add();
// Instantiate HtmlFragment with HTML contnets
HtmlFragment title = new HtmlFragment("<p style='font-family: Verdana'><b><i>Table contains text</i></b></p>");
//Font-family from 'Verdana' will be reset to 'Arial'
title.setTextState(new TextState("ArialUnicodeMS"));
title.getTextState().setFontSize(20);
title.getTextState().getFont().setEmbedded(true);
page.getParagraphs().add(title);
// Save PDF file
dataDir = dataDir + "AddHTMLUsingDOMAndOverwrite_out.pdf";
// Save PDF file
doc.save(dataDir);

Can you please explain a bit more about above question by sharing some rules list or online link reference? We will share our feedback with you accordingly.