-1
我正在使用mPDF和Codeigniter創建PDF文件。添加頁碼時出現問題。 我有一些通過數據庫查詢生成的結果集,我將它們傳遞給我的html文件來顯示該數據。根據它創建的結果數量並將其轉換爲帶有頁數的pdf格式。問題是,當它生成多個頁面時,我無法添加頁碼。 我正在使用此操作的基本示例。 請幫助我!動態生成頁面的頁碼在mPDF
我的控制器代碼
$result_1 = $this->Vessel_model->getManifestVesselDetails($vesselId,$containerId);
$result_2 = $this->Vessel_model->getVesselDetailsByContainer($vesselId,$containerId);
$result_3 = $this->Vessel_model->getDDByVesselContainer($vesselId,$containerId);
$data['agentDetails'] = $this->Vessel_model->getShippingAgents();
$data['DD_SDNumber'] = $this->DD_SDNumber;
$data['DDdetails'] = $result_3;
$data['containerDetails'] = $result_2;
$data['vesselcontainerDetails'] = $result_1;
$html = $this->load->view('reports/tri_shipping_manifest_PDF', $data, true);
//this the the PDF filename that user will get to download
$pdfFilePath = APPPATH.'/'.date('Y-m-d').$result_1->vessel.'-'.$result_1->serialno.".pdf";
$pdfFilePath3 = date('Y-m-d').$result_1->vessel.'-'.$result_1->serialno.".pdf";
$this->load->library('pdfreports');
$this->pdf = $this->pdfreports->load();
//$this->pdf->setFooter('{PAGENO}');
$this->pdf->AddPage('L','',1,'i','on');
$this->pdf->WriteHTML($html,0);
$this->pdf->Output($pdfFilePath3, "D");
$this->pdf->Output($pdfFilePath, "F");
告訴我們你對生成multiplage PDF –
我添加的代碼的代碼。 – Kali
你能否也請添加鏈接到這個基本的例子? –