Respuesta: Como hacer un encabezado y un pie de pagina con la librería ezpdf a mi me funciono asi
if($btn=="Imprimir"){
session_start();
include("class.ezpdf.php");
$pdf = new Cezpdf('LETTER');
$pdf->selectFont('fonts/Helvetica.afm');
$pdf->ezSetCmMargins(3,1,3,3);
//cabecera del pdf (objeto para todas las páginas)
$all = $pdf->openObject();
$pdf->saveState();
$pdf->ezImage('logo.jpg',-50,100,'none','left');
$pdf->setStrokeColor(0,0,0,1);
$pdf->line($pdf->ez['leftMargin'], $pdf->ez['bottomMargin']+10, $pdf->ez['pageWidth']-$pdf->ez['rightMargin'], $pdf->ez['bottomMargin']+10);//the bottom line
$pdf->line($pdf->ez['leftMargin'], $pdf->ez['bottomMargin']+20, $pdf->ez['pageWidth']-$pdf->ez['rightMargin'], $pdf->ez['bottomMargin']+20);//the bottom line
$pdf->line($pdf->ez['leftMargin'], $pdf->ez['bottomMargin']+30, $pdf->ez['pageWidth']-$pdf->ez['rightMargin'], $pdf->ez['bottomMargin']+30);//the bottom line
$pdf->addText(252,740,12,"<b>REPORTE </b>\n");
$pdf->addText(250,720,12,"<b>ORDEN DE ENTREGA </b>\n");
$pdf->addText(450,730,12,"<b> No PAGINA </b>\n");
//$pdf->addText(450,730,12,"<b>FOR-GGC-B-002 </b>\n");
$pdf->addText(450,720,12,"<b>REVISION</b>\n");
$pdf->addText(450,710,12,"<b>PAGINA</b>\n");
$pdf->addText(100,60,10,"<b>REPORTE ELABORADO:</b>\n");
$pdf->addText(100,50,10,"<b>CARGO: </b>\n");
$pdf->addText(100,40,10,"<b>FECHA: </b>\n");
$pdf->ezStartPageNumbers($pdf->ez['pageWidth']-($pdf->ez['rightMargin']-10), $pdf->ez['bottomMargin']+680,12, 'PAGINA', '{PAGENUM} de {TOTALPAGENUM}',1);
$pdf->addText(50,30,10);//bottom text
$pdf->restoreState();
$pdf->closeObject();
$pdf->addObject($all,'all');
$pdf->ezSetCmMargins(4,3,3,3);
$pdf->addInfo($datacreator);
$CODIGO = $_POST['CODIGO'];
$FECHA = $_POST['FECHA'];
$FECHA1 = $_POST['FECHA1'];
if( $CODIGO <> ""){
$result = mysql_query("select * from vehiculo where CODIGO = '$CODIGO' ");
}else{
$result = mysql_query("select * from vehiculo");
}
while($row = mysql_fetch_array($result)){
$var[] = array('CODIGO'=>$row['CODIGO'],'VEHICULO'=>$row['VEHICULO'],'PLACA'=>$row['PLACA'],'PLATAFORMA'=>$row['PLATAFORMA'],'PLACA_P'=>$row['PLACA_P'],'ASIGNADO'=>$row['ASIGNADO']);
$titles = array('CODIGO'=>'<b>CODIGO </b>','VEHICULO'=>'<b>VEHICULO</b>','PLACA'=>'<b>PLACA</b>','PLATAFORMA'=>'<b>PLATAFORMA</b>','PLACA_P'=>'<b>PLACA_P</b>','ASIGNADO'=>'<b>ASIGNADO</b>');
$options = array(
'shadeCol'=>array(0.9,0.9,0.9),
'xOrientation'=>'center',
'width'=>550,
'fontSize'=>12 );
}
$pdf->ezTable($var,$titles,'',$options);
//$pdf->ezTable($var1,$titles1,'',$options);
ob_end_clean();
$pdf->ezStream();
} |