Hello
I would like to use this product to my company, but I cannot see how to convert an ASPX page into pdf
I just found convert a html page
but I need for an aspx
how can I do?
could you help me please?
Thank you so much
Hi Siva,
Thanks for your inquiry. You can get the html representation of your ASPX page and then save that html to Word document or even to PDF format by using using Aspose.Words for .NET. Please see the following code snippet:
protected override void Render(HtmlTextWriter output)
{<o:p></o:p>
// Get HTML of the page<o:p></o:p>
System.IO.StringWriter oStringWriter = new StringWriter();<o:p></o:p>
System.Web.UI.HtmlTextWriter oHtmlTextWriter = new HtmlTextWriter(oStringWriter);<o:p></o:p>
base.Render(oHtmlTextWriter);<o:p></o:p>
StringReader reader = new StringReader(oStringWriter.ToString());<o:p></o:p>
MemoryStream stream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(reader.ReadToEnd()));<o:p></o:p>
Document doc = new Document(stream);<o:p></o:p>
doc.Save(Response, “ASPX to PDF.docx”, ContentDisposition.Inline, null);<o:p></o:p>
}<o:p></o:p>
I hope, this helps.
Best regards,