Merge PDF files with PHP -
my concept - there 10 pdf files in website. user can select pdf files , select merge create single pdf file contains selected pages. how can php?
i've done before. had pdf generated fpdf, , needed add on variable amount of pdfs it.
so had fpdf object , page set (http://www.fpdf.org/) , used fpdi import files (http://www.setasign.de/products/pdf-php-solutions/fpdi/) fdpi added extending pdf class:
class pdf extends fpdi { } $pdffile = "filename.pdf"; $pagecount = $pdf->setsourcefile($pdffile); for($i=0; $i<$pagecount; $i++){ $pdf->addpage(); $tplidx = $pdf->importpage($i+1, '/mediabox'); $pdf->usetemplate($tplidx, 10, 10, 200); }
this makes each pdf image put other pdf. worked amazingly needed for.
Comments
Post a Comment