Convert HTML to PDF in C# with SQL Data| Generate PDF from SQL | Create PDF from database in C#

preview_player
Показать описание
In this video I am going to show how can Convert HTML to PDF with SQL Data in C# dynamically. Using iText7 library we can Generate PDF document from SQL very easily.

#htmltopdf
#CodeSample
#pdffromsql

In this tutorial I have used the following tools
1. Visual Studio 2019 Community Edition
2. itext7 HTML to PDF NuGet library

Download Source
Рекомендации по теме
Комментарии
Автор

Thank you very much for this excellent tutorial 🤗

tess...
Автор

Thanks for the tutorial. Can you guide how to add watermark through program and how to change PDF page size and orientation?

SamaresMandal
Автор

Thank u very much for ur explanation.
How can store the PDF in custom URL ?
like currently it is saving in local server and i want to save in a specific folder of hosting site.
Can we do that?
Thanks in advance.

phaninderkumar
Автор

Thank you for the video. Very useful. If we want to add headers and footers?

swapnarenukunta
Автор

Hello! What if I have much more data rows on view? How can I divide them to multiple pages? Thank you

answerrr
Автор

Hello! I used the same code for my project but I'm getting "Object reference not set to an instance of an object." error at HtmlConverter.ConvertToPdf(html, new FileStream(file, FileMode.Create), cp); line, could you please help me with this?

iamkbang
Автор

Hi there, Could you share the code please ?

renny
Автор

Hi guys, literally tried to execute and got this error back:

HtmlConverter.ConvertToPdf(html, new FileStream(destination, FileMode.Create), cp);

'Could not find a part of the path

This exception was originally thrown at this call stack:
[External Code]
pdf2.pdf.CreatePDFFromDatabase(string, string, string) in pdf.aspx.cs
pdf2.pdf.btnPDF_Click(object, System.EventArgs) in pdf.aspx.cs
[External Code]

MrValen
visit shbcf.ru