diff --git a/app/Controllers/Invoice.php b/app/Controllers/Invoice.php index 36554c1c..da67dc58 100644 --- a/app/Controllers/Invoice.php +++ b/app/Controllers/Invoice.php @@ -857,41 +857,36 @@ class Invoice extends BaseController $mpdf->Output($pdfFileName, 'D'); } - //new design public function print_address_landscape($id) { - $model = new InvoiceModel(); $invoiceData = $model->getInvoiceData($id); // print_r($invoiceData);die(); - $config = [ 'mode' => 'utf-8', - 'format' => 'A5-L', // Change format to A5-L for landscape + 'format' => 'A5-L', // A5 landscape format 'default_font_size' => 12, 'default_font' => 'Arial', - 'margin_left' => 0, - 'margin_right' => 0, - 'margin_top' => 5, - 'margin_bottom' => 5, - 'margin_header' => 0, - 'margin_footer' => 0, - 'orientation' => 'L', // Change to landscape orientation + 'margin_left' => 10, + 'margin_right' => 10, + 'margin_top' => 10, + 'margin_bottom' => 10, + 'orientation' => 'L', // Landscape orientation ]; + + // $mpdf = new \Mpdf\Mpdf($config); $mpdf = new Mpdf($config); $mpdf->SetTitle('Customer Address'); $mpdf->SetAuthor($invoiceData[0]->company_name); - $mpdf->SetCreator(''); - + // Generate the PDF content (HTML) with customer and address data $html = view('address_pdf_landscape_template', ['invoiceData' => $invoiceData]); // echo $html;die; $mpdf->WriteHTML($html); - $pdfFileName = 'customer_address_' . date('Y-m-d H-i-s') . '.pdf'; + $pdfFileName = 'customer_address_' . date('Y-m-d_H-i-s') . '.pdf'; $mpdf->Output($pdfFileName, 'D'); } - public function general_inv_rp() { $model = new InvoiceModel(); diff --git a/app/Views/address_pdf_landscape_template.php b/app/Views/address_pdf_landscape_template.php index 5b06f94b..6fc80810 100644 --- a/app/Views/address_pdf_landscape_template.php +++ b/app/Views/address_pdf_landscape_template.php @@ -6,15 +6,15 @@