Hi,
's. Viewing the HTML file in browsers shows the line break working correctly, however when converting the HTML to PDF the style seems to be ignored? I saw there was an issue on using CSS selectors with Aspose, so I tried inline style on each | but that had the same result. Is there something I am missing or a way to get output a PDF with the correct layout. Below is the HTML I am trying to convert.
body > table > tbody > tr > td {
display: block;
}
This is test code 1 using word library
Aspose.Words.Document doc = new Aspose.Words.Document(this.pickupTestLocation);
doc.Save(this.dropLocation);
This is another test code 2 using the PDF library
Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf();
// add the section to PDF document sections collection
Aspose.Pdf.Generator.Section section = pdf.Sections.Add();
// Read the contents of HTML file into StreamReader object
StreamReader r = File.OpenText(this.pickupTestLocation);
//Create text paragraphs containing HTML text
Aspose.Pdf.Generator.Text text2 = new Aspose.Pdf.Generator.Text(section, r.ReadToEnd());
// enable the property to display HTML contents within their own formatting
text2.IsHtmlTagSupported = true;
//Add the text paragraphs containing HTML text to the section
section.Paragraphs.Add(text2);
if (File.Exists(this.dropLocation))
{
File.Delete(this.dropLocation);
}
//Save the pdf document
pdf.Save(this.dropLocation);
Thanks,
Charles
|