PDF as background

Hello again,

does anybody know how to put a pdf as background for invoices or orders? There should be a solution with FPDI but i did not get it run.

Best regards,

Dieter

Hello,

i solved this issue by little modifications of the modules.php files responsible for generating the pdfs.

First of all i copied the pdf template in the

documents\mycompany\logos

directory.

Then i added the fpdi class in the header of the .php file

require_once(DOL_DOCUMENT_ROOT."/includes/fpdf/fpdfi/fpdi.php");

The next step was to integrate the template in the pdf-printing process. Here i modified the function writ_file as follows:

On top of the function:
[i] $nblignes = sizeof($object->lines);
$pdf=pdf_getInstance($this->format);
$pdf = new FPDI();

			$pagecount = $pdf-\>setSourceFile($conf-\>mycompany-\>dir_output.'/logos/Tectos_Briefpapier_Hintergrund.pdf'); 
			$tplidx = $pdf-\>importPage(1);  [/i]

and in the new page section:
$pdf->AddPage();
$pdf->useTemplate($tplidx);
$pagenb++;

Enclosed you will find the modified pdf_crabe.modules.php

Best regards,

Dieter

Attachment of file crabe has failed.
Can you resubmit it (but you must zip it before)

Hi,

i hope it works now.

pdf_crabe-20120226.zip (9.66 KB)