Jo, bei FPDF ists genauso - Jedes Element genau positionieren. Also hat man nicht direkt eine Vorlage, aber man kann das PDF-Objekt auch serialisieren und als "Vorlage" speichern.
Mit meinen XML-Parser für FPDF beschreibt man das PDF ähnlich einem HTML-File:
Code:
<template>
<!--<pdf orientation="P" unit="pt" format="A4">-->
<compression value="1" />
<page orientation="P">
<image src="../images/bg.png" height="223" x="60" y="240" />
<text x="250" y="40" width="300" font="Arial" fontsize="18" fontcolor="#000000">
<span fontcolor="#FFFF00" fontsize="20">III</span><span fontcolor="#FF0000" fontsize="24">I</span>
<span fontcolor="#00FFFF" fontsize="20">III</span>
COMPANY NAME
</text>
<text x="40" y="90" width="300" font="Arial" fontsize="12" fontcolor="#000000">
<span fontsize="6">setasign.webdesign · Juliusstraße 12 · D-38350 Helmstedt</span>
<br />
{FIRSTNAME} {LASTNAME}<br />
{COMPANY}
{STREET}<br />
<br />
{PLZ} {CITY}<br />
{LAND}
</text>
<text x="410" width="200">
<br /><br />
<br /><br />
<br />
Helmstedt, {DATE}
</text>
<text x="100" width="300">
<br /><br /><br />
<b><u>INVOICE No. {INVOICENUMBER}</u></b>
</text>
<text x="60" width="400">
<br /><br /><br />
According to our accepted conditions of use, we invoice the following:
</text>
<table x="60" y="+20" cellpadding="2" cellspacing="0" border="0" borderwidth="0.5">
<tr>
<td align="L" style="B" border="B">Number</td>
<td align="L" style="B" border="B">Units</td>
<td align="L" style="B" width="200" border="B">Description</td>
<td align="C" style="B" border="B">Price per<br />unit (Euro)</td>
<td align="C" style="B" border="B">Price of all<br />units (Euro)</td>
</tr>
<tr class="repeater" datasource="$GLOBALS[testdatas]">
<td align="C">{NUMBER}</td>
<td align="C">{UNITS}</td>
<td align="L" width="250">{DESCRIPTION}</td>
<td align="C">{UNITPRICE}</td>
<td align="C">{PRICE}</td>
</tr>
<tr>
<td border="T"></td>
<td border="T"></td>
<td align="R" border="T">VAT (16 %)</td>
<td border="T"></td>
<td border="TB" align="C">{VAT}</td>
</tr>
<tr>
<td></td>
<td></td>
<td align="R" style="B">Total amount</td>
<td></td>
<td border="T" style="BU" align="C">{TOTALAMOUNT}</td>
</tr>
</table>
<text x="70" y="580" font="Arial" fontsize="16" fontcolor="#000000" width="300">
Jan Slabon
</text>
<image src="../images/unterschr.png" x="60" y="600" width="197" />
<image src="../images/noaccess.jpg" x="350" y="580" width="100" if="$_GET[hidden]" />
<footer align="C" x="40" y="790" width="520" fontsize="6" lineheight="8">
setasign.webdesign · Juliusstraße 12 · D-38350 Helmstedt<br />
tel. +49 5351 596652 · fax +49 5351 596652 · e-mail info@setasign-webdesign.de · homepage http://www.setasign-webdesign.de<br/>
konto-nr. 5057831 - Nord LB Helmstedt (BLZ 250 500 00) · St.-Nr.: 28/139/04044
</footer>
</page>
<!--</pdf>-->
</template>
Das ganze ist noch nicht 100% ausgereift, da ich das ganze "nur" für 1-2 Rechnungen gebraucht habe und mir bisher die Zeit gefehlt hat, das Teil fertig zu bauen.
Gruss
Jan