setSourceFile($file);
for ($pageNo = 1; $pageNo <= $pageCount; $pageNo++) {
$pdf->AddPage();
$pageId = $pdf->importPage($pageNo, 'MediaBox');
$pdf->useTemplate($pageId, 20, 20, 100, 100);
$pdf->Rect(20, 20, 100, 100);
#var_dump($pageId);
$pageId = $pdf->importPage($pageNo, 'ArtBox');
$s = $pdf->useTemplate($pageId, 120, 120, 100);
$pdf->Rect(120, 120, $s['w'], $s['h']);
$s = $pdf->useTemplate($pageId, 220, 120, 100, 100);
$pdf->Rect(220, 120, $s['w'], $s['h']);
#var_dump($pageId);
#break;
}
}
$pdf->Output('F', 'simple-v1.pdf');
echo microtime(true) - $start;
echo "
";
var_dump(memory_get_usage());
unset($pdf);
var_dump(gc_collect_cycles());
echo "
";
var_dump(memory_get_usage());
echo "
";
echo filesize('simple-v1.pdf');
?>