Laravel和TCPDF生成带有彼此相邻图像的pdf

时间:2019-02-04 17:08:50

标签: laravel tcpdf

我希望在第一页上生成一个2页PDF,两个图像彼此相邻,在第二页上,图像占据了整个宽度。

现在在第1页上,图像彼此重叠。

public function print_design(Design $design)
{
  PDF::SetTitle('Design');
  PDF::AddPage();

    //Want to be 1/2 the width of pdf (dynamic based on page layout (A4,L2...etc)
    PDF::Image($design->get_image_by_name('Back')->image);

    //Want to be 1/2 the width of pdf NEXT to image above (dynamic based on page layout (A4,L2...etc)
    PDF::Image($design->get_image_by_name('Front')->image);

    //Want to be full page width (Dynamic based on page layout)
    PDF::AddPage();
    PDF::Image($design->get_image_by_name('Inside')->image);

  PDF::Output('design.pdf');
}

0 个答案:

没有答案