Print Div Contect To PDF in Asp.Net C# Step By Step | ProgrammingGeek
Usually we need to print or export to pdf of a portion of a web page or a specific content. If you face this situation and you need to print or export div content to pdf in asp.net this tutorial is for you. This tutorial teach you how to print or export div content into pdf in asp.net using C# step by step. You can also learn how to export a div tag that include GridView with record in asp.net c#.
Noted that its allowed to print div tag with GridView and label control. But you can not
print div content with executable control like button and textbox etc.
Noted that you must add references of ItextSharp. dll file what you can download from the link given below.
To download ItextSharp dll file go to this link
https://drive.google.com/file/d/1Y7FR4Z4_0oXExnFgmJrjTTDWzzmePLZs/view?usp=sharing
Complete CRUD Operation in Asp.Net C# With SQL Server Step By Step
https://youtu.be/I5cWkoMeQIY
//To print div tag into pdf you should add a method
public override void VerifyRenderingInServerForm(Control control)
{
}
//Visual Studio Code
protected void Button6_Click(object sender, EventArgs e)
{
Response.ContentType = "Application/pdf";
Response.AddHeader("Content-Disposition", "attachement; filename=YourFileName.pdf");
Response.Cache.SetCacheability(HttpCacheability.NoCache);
StringWriter sw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
DivToPrint.RenderControl(hw);
Document doc = new Document(PageSize.A4,50f,50f,100f,30f);
HTMLWorker htw = new HTMLWorker(doc);
PdfWriter.GetInstance(doc, Response.OutputStream);
doc.Open();
StringReader sr = new StringReader(sw.ToString());
htw.Parse(sr);
doc.Close();
Response.Write(doc);
Response.End();
}
------
This channel ProgrammingGeek covers all the programming tutorial related with .Net- C#, linq, VB, SQL, Android, HTML, CSS, jQuery, Crystal Report and Microsoft Report.
So, Please subscribe and keep in touch.
https://www.youtube.com/c/ProgrammingGeek/playlists
Visit my page in Facebook
https://www.facebook.com/programminggeek7
------
More Tags
#ExportDivContectToPDFInAspNet #PrintDivToPdfAspNet #ProgrammingGeek
programminggeek,export div to pdf in asp.net c#,print div to pdf in asp.net c#,export div content to pdf in asp.net,print div into pdf,print gridview to pdf in asp.net c#,how to print div with gridview in asp.net c#,print div to pdf,visual studio code,print div content,how to export div content to pdf,asp.net tutorial,asp.net div to pdf,print div content using jquery,export div tag to pdf
Видео Print Div Contect To PDF in Asp.Net C# Step By Step | ProgrammingGeek канала ProgrammingGeek
Noted that its allowed to print div tag with GridView and label control. But you can not
print div content with executable control like button and textbox etc.
Noted that you must add references of ItextSharp. dll file what you can download from the link given below.
To download ItextSharp dll file go to this link
https://drive.google.com/file/d/1Y7FR4Z4_0oXExnFgmJrjTTDWzzmePLZs/view?usp=sharing
Complete CRUD Operation in Asp.Net C# With SQL Server Step By Step
https://youtu.be/I5cWkoMeQIY
//To print div tag into pdf you should add a method
public override void VerifyRenderingInServerForm(Control control)
{
}
//Visual Studio Code
protected void Button6_Click(object sender, EventArgs e)
{
Response.ContentType = "Application/pdf";
Response.AddHeader("Content-Disposition", "attachement; filename=YourFileName.pdf");
Response.Cache.SetCacheability(HttpCacheability.NoCache);
StringWriter sw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
DivToPrint.RenderControl(hw);
Document doc = new Document(PageSize.A4,50f,50f,100f,30f);
HTMLWorker htw = new HTMLWorker(doc);
PdfWriter.GetInstance(doc, Response.OutputStream);
doc.Open();
StringReader sr = new StringReader(sw.ToString());
htw.Parse(sr);
doc.Close();
Response.Write(doc);
Response.End();
}
------
This channel ProgrammingGeek covers all the programming tutorial related with .Net- C#, linq, VB, SQL, Android, HTML, CSS, jQuery, Crystal Report and Microsoft Report.
So, Please subscribe and keep in touch.
https://www.youtube.com/c/ProgrammingGeek/playlists
Visit my page in Facebook
https://www.facebook.com/programminggeek7
------
More Tags
#ExportDivContectToPDFInAspNet #PrintDivToPdfAspNet #ProgrammingGeek
programminggeek,export div to pdf in asp.net c#,print div to pdf in asp.net c#,export div content to pdf in asp.net,print div into pdf,print gridview to pdf in asp.net c#,how to print div with gridview in asp.net c#,print div to pdf,visual studio code,print div content,how to export div content to pdf,asp.net tutorial,asp.net div to pdf,print div content using jquery,export div tag to pdf
Видео Print Div Contect To PDF in Asp.Net C# Step By Step | ProgrammingGeek канала ProgrammingGeek
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
Export gridview to pdf in asp.net - Part 58Complete CRUD Operation in Android Studio Java With SQL Server | ProgrammingGeekConvert ASPX Page to PDF in ASP.NET C#ASP.net MVC Integrating RDLC ReportHow to design a flat modern user login form in c# winformComo crear reportes en PDF con C# ✅ fácil y completo ✅How to Create Crystal Reports in Visual Studio 2015 in Asp.net c# with SQL | swift learnPrinting PDF in ASP NET MVC using RotativaHow to Generate PDF Report in Blazor - (Free) | Rotativa - WkhtmltopdfLoad Data from Excel Sheet to Gridview Asp.net C#CRUD Operations Using Database First Approach In Entity Framework Core 6 and ASP.NET Core MVC 6C# HOW TO PRINT DATAGRID USING DGVPRINTERConvert HTML to PDF in C# | Generate PDF in ASP.Net C# | How to generate PDF in ASP.Net using C#Print Contents Of A Div Element | HTML, CSS & JavascriptGet Data From SQL to TextBox Dynamically in Asp.Net c# using Linq | ProgrammingGeekC# Tutorial - Print Receipt using Report Viewer | FoxLearnAuthentication in ASP.NET MVC | Login & Signup Page | From ScratchConvert HTML to PDF in C# with SQL Data| Generate PDF from SQL | Create PDF from database in C#Generating PDF using C# + itextSharp