Answers for "add page nos. to existing pdf in php"

PHP
0

add page nos. to existing pdf in php

<?php
require_once('TCPDF/tcpdf.php');
require_once('FPDI/fpdi.php');

$pdf = new FPDI();

$pdf->AddPage();

$pdf->setSourceFile('existing_file.pdf');
$tplIdx = $pdf->importPage(1);
$pdf->useTemplate($tplIdx);

$pdf->SetFont('Courier', '', 10);

$pdf->SetXY(20, 10);
$pdf->Write(0, "Text to be stamped");

$pdf->Output("output_sample.pdf", "D");
?>
Posted by: Guest on June-02-2020

Browse Popular Code Answers by Language