Click here to Skip to main content
13,346,397 members (63,214 online)
Rate this:
Please Sign up or sign in to vote.
See more:

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.

Posted 18-Dec-12 23:46pm
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

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Response.Buffer = true;

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

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.180111.1 | Last Updated 20 Dec 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100