Peter_24
(Peter)
October 24, 2024, 5:13am
1
Hello
Anyone can help with error for report pdf
Fatal error: Uncaught TypeError: Unsupported operand types: float - string in C:\xampp\htdocs\openemr\vendor\mpdf\mpdf\src\Mpdf.php:9842 Stack trace: #0 C:\xampp\htdocs\openemr\vendor\mpdf\mpdf\src\Mpdf.php(10009): Mpdf\Mpdf->_puthtmlheaders() #1 C:\xampp\htdocs\openemr\vendor\mpdf\mpdf\src\Mpdf.php(2047): Mpdf\Mpdf->_enddoc() #2 C:\xampp\htdocs\openemr\vendor\mpdf\mpdf\src\Mpdf.php(9507): Mpdf\Mpdf->Close() #3 C:\xampp\htdocs\openemr\interface\patient_file\report\custom_report.php(903): Mpdf\Mpdf->Output(‘chris_kokou_1_r…’, ‘D’) #4 {main} thrown in C:\xampp\htdocs\openemr\vendor\mpdf\mpdf\src\Mpdf.php on line 9842
I have applied this solution and nothing done after the line 60 of custom_report.php:
$config_mpdf[‘margin_top’] = $config_mpdf[‘margin_top’] * 1.5;
$config_mpdf[‘margin_bottom’] = $config_mpdf[‘margin_bottom’] * 1.5;
$config_mpdf[‘margin_header’] = $GLOBALS[‘pdf_top_margin’];
$config_mpdf[‘margin_footer’] = $GLOBALS[‘pdf_bottom_margin’];
Peter_24
(Peter)
October 27, 2024, 2:55pm
3
Hello
After reinstalled openemr, there no error to generate patient pdf report, but blank page. Any idea?
Thanks
moussa
(Moussa)
October 29, 2024, 12:13am
4
I did also have issue withthe pfd and I found this post:
it’s a bug, after this line in the custom_report script, insert these 4 lines
$config_mpdf['margin_top'] = $config_mpdf['margin_top'] * 1.5;
$config_mpdf['margin_bottom'] = $config_mpdf['margin_bottom'] * 1.5;
$config_m…
Basically you add 4 lines to openemr/interface/patient_file/report/custom_report.php
right after $config_mpdf = Config_Mpdf::getConfigMpdf();
so you will get :
if ($PDF_OUTPUT) {
$config_mpdf = Config_Mpdf::getConfigMpdf();
$config_mpdf['margin_top'] = $config_mpdf['margin_top'] * 1.5; >
$config_mpdf['margin_bottom'] = $config_mpdf['margin_bottom'] * 1.5; >
$config_mpdf['margin_header'] = $GLOBALS['pdf_top_margin']; >
$config_mpdf['margin_footer'] = $GLOBALS['pdf_bottom_margin'];
$pdf = new mPDF($config_mpdf);
if ($_SESSION['language_direction'] == 'rtl') {
$pdf->SetDirectionality('rtl');
}
Peter_24
(Peter)
November 2, 2024, 8:10am
5
Hi Moussa
I have applied the above code as suggested and everything works fine.
Thank you so much!
Peter