Hi @arjunsingh
Try the following
<asp:TextBox ID="txtCompanyQuote" runat="server" />
<asp:Button Text="Export" runat="server" OnClick="btnExport_Click" />
Code
protected void btnExport_Click(object sender, EventArgs e)
{
string pdfpath = Server.MapPath("PDFs");
string imagepath = Server.MapPath("Images");
Document doc = new Document();
PdfWriter.GetInstance(doc, new FileStream(pdfpath + "/Images.pdf", FileMode.Create));
doc.Open();
doc.Add(new Paragraph(this.txtCompanyQuote.Text.Trim()));
iTextSharp.text.Image gif = iTextSharp.text.Image.GetInstance(imagepath + "/Chrysanthemum.jpg");
gif.ScalePercent(24f);
doc.Add(gif);
doc.Close();
}
Namespaces
using System;
using System.IO;
using iTextSharp.text;
using iTextSharp.text.pdf;