Click here to Skip to main content
15,908,111 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello

i am generating an invoice in website, i can print it using javascript.
Now i want another option, if i click on the button export as pdf(BUTTON), it should save as pdf or it should get downloaded as pdf on computer,. Is there any wayto do this.

Thanks.
Posted
Comments
Kuthuparakkal 19-Dec-12 5:35am    
Use iTextSharp Library
Jasbeer Singh 19-Dec-12 5:56am    
i used itextsharp.dll

but in coding i am having some problem.
Dave Kreskowiak 19-Dec-12 14:38pm    
...AND THE PROBLEM WOULD BE.........WHAT exactly?? If you don't tell us what the problem is, the chances of getting a useful answer are absolutely 0.
Jasbeer Singh 20-Dec-12 2:25am    
i am showing data in panel. now i want to download data as a pdf on the button click,

1 solution

C#
Response.Buffer = true;
                   Response.Clear();

                   //Response.Charset = "Unicode";
                   Response.ContentType = mimeType;
                   Response.ContentType = "application/pdf";
                   Response.AddHeader("content-disposition", "attachment; filename=" + "invoice.pdf");
                   Response.BinaryWrite(bytes); // create the file
                   Response.Flush();
 
Share this answer
 

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