#1 před 2 lety

pete
Člen
Registrovaný: 22. 10. 2009
Příspěvky: 25

pdf merge

Caute,
pokusam sa zlucit pdf subory, ale nejako mi to nejde. Skusal som zend pdf:

<?php
// --- pdf documents - will create the main pdf document ---
$files = array('file1.pdf', 'file2.pdf', ...);

// --- main pdf document ---
$pdf = new Zend_Pdf();

foreach($files as $file) {
    // --- load file ---
    $pdfFile = Zend_Pdf::load($file);
    // --- add only the first page of each document to the main document ---
    $pdf->pages[] = $pdfFile->pages[0];
    unset($pdfFile);
}

// --- convert pdf to string - ready for output ---
$out = $pdf->render();
?>

Toto v Zende nefunguje lebo sa neda pracovat s dvoma pdf dokumentami ($pdf a $pdfFile) lebo stranky zdielaju zdroje s dokumentom takze sa nedaju iba tak prehadzovat medzi tymito dvoma dokumentami.

Ma niekto skusenosti so spajanim pdf? Alebo pozna niekto nejaku pdf kniznicu v ktorej to ide?
Dik.

 

#2 před 2 lety

pete
Člen
Registrovaný: 22. 10. 2009
Příspěvky: 25

Re: pdf merge

Nasiel som fpdi kniznicu s ktorou to ide dost jednoducho:
http://www.setasign.de/…utions/fpdi/

a tu je priklad:
http://www.setasign.de/…tenate-fake/

 

Zápatí