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.
// Get a stream representing the sample html file
Stream wordStream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(SAMPLE_HTML_FILE);<span style="color:green;">// Read the contents of HTML file into StreamReader object</span> <span style="color:#2b91af;">StreamReader</span> r = <span style="color:blue;">new</span> <span style="color:#2b91af;">StreamReader</span>(htmlStream); AsposePdf.Generator.<span style="color:#2b91af;">Pdf</span> pdf = <span style="color:blue;">new</span> AsposePdf.Generator.<span style="color:#2b91af;">Pdf</span>(); AsposePdf.Generator.<span style="color:#2b91af;">Section</span> section = pdf.Sections.Add(); AsposePdf.Generator.<span style="color:#2b91af;">Text</span> text = <span style="color:blue;">new</span> AsposePdf.Generator.<span style="color:#2b91af;">Text</span>(section, r.ReadToEnd()); text.IsHtmlTagSupported = <span style="color:blue;">true</span>; section.Paragraphs.Add(text); pdf.Save(<span style="color:#a31515;">@"C:\content\formtest.pdf"</span>);</pre></div>