How to Merge Multiple PDF Files Into One PDF

前端 未结 2 1694
孤街浪徒
孤街浪徒 2021-02-11 05:24

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 05:52

    $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);
    

提交回复
热议问题