PDF Report error

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’];

Hello

After reinstalled openemr, there no error to generate patient pdf report, but blank page. Any idea?

Thanks

I did also have issue withthe pfd and I found this post:

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');
    }

Hi Moussa

I have applied the above code as suggested and everything works fine.

Thank you so much!

Peter