diff --git a/src/Utils/MPdfConverter.php b/src/Utils/MPdfConverter.php
index a703ec95..e0c9bc8e 100644
--- a/src/Utils/MPdfConverter.php
+++ b/src/Utils/MPdfConverter.php
@@ -34,7 +34,21 @@ class MPdfConverter implements HtmlToPdfConverter
{
$mpdf = new Mpdf(['tempDir' => $this->cacheDirectory]);
$mpdf->creator = Constants::SOFTWARE;
- $mpdf->WriteHTML($html);
+
+ // some OS do not follow the PHP default settings
+ if ((int) ini_get('pcre.backtrack_limit') < 1000000) {
+ @ini_set('pcre.backtrack_limit', 1000000);
+ }
+
+ // reduce the size of content parts that are passed to MPDF, to prevent
+ // https://mpdf.github.io/troubleshooting/known-issues.html#blank-pages-or-some-sections-missing
+ $parts = explode('
| {{ 'label.customer'|trans }} | -{{ 'label.project'|trans }} | -{{ 'label.duration'|trans }} | +{{ 'label.customer'|trans }} | +{{ 'label.project'|trans }} | +{{ 'label.duration'|trans }} | {% if showRateColumn %} -{{ 'label.rate'|trans }} | +{{ 'label.rate'|trans }} | {% endif %}
|---|
| {{ 'label.date'|trans }} | +{{ 'label.date'|trans }} | {% if showUserColumn %} -{{ 'label.user'|trans }} | +{{ 'label.user'|trans }} | {% endif %} -{{ 'label.description'|trans }} | -{{ 'label.duration'|trans }} | +{{ 'label.description'|trans }} | +{{ 'label.duration'|trans }} | {% if showRateColumn %} -{{ 'label.rate'|trans }} | +{{ 'label.rate'|trans }} | {% endif %}
|---|---|---|---|---|---|---|---|---|---|
| + |
{{ entry.begin|date_time }}
{% if entry.end %}
diff --git a/tests/Controller/ExportControllerTest.php b/tests/Controller/ExportControllerTest.php index 3473a128..bc7c60ac 100644 --- a/tests/Controller/ExportControllerTest.php +++ b/tests/Controller/ExportControllerTest.php @@ -217,7 +217,7 @@ class ExportControllerTest extends ControllerBaseTest // poor mans assertions ;-) $this->assertStringContainsString('export_print', $node->getIterator()[0]->getAttribute('class')); - $this->assertStringContainsString(' List of expenses', $response->getContent()); + $this->assertStringContainsString('', $response->getContent());
$this->assertStringContainsString('Summary', $content); $this->assertEquals(1, substr_count($content, 'id="export-summary"')); $this->assertEquals(1, substr_count($content, 'id="export-records"')); diff --git a/translations/messages.de.xlf b/translations/messages.de.xlf index 4ab47ba9..fab75abf 100644 --- a/translations/messages.de.xlf +++ b/translations/messages.de.xlf @@ -970,7 +970,7 @@ |