ninjatx
(Winn N)
1
Situation
Hello,
PDFs Report generated are hundreds of blank pages. The screenshot attached is taken from the main Demo site.
OpenEMR Version
I’m using OpenEMR version 8.3.0.
Browser:
I’m using: Chrome
Operating System
I’m using: Debian
Search
Did you search the forum for similar questions?
Logs
Did you check the logs?
Was there anything pertinent in them?
Please paste them here (surround with three backticks (```) for readability.
```[Thu Aug 20 09:12:20.005391 2026] [php:warn] [pid 1307868:tid 1307868] [client 192.168.1.171:49349] PHP Warning: Undefined array key 1 in /var/www/html/openemr/interface/patient_file/report/custom_report.php on line 758, referer: https://xxxxxx.com/interface/patient_file/report/patient_report.ph[](https://xxxxxx.com/interface/patient_file/report/patient_report.php “Open link in external tab”)p
```
You can also turn on User Debugging under Administration->Globals->Logging User Debugging Options=>All
Hi @ninjatx, thanks for the bug report. Will take a look into it right away.
1 Like
Hi @ninjatx, a quick fix is to add 'CSSselectMedia' => 'screen', to src/Pdf/Config_Mpdf.php.
<?php
/**
* This class returns a generic mPDF config array
*
* @package OpenEMR
* @author Stephen Waite <stephen.waite@cmsvt.com>
* @copyright Copyright (c) 2023 Stephen Waite <stephen.waite@cmsvt.com>
* @link https://www.open-emr.org
* @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
*/
namespace OpenEMR\Pdf;
use OpenEMR\Core\OEGlobalsBag;
use OpenEMR\Services\Storage\CacheDirectory;
class Config_Mpdf
{
public static function getConfigMpdf()
{
return [
'tempDir' => (new CacheDirectory())->for('openemr-mpdf'),
'mode' => OEGlobalsBag::getInstance()->get('pdf_language'),
'format' => OEGlobalsBag::getInstance()->get('pdf_size'),
'default_font_size' => OEGlobalsBag::getInstance()->getInt('pdf_font_size'),
'default_font' => 'dejavusans',
'margin_left' => OEGlobalsBag::getInstance()->getInt('pdf_left_margin'),
'margin_right' => OEGlobalsBag::getInstance()->getInt('pdf_right_margin'),
'margin_top' => OEGlobalsBag::getInstance()->getInt('pdf_top_margin'),
'margin_bottom' => OEGlobalsBag::getInstance()->getInt('pdf_bottom_margin'),
'margin_header' => '',
'margin_footer' => '',
'orientation' => OEGlobalsBag::getInstance()->get('pdf_layout'),
'shrink_tables_to_fit' => 1,
'use_kwt' => true,
'autoScriptToLang' => true,
'keep_table_proportions' => true,
'CSSselectMedia' => 'screen',
];
}
}
1 Like
ninjatx
(Winn N)
4
Thank you so much for the fast response! It’s fixed.