I'm trying to import a pdf with php class FPDI with this simple code:
require_once("fpdf/fpdf.php");
require_once("fpdi/fpdi.php");
$pdf = new FPDI();
$pdf->setSourceFile('intermedia.pdf');
$tplidx = $pdf->ImportPage(1);
$pdf->AddPage();
$pdf->useTemplate($tplidx,0,0,210);
$pdf->Output();
but I receive the following error:
Warning: explode() [function.explode]: Empty delimiter. in /var/catalogo/test_pdf/fpdi/pdf_parser.php on line 369
Fatal error: Uncaught exception 'Exception' with message 'Unable to find object (1, 0) at expected location.' in /var/catalogo/test_pdf/fpdi/pdf_parser.php:709 Stack trace: #0 /var/catalogo/test_pdf/fpdi/pdf_parser.php(268): pdf_parser->resolveObject(Array) #1 /var/catalogo/test_pdf/fpdi/pdf_parser.php(208): pdf_parser->_readRoot() #2 /var/catalogo/test_pdf/fpdi/fpdi_pdf_parser.php(71): pdf_parser->__construct('/var/catalogo/t...') #3 /var/catalogo/test_pdf/fpdi/fpdi.php(128): fpdi_pdf_parser->__construct('/var/catalogo/t...') #4 /var/catalogo/test_pdf/fpdi/fpdi.php(108): FPDI->_getPdfParser('/var/catalogo/t...') #5 /var/catalogo/test_pdf/index.php(5): FPDI->setSourceFile('intermedia.pdf') #6 {main} thrown in /var/catalogo/test_pdf/fpdi/pdf_parser.php on line 709
This is the file that should be imported: http://catalogo.selectaspa.it/test_pdf/intermedia.pdf