# PDF Report error

**URL:** <https://community.open-emr.org/t/pdf-report-error/23707>\
**Category:** Management and Administration\
**Created:** [October 24, 2024, 5:13am UTC](https://community.open-emr.org/t/pdf-report-error/23707 "2024-10-24T05:13:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter\_24](https://community.open-emr.org/user_avatar/community.open-emr.org/peter_24/32/20785_2.png) [@Peter\_24](https://community.open-emr.org/u/Peter_24)\
**Post date:** [October 24, 2024, 5:13am UTC](https://community.open-emr.org/t/pdf-report-error/23707/1 "2024-10-24T05:13:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Peter\_24](https://community.open-emr.org/user_avatar/community.open-emr.org/peter_24/32/20785_2.png) [@Peter\_24](https://community.open-emr.org/u/Peter_24)\
**Post date:** [October 27, 2024, 2:55pm UTC](https://community.open-emr.org/t/pdf-report-error/23707/3 "2024-10-27T14:55:55Z")

</div>

Hello

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

Thanks

---

<div class="post-metadata">

**Author:** ![moussa](https://community.open-emr.org/letter_avatar_proxy/v4/letter/m/90ced4/32.png) [@moussa](https://community.open-emr.org/u/moussa)\
**Post date:** [October 29, 2024, 12:13am UTC](https://community.open-emr.org/t/pdf-report-error/23707/4 "2024-10-29T00:13:04Z")

</div>

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

> [@Report PDF error (solved)](https://community.open-emr.org/t/report-pdf-error-solved/21590/4):
>
> it’s a bug, after [this line](https://github.com/openemr/openemr/blob/a212cf0f12ae478e8b4a2fe082cbf8c4572d820e/interface/patient_file/report/custom_report.php#L59) 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 :

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

```

---

<div class="post-metadata">

**Author:** ![Peter\_24](https://community.open-emr.org/user_avatar/community.open-emr.org/peter_24/32/20785_2.png) [@Peter\_24](https://community.open-emr.org/u/Peter_24)\
**Post date:** [November 2, 2024, 8:10am UTC](https://community.open-emr.org/t/pdf-report-error/23707/5 "2024-11-02T08:10:44Z")

</div>

Hi Moussa

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

Thank you so much!

Peter
