Hello everyone,
We are trying to rotate a pdf that we are fitting in another pdf and we need to preserve the boxes that is has.
Now when using both functions my rotate does not work anymore.
Is there somebody that can help ?
Here is my code :
<?php
// Shortend script.
/* Loop over all pages of the input document */
for ($pageno = 1; $pageno <= $endpage; $pageno++) {
$page = $pdf->open_pdi_page($indoc, $pageno, "cloneboxes");
if ($page == 0) {
die("Error: " . $pdf->get_errmsg());
}
// Dummy $page size; will be adjusted later
$pdf->begin_page_ext(10, 10, "");
/**
* Krijg de hoogte en breedte
*/
$width = $pdf->pcos_get_number($indoc, "pages[0]/width");
$height = $pdf->pcos_get_number($indoc, "pages[0]/height");
/* Place the imported $page on the output $page, and
* adjust the $page size
*/
// echo $format['format'];
if ( ($format['format'] == "a4") || ($format['format'] == "a3") ){
if ( $pdf->pcos_get_number($indoc, "pages[0]/height") - $pdf->pcos_get_number($indoc, "pages[0]/width") <= 0 ) {
//$pdf->fit_pdi_page($page, 0, 0, $options);
$pdf->fit_pdi_page($page, 0, 0, "adjustpage orientate=west cloneboxes");
} else {
$pdf->fit_pdi_page($page, 0, 0, "cloneboxes");
}
} else {
$pdf->fit_pdi_page($page, 0, 0, "cloneboxes");
}
// And the rest of the script.