如何将图像彼此相邻放置FPDF

时间:2020-06-15 13:32:43

标签: php fpdf

我正在用FPDF制作PDF。目前,我在将图像添加到PDF画布时遇到了一个小问题。正如您在下面看到的那样,图像位于彼此之间/下方。

PDF Result

如何设置图像彼此相邻?

hopefully result

我试图收到的内容:

  1. 将SetY()添加到代码中。 Result adding SetY()

代码:

        $query3 = "SELECT `image_name` FROM `punch_list_images` WHERE punch_list_item_number = '$punch_list_item_number'";

        $result3 = mysqli_query($conn, $query3);

        if ($result3->num_rows > 0) {
            $i = $result3->num_rows;
            while ($row3 = mysqli_fetch_assoc($result3)) {
                $image = $row3['image_name'];
                if ($row3['image_name']) {

                    if ($i === 1) {
                        $pdf->Image("Punch_list_images_resize/".$image, NULL, NULL, '', '', "JPG");
                    } else if ($i === 2) {
                        $pdf->Image("Punch_list_images_resize/".$image, NULL, NULL, '', '', "JPG");
                    } else if ($i === 3) {
                        $pdf->Image("Punch_list_images_resize/".$image, NULL, NULL, '', '', "JPG");
                    }
                }
            }
        }

0 个答案:

没有答案