generating great number of pdf with template, anyone exp.?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dermoritz
Forum Newbie
Posts: 9
Joined: Fri May 18, 2007 3:13 am

generating great number of pdf with template, anyone exp.?

Post by dermoritz »

so i am looking for a solution to create a great number of pdf (invoices) once a month. i need a possibility to use a template for the invoice, modifiable by the user. the data for the invoices comes from a mysql database. so the dynamical data is a table with fix number of columns and dynamical number of rows.

i already searched this forum and others and i found many "building blocks" to do this:
fpdf, ezpdf, pdflib... for generating pdf, html2pdf(many with this and similar names) for converting html to pdf (interesting if i use a html template for the invoice, created by a wysiwyg editor like tinymce), fpdi (if the template is a pdf file).

i am looking for people with experience in this field or especial in a similar situation.
what would you use/ what you used? with out an advice i would try fpdf with fpdi or with some html2pdf class, good idea?
User avatar
stereofrog
Forum Contributor
Posts: 386
Joined: Mon Dec 04, 2006 6:10 am

Post by stereofrog »

fpdf/fpdi works just fine
dermoritz
Forum Newbie
Posts: 9
Joined: Fri May 18, 2007 3:13 am

Post by dermoritz »

the only problem with fpdi is the need of an commercial pdf creator like acrobat, isn't it? no it isn't :-) - open office can create pdf?

so fpdf/fpdi seems to be a good solution. has anyone some experience with fpdf/fpdi in conjunction with generating invoices/tables?
User avatar
stereofrog
Forum Contributor
Posts: 386
Joined: Mon Dec 04, 2006 6:10 am

Post by stereofrog »

You can either start from scratch and create the whole document via FPDF scripting. or make a PDF template (in Acrobat, or using one of "pdf creators" available freely or online) and process it further with FPDI. It apparently depends on how visually complex your template is.
dermoritz
Forum Newbie
Posts: 9
Joined: Fri May 18, 2007 3:13 am

Post by dermoritz »

because its an invoice, the template would include a header, a footer and some table layout between them. this should be easy modifiable by any user.
the question is how appropriate is fpdf/fpdi for this use case.
dermoritz
Forum Newbie
Posts: 9
Joined: Fri May 18, 2007 3:13 am

Post by dermoritz »

in: viewtopic.php?t=30157
on the second page, i wrote how i want to solve the problem. the question is: is it possible this way?
dermoritz
Forum Newbie
Posts: 9
Joined: Fri May 18, 2007 3:13 am

Post by dermoritz »

ok i learned form the author of fpdi, that there is no concept of an "placeholder" in fpdi. all elements to be inserted in the template must be positioned via php/fpdf code :-(.

but is there an possibility to get certain positions of "elements" from the template. i mean is it possible to place data relativly to elements from template? i'dont want to change the php code every time the template is changed.
Post Reply