31,003
edits
| Line 19: | Line 19: | ||
# Test this model (see previous section) before going further ... | # Test this model (see previous section) before going further ... | ||
= | = Customize = | ||
Customize the template created. Still in file pdf_propale_mycompanyblue.modules.php, search function 'Function _pagehead (&$pdf, $fac)'. It manages the display of the header. | |||
== | == Librairy for PDF manipulation == | ||
The library used to create PDF documents in PHP language is called FPDF and can be found into htdocs/includes/fpdf/fpdf/fpdf.class.php. It's also in this class you can find all different methods used to generate different parts of documents. | |||
Templates instantiate this class FPDF and used its method, combined with data of invoice, order, or other kind of data. | |||
We can generraly find the following calls into templates that generated PDF documents: | |||
* $pdf->SetFont() - '' | * $pdf->SetFont() - ''Define the font to use for the text'' | ||
* $pdf->SetXY() - '' | * $pdf->SetXY() - ''Define position (X,Y) for next text that will be output onto page'' | ||
* $pdf->MultiCell() - '' | * $pdf->MultiCell() - ''Draw a box containing text. Used to output any text'' | ||
* $pdf->GetY() - '' | * $pdf->GetY() - ''Return current Y position'' | ||
* $pdf->SetDrawColor() - '' | * $pdf->SetDrawColor() - ''Set the color to use for new text to write - ie black (0,0,0) or white (255,255,255)'' | ||
* $pdf->Rect() - '' | * $pdf->Rect() - ''Drwa a rectanle whose top left corner coordinates ared defineds by two first parameters and bottom right corner is defined by two following parameters that are relative values'' | ||
== Structure des scripts == | == Structure des scripts == | ||