So, I'm using fpdi , version 1.2, to add a small mark to every page in my document. Here is my code:
public static function markPdf($file, $text){ define('FPDF_FONTPATH','font/'); require_once('fpdi/fpdf.php'); require_once('fpdi/fpdi.php'); try{ $pdf = new FPDI(); $pagecount = $pdf->setSourceFile($file); for($i = 1 ; $i <= $pagecount ; $i++){ $tpl = $pdf->importPage($i); $size = $pdf->getTemplateSize($tpl);
And everything works fine, except for one small problem: when I have a document with the first page in landscape orientation, all pages in the generated document are cut off from the bottom and to the right (if the first page is in portrait mode, everything goes fine, even if the following pages are in in landscape mode). The question is obvious: what is wrong with this function?
source share