Ver Mensaje Individual
  #3 (permalink)  
Antiguo 04/10/2007, 03:06
laris
 
Fecha de Ingreso: abril-2006
Mensajes: 21
Antigüedad: 18 años
Puntos: 0
Re: Unir varios pdf

Me he bajado de internet un programa en FPDI que me concatena varios pdf's, pero me dá errores y no sé como solucionarlo, si alguien me puede orientar os lo agradecería.

Mi programa es:

<?
require('../comun/fpdi/fpdi.php');

class concat_pdf extends FPDI

{

var $files = array();

function setFiles($files)
{
$this->files = $files;
}

function concat()
{
foreach($this->files AS $file)
{
$pagecount = $this->setSourceFile($file);
for ($i = 1; $i <= $pagecount; $i++)
{
$tplidx = $this->ImportPage($i);
$s = $this->getTemplatesize($tplidx);
$this->AddPage($s['h'] > $s['w'] ? 'P' : 'L');
$this->useTemplate($tplidx);
}
}
}
}

$pdf =& new concat_pdf();
$pdf->setFiles(array('PAGINA975.PDF', 'PAGINA976.PDF'));
$pdf->concat();
$pdf->Output('paginas.pdf', 'D');

?>


y me da el siguiente error:

Warning: Cannot modify header information - headers already sent by (output started at C:\home\IntGrana\prueba\unirPdf.php:6) in C:\home\IntGrana\comun\fpdi\fpdf.php on line 1035
FPDF error: Some data has already been output to browser, can't send PDF file

Gracias