Free Support Forum - aspose.com

HTML Tags are not getting replaced properly

I download the trial version of the 4.1.1 control and converting Html to PDF the resulting PDF has special characters and the formatting is not getting applied.

I used the following code

// Instantiate an object PDF class

Pdf pdf = new Pdf();

// add the section to PDF document sections collection

Aspose.Pdf.Section section = pdf.Sections.Add();

// Cteate a text object with sample text

Text text1 = new Text("HTML contents will be displayed under this line");

// Change the text Color

text1.TextInfo.Color = new Aspose.Pdf.Color("Navy");

// Change the text size

text1.TextInfo.FontSize = 16;

// Add the text object to PDF sections

section.Paragraphs.Add(text1);

//Create text paragraphs containing HTML text

Aspose.Pdf.Text text2 = new Aspose.Pdf.Text(section, HtmlData);

// enable the property to display HTML contents within their own formatting

text2.IsHtmlTagSupported = true;

//Add the text paragraphs containing HTML text to the section

// Set the Font of Section as "Verdana"

text2.TextInfo.FontName = "Verdana";

// Add the text object containing HTML contents to PD Sections

section.Paragraphs.Add(text2);

//Save the pdf document

pdf.Save(FormPDFPath);

The attachment shows the resulting PDF file. Please let me know what I need to change or set to have the PDF generated.

Hello Amir,

Thanks for considering Aspose.

Can you please share the resource HTML file that you're using so that we can test the scenario at our end.

We apologize for your inconvenience.

I’m also having this exact same issue, pdf left funny char and html tag is not being used.

eg: “Drink Recipe” heading need to be h1 tag (

Drink Recipe

)


Hello Kenny,

Thanks for considering Aspose.

Please share the resource HTML so that we can test the scenario at our end. We are really sorry for your inconvenience.

Here is the html as requested.

Drink Recipe

Drink Item 1

Lorem ipsum dolor sit amet...

Drink Item 2

Lorem ipsum dolor sit amet...

Drink Item 3

Lorem ipsum dolor sit amet...

Hello Kenny,

Thanks for sharing the information.

I’ve tested the scenario and I’m able to notice that

tag is not properly being rendered inside the PDF document. I've logged this issue as PDFNET-13378 in our issue tracking system. We would definitely look into the details of this matter and will keep you updated with the status of correction.

We apologize for your inconvenience.

Hi,

Thanks for your patience.

I’m pleased to inform you that the issue reported earlier has been fixed in the attached HotFix. Please try using it and in case you still face any problem or you’ve any further query, please feel free to contact.

Thanks for your cooperation.

The issues you have found earlier (filed as 13378) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.