locked
How to generate pdf of an invoice RRS feed

  • Question

  • User-1557173817 posted

    Hello i just created an invoice but i want to be able to download that invoice as a pdf. how can i do that.

    Wednesday, October 14, 2015 9:46 AM

Answers

  • User281315223 posted

    How did you create the invoice and what format is it currently in? The best approach to use may depend on this so I'll provide a few suggestions below and let you dig through them.

    Consider iTextSharp

    You will have to use iTextSharp (or another third-part PDF library) to actually generate the PDF itself, however you can call the necessary code to generate it within any method that you would like (including your a Button-Click event) and it is completely free for commercial use (this pertains to previous versions of iTextSharp, as I believe the licensing has changed, but you might want to review over the license).

    I have always found iTextSharp very easy to use and there is a good bit of documentation, tutorials and other resources online primarily due to the popularity of the library. Mikesdotnetting has a great intro to iTextSharp on his blog post here that I would recommend checking out as well as some of the following articles to get you started :

    If you need this for "Reporting"

    Obviously with most questions of this nature, there is not going to be any "best" answer as Reporting is one of those highly subjective topics that depends on your requirements and personal preferences.

    I don't have a ton of experience with working with open-source reporting tools (as the commerical options have always been available). However, there are lots of them available if you look around : 

    I would highly encourage downloading and playing around with each of these and determining the one that you like the most and is the easiest to work with. As you can see there are tons of choices out there and these were just a few of the more popular options.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, October 14, 2015 9:55 AM
  • User1508394307 posted

    iTextSharp is not free any longer and does not recommend to use its old version due to "legal reasons".

    Alternative to iTextSharp you could use PDFsharp & MigraDoc http://www.pdfsharp.net. They are free and open source (MIT License).

    Examples could be found on their website, e.g. http://www.pdfsharp.net/wiki/HelloWorld-sample.ashx 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, October 14, 2015 10:25 AM

All replies

  • User281315223 posted

    How did you create the invoice and what format is it currently in? The best approach to use may depend on this so I'll provide a few suggestions below and let you dig through them.

    Consider iTextSharp

    You will have to use iTextSharp (or another third-part PDF library) to actually generate the PDF itself, however you can call the necessary code to generate it within any method that you would like (including your a Button-Click event) and it is completely free for commercial use (this pertains to previous versions of iTextSharp, as I believe the licensing has changed, but you might want to review over the license).

    I have always found iTextSharp very easy to use and there is a good bit of documentation, tutorials and other resources online primarily due to the popularity of the library. Mikesdotnetting has a great intro to iTextSharp on his blog post here that I would recommend checking out as well as some of the following articles to get you started :

    If you need this for "Reporting"

    Obviously with most questions of this nature, there is not going to be any "best" answer as Reporting is one of those highly subjective topics that depends on your requirements and personal preferences.

    I don't have a ton of experience with working with open-source reporting tools (as the commerical options have always been available). However, there are lots of them available if you look around : 

    I would highly encourage downloading and playing around with each of these and determining the one that you like the most and is the easiest to work with. As you can see there are tons of choices out there and these were just a few of the more popular options.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, October 14, 2015 9:55 AM
  • User1508394307 posted

    iTextSharp is not free any longer and does not recommend to use its old version due to "legal reasons".

    Alternative to iTextSharp you could use PDFsharp & MigraDoc http://www.pdfsharp.net. They are free and open source (MIT License).

    Examples could be found on their website, e.g. http://www.pdfsharp.net/wiki/HelloWorld-sample.ashx 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, October 14, 2015 10:25 AM