Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

Problem loading/formatting pdf via html and css inline

$
0
0
Hello everyone!

I'm
using the methodfound attheAsposeto convert myhtmlandcssinpdf,
but
the fileis losingformatting
// Instantiate an object PDF class

Method:
Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf();// add the section to PDF document sections collectionAspose.Pdf.Generator.Section section = pdf.Sections.Add();// Read the contents of HTML file into StreamReader objectStreamReader r = File.OpenText(@"C:/Testes/myArchive.html");//Create text paragraphs containing HTML textAspose.Pdf.Generator.Text text2 = new Aspose.Pdf.Generator.Text(section, r.ReadToEnd());// enable the property to display HTML contents within their own formattingtext2.IsHtmlTagSupported = true;//Add the text paragraphs containing HTML text to the sectionsection.Paragraphs.Add(text2);//Save the pdf documentpdf.Save(@"C:/Testes/ResultOfConversionAspose.pdf");


The input file(html)andoutput(pdf)are attached.
Thanks andhope someone canhelp me.

Viewing all articles
Browse latest Browse all 3131

Trending Articles