How to Merge Multiple PDF Files Into One PDF

前端 未结 2 663
醉话见心
醉话见心 2021-02-11 05:17

i having a big trouble. i\'d like merge multiple PDF files in tro One pdf from iphone apps. But i can not. can you help me ? Many thanks

2条回答
  •  情话喂你
    2021-02-11 06:01

    $mergedPath = '/tmp/bulkinvoice_merge_'.$vendor_id.'_'.$randomno.'.pdf';
    $filepath = 'http://xyz/'.$vendor_id.'/'.$shipmentId.'_invoice_shipment_label.pdf'; 
    $current = file_get_contents($filepath);
    $tempPath = '/tmp/bulkinvoice_'.$vendor_id.'_'.$shipmentId.'.pdf';
    chmod($tempPath, 777);
    file_put_contents($tempPath,$current);
    $pdf = Zend_Pdf::load($tempPath);
    
    foreach($pdf->pages as $page){
        $pdfExtract = $ex->clonePage($page);
        $pdf2show->pages[] = $pdfExtract;
    }
    
    //$pdf2show->pages[] = $ex->clonePage($pdf->pages[0]);
    
    echo "\n [->]Added in merged PDF : ".$shipmentId;
    $pdf2show->save($mergedPath);
    unlink($tempPath);
    

提交回复
热议问题