In PDFlib we can define the boxsize for an image using boxsize={65 65}
(for example). Since we need two values, is there any way to set the height value and leave the width value to be dynamically? In my use case I want to add all images with a set height of 65, but the images can be different in their width so the boxsize should dynamically update according to the image.
I also tried using scale in the option list, but that makes no sense, since the height than also changes according to the image.
Currently I load all images I want to place using a for loop, which looks like this:
foreach ($awardImages as $awardImage) {
$image = $p->load_image('auto', $awardImage, '');
if (0 == $image) {
echo "Couldn't load $image: ".$p->get_errmsg();
exit(1);
}
if ($x > (565 - 70)) {
$y = $y - 65;
$x = $elementStartLeft + 2;
}
// $buf = "scale=1 position={left center} matchbox={name=awardimage}";
$buf = 'boxsize={65 65} fitmethod=auto showborder position={left center} matchbox={name=awardimage}';
$p->fit_image($image, $x, $y, $buf);
++$awardNo;
$awardX2 = $p->info_matchbox('awardimage', $awardNo, 'x2');
$x = $awardX2 + 5;
}