code_junkie

Can FPDF/FPDI use a PDF in landscape format as a template?

Nov 12th, 2011
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. <?php
  2. require_once('fpdf.php');
  3. require_once('fpdi.php');
  4.  
  5. $pdf =& new FPDI();
  6. $pdf->addPage('L');
  7. $pagecount = $pdf->setSourceFile('template.pdf');
  8. $tplIdx = $pdf->importPage(1);
  9. $pdf->useTemplate($tplIdx);
  10. $pdf->SetFont('Arial');
  11. $pdf->SetTextColor(255,0,0);
  12. $pdf->SetXY(25, 25);
  13. $pdf->Write(0, "This is just a test");
  14. $pdf->Output('newpdf.pdf', 'F');
  15.  
  16. ?>
Add Comment
Please, Sign In to add comment