使用PHP和PDFLib旋转图像

I'm using this code to render an Image inside a box in the PDF I'm generating using PDFLib

$p = new pdflib();

if ($p->begin_document("", "") == 0)
  throw new Exception("Error: " . $p->get_errmsg());

$p->begin_page_ext(0, 0, "width=792 height=612");
$image = $p->load_image("auto", "01.jpg", "");
$p->fit_image($image, 100,200,"boxsize={300 500} fitmethod=entire showborder");

This works as expected. Now the need is to rotate the Image within the box as specified as above.

I tried this:

$p->fit_image($image, 100,200,"boxsize={300 500} fitmethod=entire showborder rotate 15"); 

But it yielded no result.

Update: It works when I try the above code without the showborder:

$p->fit_image($image, 100,200,"boxsize={300 500} fitmethod=entire rotate 15");

Any Idea why this is happening?

Try like this. i think it may help you but not sure

$extra_pram = "boxsize={" . $int_image_w . " " . $int_image_h . "} position={left top} fitmethod=entire rotate=" . $int_image_rotation;
$this->pdflib->fit_image ( $image_obj, $int_image_x, $int_image_y, $extra_pram )

your missing the = sign for rotate

should be rotate=15