Creating PDF Invoices - Are there any templating s

2019-01-31 09:12发布

Our company is looking to integrate invoices into a new system we are developing.

We require a solution to create a layout of the invoice and then convert to pdf.

We have considered just laying out the invoice in html/css then converting to pdf. We have also considered using SVG->PDf conversion.

Both of these solutions integrate well into our existing templating language used for our web application.

Historically we have been a Microsoft based business and used Crystal Reports for such a task but we are looking for an open source Linux solution for this project.

Does any one have any suggestions of an approach or technology we could use for such a task?

22条回答
混吃等死
2楼-- · 2019-01-31 09:36

It depends on your environment. If you have access to Java, you might look at iText (http://www.lowagie.com/iText/), a library that allows you to generate PDF files on the fly.

查看更多
迷人小祖宗
3楼-- · 2019-01-31 09:37

We use Reportlab with Python. If you look around there are a load of ready-made forms/invoices/etc.

查看更多
再贱就再见
4楼-- · 2019-01-31 09:39

There are two steps, if i understood correctly:
1) Creation of PDF template with placeholders to populate data programmatically
2) Populating the PDF template programmatically during run time

For #1, OpenOffice allows creation of PDF templates, which can then be populated programmatically. It's good enough to create simple invoices that doesn't probably involve datagrid/table kind of stuff.

For #2, you already have the answers here - iText, iTextSharp.

Hope this helps!

查看更多
做个烂人
5楼-- · 2019-01-31 09:40

I use TROFF for my invoices because of its extremely simple textual encoding. The logic is a few lines of Perl. Keeping it simple.

查看更多
Bombasti
6楼-- · 2019-01-31 09:41

html2pdf works very well. You can use this to generate both HTML and PDF reports from the same source.

查看更多
何必那么认真
7楼-- · 2019-01-31 09:41

I'm fiddling with Black Sheep Invoices right now, which is great at first but now I'm having trouble actually getting it to render the PDFs. Lots of installation difficulties--probably a lot easier on your own server but i'm up on a shared host with it. The HTML output and data management portions are well done though, which is something you won't get out of just creating a postscript template. I was hoping to find a reference to a library that has an active development team though (Black Sheep is not being updated at this time).

查看更多
登录 后发表回答