Free Support Forum - aspose.com

Html tag <b> is not working

Hi,

I am migrating from ASPOSE 3.6.2 to 17.3. I noticed that behavior of IsHtmlTagSupported has been changed.I am using XML template to create PDF.

In following XML “” tag is not working.

<b>bold text 1</b> More text. <br><b>bold text 2</b><br><br> another line..

Can you please let me know if I am doing something wrong.

Thanks

Just realize that code of XML template doesn’t appear in my previous post. I am attaching screenshot of XML.

image.png (5.9 KB)

Thanks

@vconstantinou,
In your attached screenshot of XML, there is no HTML bold tag in the content. Kindly recheck and fix it, however, if this does not help, then send us an XML template file. We will investigate and share our findings with you.

Best Regards,
Imran Rafique

HTML tags are encoded e.g. “& lt ;b & gt;”.

I have also tried to add html tag without encode. Please find attached template file.

template.zip (687 Bytes)

Thanks

@vconstantinou,
Thank you for posting a template XML. We managed to replicate the said problem in our environment. It has been logged under the ticket ID PDFJAVA-36867 in our bug tracking system. We have linked your post to this ticket and will keep you informed regarding any available updates.

Best Regards,
Imran Rafique

Thanks for the update. Just to let you know that we are using ASPOSE PDF for .NET.

Best Regards

@vconstantinou,
Thank you for the details. Please note, you are using an old XML structure in your input templates and the latest version 17.6 of Aspose.Pdf for .NET API does not support it. You can use only the old versions of Aspose.Pdf for .NET API to manipulate the old structured XML templates and we do not provide fixes in the old code base.

We would recommend you to convert the old XML templates based on the new XML structure, and then convert XML templates to the PDF format. We have created an XML template with HTML bold tagtemplatenew.zip (396 Bytes), and it works fine in the new DOM approach Resultant_17.3.pdf (53.8 KB).

Source code:
[C#]

// instantiate Document object
Document doc = new Document();
// bind source XML file
doc.BindXml(@"C:\Pdf\test130\templatenew.xml", null);
// save resultant PDF file
doc.Save(@"C:\Pdf\test130\Resultant_17.3.pdf");

Please let us know in case of any further assistance or questions. In order to get more understanding, please refer to these help topics: Convert XML file to PDF and Add HtmlFragment element in XML file. The ticket ID PDFJAVA-36867 has been closed.

Best Regards,
Imran Rafique

Hi Imran,

I am not able to download templatenew.zip and other attachments. Can you please attach it again or send me through email.

Thanks

@vconstantinou,
Please download files from this link: FilesZip.zip

Best Regards,
Imran Rafique