TCPDF_import is not bringing in an existing file

后端 未结 3 1324
情深已故
情深已故 2021-01-22 17:17

I have a PDF of a blank certificate, I want to fill in two lines when the user completes a course of study, and display the PDF so they can print or download it.

I am us

3条回答
  •  旧时难觅i
    2021-01-22 17:54

    Create a file and call it pdfConcat.php and paste:

    files = $files;
         }
         function concat() {
              foreach($this->files AS $file) {
                   $pagecount = $this->setSourceFile($file);
                   for ($i = 1; $i <= $pagecount; $i++) {
                        $tplidx = $this->ImportPage($i);
                        $s = $this->getTemplatesize($tplidx);
                        $this->AddPage('P', array($s['w'], $s['h']));
                        $this->useTemplate($tplidx);
                   }
              }
         }
    }
    ?>
    

    Usage:

    include_once("pdfConcat.php");
    $pdf =& new concat_pdf();
    
    $pdf->setFiles(array("doc.pdf","pauta.pdf", "4bp.pdf", "5bp.pdf"));
    $pdf->concat();
    $pdf->Output("newpdf.pdf", "I");
    

    http://garridodiaz.com/concatenate-pdf-in-php/

    Olè!!!

提交回复
热议问题