example41_MPDFI_template.php 567 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. include("../mpdf.php");
  3. $mpdf=new mPDF('','','','',15,15,57,16,9,9);
  4. $mpdf->SetImportUse();
  5. $mpdf->SetDisplayMode('fullpage');
  6. $mpdf->SetCompression(false);
  7. // Add First page
  8. $pagecount = $mpdf->SetSourceFile('sample_basic.pdf');
  9. $crop_x = 50;
  10. $crop_y = 50;
  11. $crop_w = 100;
  12. $crop_h = 100;
  13. $tplIdx = $mpdf->ImportPage(2, $crop_x, $crop_y, $crop_w, $crop_h);
  14. $x = 50;
  15. $y = 50;
  16. $w = 100;
  17. $h = 100;
  18. $mpdf->UseTemplate($tplIdx, $x, $y, $w, $h);
  19. $mpdf->Rect($x, $y, $w, $h);
  20. $mpdf->Output('newpdf.pdf', 'I');
  21. exit;
  22. ?>