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:28

Not sure what your goal is here, but there is an opensource php-library called fpdf, which also has an extension for taking a pre-made pdf as layout and then populate it with more content, generating a new PDF with that info.

However, I would go for a solution that you can integrate nicely into the plattform you're building, but I wouldn't go in a HTML->PDF solution since you won't have any clue about what would fit on a piece of paper regarding sizes in that kind of enviroment, meaning you won't know when you should split the content into two separate templates.

查看更多
一纸荒年 Trace。
3楼-- · 2019-01-31 09:32

OK, a search of Google Code projects turned up Simple Invoices, which is awesome and well maintained.

查看更多
爱情/是我丢掉的垃圾
4楼-- · 2019-01-31 09:33

If you want browser perfect HTML converted to PDF then try commandlineprint

You'll need to install firefox on a linux distro, disable all firefox alerts and then run it through a virtual display. Check this thread for more details.

It's infuriating to get running well but does give you the best results for HTML to PDF conversion I've seen.

查看更多
淡お忘
5楼-- · 2019-01-31 09:33

For a Ruby solution, try Prawn: http://prawn.majesticseacreature.com/

查看更多
闹够了就滚
6楼-- · 2019-01-31 09:33

Some can use Dhek template editor to define area/placeholder for existing PDF, without altering existing document, and then populate it to generate final doc (e.g. with user values from a form): https://github.com/applicius/dhek .

查看更多
Lonely孤独者°
7楼-- · 2019-01-31 09:34
登录 后发表回答