![]() ![]() Protected Overrides Sub Render(ByVal writer As .HtmlTextWriter)ĭim textWriter As System.IO.TextWriter = New System.IO.StringWriter()ĭim hTextWriter As .HtmlTextWriter = New .HtmlTextWriter(textWriter)ĭim htmlContent As String = textWriter.ToString()ĭim data As Byte() = Converter.ConvertHtmlString(htmlContent) Protected void btnConvertToPDF_Click(object sender, EventArgs e) Response.ContentType = "application/pdf" Response.AddHeader("Content-Disposition", "inline filename=output.pdf") Response.AddHeader("Content-Length", ()) String htmlContent = textWriter.ToString() īyte data = Converter.ConvertHtmlString(htmlContent) ![]() HtmlTextWriter hTextWriter = new HtmlTextWriter(textWriter) TextWriter textWriter = new StringWriter() Protected override void Render(HtmlTextWriter writer) The example presented here provides another technique for converting a web page to a PDF. ![]() Converting HTML content from a URL, an HTML file, or a string of HTML content is straightforward using DynamicPDF's Converter. If you wish to review more straightforward conversion techniques, see the topic Simple Converting for more methods for converting documents to PDFs. ![]() The following example illustrates converting HTML to PDF by taking current content directly from a web page's content and then converting that content to a PDF. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |