为什么pdfMerger库返回需求错误?

时间:2019-01-10 08:50:36

标签: php pdf slim dompdf

我正在尝试使用Webapp上的PDFMerge合并一些发票pdf文件。 但是,找不到FpdiPdfParser\PdfParser\PdfParser.php,但可以在相对文件夹中找到它。

我已经尝试过重新安装fpdi和fpdf,但没有任何改变。

use PDFMerger\Pdf;
[...]
public function unioneFatture() {

        $query = "SELECT * FROM invoices WHERE spedito=1";
        $stmt = $this->db->prepare($query);
        $pdf = new Pdf();
        $stmt->execute();
        $fatture = $stmt->fetchall();

        foreach($fatture as $fattura) {
            $linkdocumento = $fattura["linkdocumento"];

            if (strpos($linkdocumento, '.html')){

                $dompdf = new Dompdf(); 
                $dompdf->loadHtml(file_get_contents($linkdocumento));
                $dompdf->setPaper('A4', 'portrait');
                $dompdf->render();
                $out = $dompdf->output();
                file_put_contents('temp.pdf', $out);
                $pdf->add("temp.pdf");

            }
[...]

这是返回的错误:

Warning: require(C:\Users\User\Desktop\Work\Arco\portale-fornitori\fornitori-services\public/../classes/setasign\FpdiPdfParser\PdfParser\PdfParser.php): failed to open stream: No such file or directory in C:\Users\User\Desktop\Work\Arco\portale-fornitori\fornitori-services\public\index.php on line 15

Fatal error: require(): Failed opening required 'C:\Users\User\Desktop\Work\Arco\portale-fornitori\fornitori-services\public/../classes/setasign\FpdiPdfParser\PdfParser\PdfParser.php' (include_path='C:\xampp27\php\PEAR') in C:\Users\User\Desktop\Work\Arco\portale-fornitori\fornitori-services\public\index.php on line 15

这是第15行中我的index.php中的内容:

require (__DIR__ . "/../classes/" . $classname . ".php");

谢谢。

0 个答案:

没有答案