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

Html to Pdf doesn't work?

$
0
0
My company has purchased the Aspose.Total product.  One of the main reasons we bought this product was the HTML-to-PDF conversion capabilities and now that we are attempting to do this conversion, we can't seem to make it work.  We originally did a prototype of this functionality maybe a year and a half ago and it worked fine, but it appears that the API has changed quite a bit with the latest versions.

The code seems fairly straightforward - below is what I'm trying to do.  I will attach my sample HTML file as well as the resulting PDF which isn't even in the ballpark of looking correct.  The only support page I can find that seems relevant on HTML to PDF conversion is not helpful (http://www.aspose.com/docs/display/pdfnet/How+to+convert+HTML+to+PDF+using+InLineHTML+approach).

Please let me know if you need our license file so I can email.  Also, I can send the snippet of code from the older versions of the Aspose.Pdf.Kit product that we originally used to prototype where this seemed to work.  

    // Get a stream representing the sample html file            Stream wordStream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(SAMPLE_HTML_FILE);                        // Read the contents of HTML file into StreamReader object            StreamReader r = new StreamReader(htmlStream);            AsposePdf.Generator.Pdf pdf = new AsposePdf.Generator.Pdf();            AsposePdf.Generator.Section section = pdf.Sections.Add();            AsposePdf.Generator.Text text = new AsposePdf.Generator.Text(section, r.ReadToEnd());            text.IsHtmlTagSupported = true;            section.Paragraphs.Add(text);            pdf.Save(@"C:\content\formtest.pdf");

Viewing all articles
Browse latest Browse all 3131

Trending Articles