Insert an Empty Page at End of PDF File in PHP

Aspose.PDF - Insert an Empty Page at End of PDF File

To Insert an Empty Page at the end of PDF document using Aspose.PDF Java for PHP, simply invoke InsertEmptyPageAtEndOfFile class.

PHP Code


# Open the target document
$pdf = new Document($dataDir . 'input1.pdf');

# insert a empty page in a PDF
$pdf->getPages()->add();

# Save the concatenated output file (the target document)
$pdf->save($dataDir . "output.pdf");

print "Empty page added successfully!" . PHP_EOL;

Download Running Code

Download Insert an Empty Page at End of PDF File (Aspose.PDF) from any of the below mentioned social coding sites: