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

Free Support Forum - aspose.com

Cannot convert spanish HTML to pdf with accents

Hello I am trying to take Html pages and convert them to Pdf pages in all languages. When trying to test with a Spanish page I keep getting random characters in place of words with accent marks. Here is my conversion code, I’ve attached the html file I’m using and the testPath variable is just opening that HTML file



string strHtml = File.ReadAllText(testPath);
var testDoc = new Document();
DocumentBuilder db = new DocumentBuilder(testDoc);
db.InsertHtml(strHtml );
db.Font.LocaleId = 13322;
db.Document.Save(“test” + “.pdf”, SaveFormat.Pdf);

Hi there,

Thanks for your inquiry. Please note that Aspose.Words requires TrueType fonts when rendering documents to fixed-page formats (JPEG, PNG, PDF or XPS). You need to install fonts that are used in your document on the machine where you’re converting documents to Pdf. Please refer to the following articles:

How Aspose.Words Uses True Type Fonts

We have tested the scenario using latest version of Aspose.Words for .NET 17.3.0 and have not found the shared issue. Please use Aspose.Words for .NET 17.3.0. We have attached the output pdf with this post for your kind reference.