使用PHP和PDFLib旋转图像

3
我正在使用这段代码在PDFLib生成的PDF中渲染一个图像,使其适合于一个框。
$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");

这个工作符合预期。现在需要的是按照上述要求在方框内旋转图像。

我试过这个:

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

但是它没有产生结果。
更新: 当我尝试上述代码而不使用showborder时,它可以工作。
$p->fit_image($image, 100,200,"boxsize={300 500} fitmethod=entire rotate 15");

有什么想法为什么会发生这种情况吗?
2个回答

0

试试这样做,我觉得可能有帮助,但不确定。

$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 )

0

你漏了旋转的=号

应该是rotate=15


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接