imagemagick - Printing a pdf as an image inside of a pdf -


i'm creating web app , using php fpdf script creates , print out pdf. prints out on pdf images uploaded app, no problem. however, needs same thing uploaded pdf , problem lies. how can print pdf image inside of pdf using fpdf?

i have heard of imagemagick don't think option because software , don't know run it.

you can use fpdi import page of existing pdf document , place fpdf onto newly created page:

<?php require_once('fpdf.php'); require_once('fpdi.php');  $pdf = new fpdi();  // load document , total page count $pagecount = $pdf->setsourcefile("the/document/you/want/to/import/a/page/from.pdf"); // import first page $tplidx = $pdf->importpage(1);  // add page $pdf->addpage(); // use imported page on x=10, y=10 , width of 90 $pdf->usetemplate($tplidx, 10, 10, 90); // output pdf document $pdf->output(); 

Comments

Popular posts from this blog

php - render data via PDO::FETCH_FUNC vs loop -

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

The canvas has been tainted by cross-origin data in chrome only -