What
is ITextSharp - iTextSharp is a free and open source
assembly which helps to convert page output or html content in pdf file.
You can download from here:
http://sourceforge.net/projects/itextsharp/
Now add that dll in application.
Getting
Started
Start visual studio and create a new website in asp.net
and add these 2 dll in solution.
Itextsharp.dll
itextsharp.pdfa.dll
add namespaces -
using iTextSharp.text;
using
iTextSharp.text.pdf;
using iTextSharp.text.html;
using
iTextSharp.text.html.simpleparser;
protected void btnCreatePDF_Click(object sender, EventArgs e)
{
Document doc = new Document(PageSize.A4, 10f, 10f, 100f,
0f);
string pdfFilePath = Server.MapPath(".") + "/PDFFiles";
PdfWriter writer = PdfAWriter.GetInstance(doc, new FileStream(pdfFilePath + "/Default.pdf", FileMode.Create));


moheb HossPosted Dec 11, 2023, 9:40 AM
The site at http://localhost:12727/ImageToPdf.aspx has experienced a network protocol violation that cannot be repaired.The page you are trying to view cannot be shown because an error in the data transmission was detected.
Guest UserPosted Jun 25, 2020, 7:31 PM
Image.ScalePercent doesn't work when testing from ipad
Surendra SagarPosted Mar 28, 2020, 6:47 AM
Hi I am Creating a pdf with image it is appearing at the middle of the some other content with out image control
rishma chawlaPosted Dec 4, 2018, 7:10 AM
This is not working, It creates pdf but without image
Jonathan BarqueroPosted Jul 20, 2017, 11:44 PM
Nice this is working thanks been struggling a bit til now
Abdul Amin KhanPosted Jul 27, 2016, 7:26 AM
When we writing image in PDF then it is occupied memory regularly and not releasing it. After some times it showing out of memory please tell me solution of that
Shourya VerdhanPosted Dec 2, 2015, 3:53 AM
HI, I am trying to add image in my existing pdf file and its adding new image but it is replacing old content from only image.