get('form_report_html'); $report_head = " "; if ($request->has('form_chart_canvas') && '' !== $request->get('form_chart_canvas')) { $chart_image = 'data:image/png;base64,' . $request->get('form_chart_canvas'); $report_chartpdf = "
"; } $report_foot = ' '; require_once 'modules/PDFMaker/resources/mpdf/mpdf.php'; // $mpdf = new mPDF('', // mode - default '' // 2 '', // format - A4, for example, default '' // 3 0, // font size - default 0 // 4 '', // default font family // 5 15, // margin_left // 6 15, // margin right // 7 16, // margin top // 8 16, // margin bottom // 9 9, // margin header // 10 9, // margin footer // 11 'L'); // L - landscape, P - portrait $report_filename = $request->get('form_filename') . '.pdf'; $export_pdf_format = $request->get('form_export_pdf_format'); // class mPDF ([ string $mode [, mixed $format [, float $default_font_size [, string $default_font [, float $margin_left , float $margin_right , float $margin_top , float $margin_bottom , float $margin_header , float $margin_footer [, string $orientation ]]]]]]) $mpdf = new mPDF('utf-8', '$export_pdf_format', '', '', '5', '5', '0', '5', '5', '5'); // Portrait = $mpdf=new mPDF('utf-8', 'A4'); // Landscape = $mpdf=new mPDF('utf-8', 'A4-L'); $mpdf->keep_table_proportions = true; if (number_format(mPDF_VERSION) < 6) { $mpdf->SetAutoFont(); } if ('v7' !== $layout) { $mpdf->WriteHTML($report_html_style, 1); } if ($request->has('type') && in_array($request->get('type'), ['all', 'base'])) { $record = $request->get('record'); // set reload to generate query by defined Filter criteria $_REQUEST['reload'] = 1; $ITS4YouReports = new ITS4YouReports(true, $record); $generate = new GenerateObj($ITS4YouReports,"",false,true); $reportData = $generate->generateReport($record); $report_html = $reportData[0]; } //--start report $mpdf->WriteHTML($report_head); if ($request->has('form_report_name') && !empty($request->get('form_report_name'))) { $form_report_name = $request->get('form_report_name'); $mpdf->WriteHTML(GenerateObj::placeReportNameToPDF($form_report_name)); $form_report_name .= '.pdf'; } if ('tabular' === $generate->report_obj->reportinformations['reporttype'] && false !== strpos($report_html, '')) { $report_totals_arr = explode('', $report_html); if (ITS4YouReports_Functions_Helper::count($report_totals_arr) > 1) { $report_html = $report_totals_arr[0] . $report_totals_arr[2]; } } $mpdf->WriteHTML($report_html); //--end if ('tabular' !== $generate->report_obj->reportinformations['reporttype']) { $report_totals = '
' . $request->get('form_report_totals'); $report_totals_arr = explode('', $report_totals); if (ITS4YouReports_Functions_Helper::count($report_totals_arr) > 1) { $report_totals = $report_totals_arr[0] . $report_totals_arr[2]; } $mpdf->WriteHTML($report_totals); } if (!empty($report_chartpdf)) { $mpdf->AddPage('L'); $mpdf->WriteHTML($report_chartpdf); } $mpdf->WriteHTML($report_foot); $mpdf->Output($form_report_name, 'D'); exit; } } }