How to create PDF documents from image files, using PHP

后端 未结 3 546
抹茶落季
抹茶落季 2021-01-02 05:51

With PHP application, I have to generate single PDF documents, from set of images.

Which is best way to achieve this? Can I use TCPDF library, and can you give me so

相关标签:
3条回答
  • 2021-01-02 06:36

    I don't know your requirements but ImageMagick could probably do the trick. I believe that they also have a php wrapper available for all the image manipulation/conversion functions.

    0 讨论(0)
  • 2021-01-02 06:39

    The easiest way is to use TCPDF (http://www.tcpdf.org) and set the images as full background as on the example n. 51.

    For example:

    // disable auto-page-break
    $pdf->SetAutoPageBreak(false, 0);
    
    // set image 1
    $pdf->AddPage();
    $this->Image('image_demo1.jpg', 0, 0, 210, 297, '', '', '', false, 300, '', false, false, 0);
    $this->setPageMark();
    
    // set image 2
    $pdf->AddPage();
    $this->Image('image_demo2.jpg', 0, 0, 210, 297, '', '', '', false, 300, '', false, false, 0);
    $this->setPageMark();
    
    // ...
    
    0 讨论(0)
  • 2021-01-02 06:48

    you can use dompdf.You can find a copy of the original documentation at this link

    0 讨论(0)
提交回复
热议问题