1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
|
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Pépinière Saint-Nicolas');
$nomDocument = 'Relevé de compte client #'.$IDClient;
$pdf->SetTitle($nomDocument);
$pdf->SetSubject('');
$pdf->SetKeywords('');
$PgNo= $pdf->getAliasNumPage()." / ". $pdf->getAliasNbPages();
if($cli_Cell1!='')
$cellAff = "Cell: ".$cli_Cell1;
$date = date('Y-m-d');
$html = <<<EOF
<!-- EXAMPLE OF CSS STYLE -->
<style>
p {margin:0pt; padding:0pt; }
td.infosPepi{ width:36%; max-width:356;}
td.infosClient{ border:1px solid navy;}
td.infosReleve{ border:1px solid navy;}
td.infoPepi {font-size:8pt;}
td.entetePepi {text-align:center; font-size:14 pt;}
td.attentionDe {background-color:navy; color:white; text-align:center; font-size:14pt;}
td.lDocument {background-color:navy; color:white; text-align:center; font-size:14pt;}
td.navycenterClient { text-align:center; background-color:navy; color:white; width:25%; max-width:25%; border:1px solid red;}
td.navycenterDate { text-align:center; background-color:navy; color:white; width:35%; max-width:35%; border:1px solid green;}
td.navycenterPage { text-align:center; background-color:navy; color:white; width:40%; max-width:40%; border:1px solid orange;}
td.centerClient {width:25%; max-width:25%; text-align:center; border:1px solid red;}
td.centerDate {width:35%; max-width:35%; text-align:center; border:1px solid green;}
td.centerPage {text-align:center; width:40%; max-width:40%; border:1px solid orange;}
</style>
<table cellpadding="4">
<tr>
<td class="centerClient">$IDClient</td>
<td class="centerDate">$date</td>
<td class="centerPage">$PgNo</td>
</tr>
</table>
EOF;
// remove default header/footer
$pdf->SetFont('times', '', 10);
$pdf->setHeaderData($ln='', $lw=0, $ht='', $hs=$html, $tc=array(0,0,0), $lc=array(0,0,0));
$pdf->setPrintFooter(false);
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// set margins
$pdf->setHeaderMargin(PDF_MARGIN_HEADER);
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// set some language-dependent strings (optional)
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
require_once(dirname(__FILE__).'/lang/eng.php');
$pdf->setLanguageArray($l);
}
// ---------------------------------------------------------
// set font
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
// add a page
$pdf->AddPage();
$html = 'contenu de la page';
$pdf->writeHTML($html, true, false, true, false, '');
// ---------------------------------------------------------
//Close and output PDF document
$fichier = $nomDocument.'.pdf';
$pdfFile = $pdf->Output($fichier, 'I'); |
Partager