Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Here in my page i have one Textbox and one Button.When i enter the text in textbox and press Submit button the Textbox value will be added in Pdf Document like

Enter u r Name:Benz

but my problem is when i press the submit button the data will be append on above the image in PDF Document.i want to display in the middile of the Document.
pls help me....
My Code is
C#
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "attachment;filename=Reports in PDF.pdf");
Response.Cache.SetCacheability(HttpCacheability.NoCache);
 StringWriter sw = new StringWriter();
sw.Write(lbl1.Text + ":" + txt1.Text);
HtmlTextWriter hw = new HtmlTextWriter(sw);
this.Page.RenderControl(hw);
StringReader sr = new StringReader(sw.ToString());
Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 100f, 0f);
HTMLWorker htmlparser = new HTMLWorker(pdfDoc);
PdfWriter.GetInstance(pdfDoc, Response.OutputStream);
pdfDoc.Open();
htmlparser.Parse(sr);
pdfDoc.Close();
Response.Write(pdfDoc);
Response.End();

it shows like
Name:BEnz
IMage
Nmae:
i want to display the textbox value in fron of Name.
pls Help me i search so many articles.but i didnt get answer.
pls help me.....
Posted
Updated 22-Mar-17 0:06am
v5

1 solution

Hi,

You can use 'WkHtmltoPdf.exe' to convert your html file to PDF file.
 
Share this answer
 
Comments
benzimen 1-Dec-14 8:32am    
can u give me
brief explanation....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900