3

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?

hakre
  • 193,403
  • 52
  • 435
  • 836
unni
  • 2,891
  • 4
  • 19
  • 22

2 Answers2

0

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 )
Shaik Baba
  • 112
  • 2
0

your missing the = sign for rotate

should be rotate=15

Yeak
  • 2,470
  • 9
  • 45
  • 71