Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
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 18-Dec-12 23:46pm
Comments
Kuthuparakkal at 19-Dec-12 5:35am
   
Use iTextSharp Library
Jasbeer Singh at 19-Dec-12 5:56am
   
i used itextsharp.dll
 
but in coding i am having some problem.
Dave Kreskowiak at 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 at 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
good
Please Sign up or sign in to vote.

Solution 1

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();
  Permalink  

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



Advertise | Privacy | Mobile
Web01 | 2.8.150129.1 | Last Updated 20 Dec 2012
Copyright © CodeProject, 1999-2015
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