Add hidden option MAIN_USE_BACKGROUND_ON_PDF

This commit is contained in:
Laurent Destailleur 2009-06-15 18:57:34 +00:00
parent 70c4f0bd93
commit f22aa12c2d
14 changed files with 71 additions and 5 deletions

View File

@ -230,6 +230,9 @@ class CommActionRapport
{
global $conf,$langs;
// Do not add the BACKGROUND as this is a report
//pdf_pagehead($pdf,$outputlangs,$pdf->page_hauteur);
// New page
$pdf->AddPage();

View File

@ -352,6 +352,8 @@ class pdf_edison extends ModelePDFCommandes
global $conf,$langs,$mysoc;
$langs->load("orders");
pdf_pagehead($pdf,$outputlangs,$pdf->page_hauteur);
//Affiche le filigrane brouillon - Print Draft Watermark
if($object->statut==0 && (! empty($conf->global->COMMANDE_DRAFT_WATERMARK)) )
{

View File

@ -704,6 +704,8 @@ class pdf_einstein extends ModelePDFCommandes
$outputlangs->load("propal");
$outputlangs->load("companies");
pdf_pagehead($pdf,$outputlangs,$pdf->page_hauteur);
//Affiche le filigrane brouillon - Print Draft Watermark
if($object->statut==0 && (! empty($conf->global->COMMANDE_DRAFT_WATERMARK)) )
{

View File

@ -321,6 +321,26 @@ Class pdf_expedition_merou extends ModelePdfExpedition
{
global $conf, $langs;
pdf_pagehead($pdf,$outputlangs,$pdf->page_hauteur);
//Affiche le filigrane brouillon - Print Draft Watermark
if($object->statut==0 && (! empty($conf->global->SENDING_DRAFT_WATERMARK)) )
{
$watermark_angle=atan($this->page_hauteur/$this->page_largeur);
$watermark_x=5;
$watermark_y=$this->page_hauteur-25; //Set to $this->page_hauteur-50 or less if problems
$watermark_width=$this->page_hauteur;
$pdf->SetFont('Arial','B',50);
$pdf->SetTextColor(255,192,203);
//rotate
$pdf->_out(sprintf('q %.5F %.5F %.5F %.5F %.2F %.2F cm 1 0 0 1 %.2F %.2F cm',cos($watermark_angle),sin($watermark_angle),-sin($watermark_angle),cos($watermark_angle),$watermark_x*$pdf->k,($pdf->h-$watermark_y)*$pdf->k,-$watermark_x*$pdf->k,-($pdf->h-$watermark_y)*$pdf->k));
//print watermark
$pdf->SetXY($watermark_x,$watermark_y);
$pdf->Cell($watermark_width,25,$outputlangs->convToOutputCharset($conf->global->SENDING_DRAFT_WATERMARK),0,2,"C",0);
//antirotate
$pdf->_out('Q');
}
$Xoff = 90;
$Yoff = 0;

View File

@ -78,6 +78,8 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
global $conf,$langs,$mysoc;
$langs->load("orders");
pdf_pagehead($pdf,$outputlangs,$pdf->page_hauteur);
//Affiche le filigrane brouillon - Print Draft Watermark
if($object->statut==0 && (! empty($conf->global->SENDING_DRAFT_WATERMARK)) )
{

View File

@ -884,6 +884,8 @@ class pdf_crabe extends ModelePDFFactures
$outputlangs->load("propal");
$outputlangs->load("companies");
pdf_pagehead($pdf,$outputlangs,$pdf->page_hauteur);
//Affiche le filigrane brouillon - Print Draft Watermark
if($object->statut==0 && (! empty($conf->global->FACTURE_DRAFT_WATERMARK)) )
{

View File

@ -785,6 +785,8 @@ class pdf_oursin extends ModelePDFFactures
$langs->load("propal");
$langs->load("companies");
pdf_pagehead($pdf,$outputlangs,$pdf->page_hauteur);
//Affiche le filigrane brouillon - Print Draft Watermark
if($object->statut==0 && (! empty($conf->global->FACTURE_DRAFT_WATERMARK)) )
{

View File

@ -348,6 +348,8 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
{
global $langs,$conf,$mysoc;
pdf_pagehead($pdf,$outputlangs,$pdf->page_hauteur);
$pdf->SetTextColor(0,0,60);
$pdf->SetFont('Arial','B',13);

View File

@ -432,6 +432,8 @@ class pdf_typhon extends ModelePDFDeliveryOrder
{
global $langs,$conf,$mysoc;
pdf_pagehead($pdf,$outputlangs,$pdf->page_hauteur);
$pdf->SetTextColor(0,0,60);
$pdf->SetFont('Arial','B',13);

View File

@ -757,6 +757,8 @@ class pdf_propale_azur extends ModelePDFPropales
$outputlangs->load("propal");
$outputlangs->load("companies");
pdf_pagehead($pdf,$outputlangs,$pdf->page_hauteur);
//Affiche le filigrane brouillon - Print Draft Watermark
if($object->statut==0 && (! empty($conf->global->PROPALE_DRAFT_WATERMARK)) )
{

View File

@ -346,6 +346,8 @@ class pdf_propale_jaune extends ModelePDFPropales
{
global $conf,$langs;
pdf_pagehead($pdf,$outputlangs,$pdf->page_hauteur);
//Affiche le filigrane brouillon - Print Draft Watermark
if($object->statut==0 && defined("PROPALE_DRAFT_WATERMARK") )
{

View File

@ -217,6 +217,9 @@ class pdf_paiement extends FPDF
{
global $langs;
// Do not add the BACKGROUND as this is a report
//pdf_pagehead($pdf,$outputlangs,$pdf->page_hauteur);
$title=$outputlangs->transnoentities("ListOfCustomerPayments");
$title.=' - '.dol_print_date(dol_mktime(0,0,0,$this->month,1,$this->year),"%B %Y",false,$outputlangs,true);
$pdf->SetFont('Arial','B',12);

View File

@ -583,6 +583,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$outputlangs->load("orders");
$outputlangs->load("companies");
// Do not add the BACKGROUND as this is for suppliers
//pdf_pagehead($pdf,$outputlangs,$pdf->page_hauteur);
$pdf->SetTextColor(0,0,60);
$pdf->SetFont('Arial','B',13);

View File

@ -20,12 +20,31 @@
*/
/**
* \file htdocs/lib/company.lib.php
* \brief Ensemble de fonctions de base pour le module societe
* \ingroup societe
* \file htdocs/lib/pdf.lib.php
* \brief Set of functions used for PDF generation
* \ingroup core
* \version $Id$
*/
/**
* \brief Show header of page for PDF generation
* \param pdf Object PDF
* \param outputlang Object lang for output
* \param page_height
*/
function pdf_pagehead(&$pdf,$outputlangs,$page_height)
{
global $conf;
// Add a background image on document
if (! empty($conf->global->MAIN_USE_BACKGROUND_ON_PDF))
{
$pdf->Image($conf->societe->dir_output.'/logos/'.$conf->global->MAIN_USE_BACKGROUND_ON_PDF, 0, 0, 0, $page_height);
}
}
/**
* \brief Show bank informations for PDF generation
*/
@ -269,9 +288,9 @@ function pdf_getlinedesc($line,$outputlangs,$showref=1)
$prefix_prodserv = $outputlangs->transnoentitiesnoconv("Product")." ";
}
}
if ($showref) $ref_prodserv = $prodser->ref." - ";
$libelleproduitservice=$prefix_prodserv.$ref_prodserv.$libelleproduitservice;
}
}