mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-06 02:59:29 +00:00
Fixed problem of missing page breaks when generating multiple labels
This was caused by some behavior change introduced in dompdf 3.1.1 This fixes issue #1070
This commit is contained in:
parent
e1418dfdc1
commit
4d98605e93
4 changed files with 473 additions and 441 deletions
|
|
@ -24,7 +24,7 @@
|
||||||
"doctrine/doctrine-bundle": "^2.0",
|
"doctrine/doctrine-bundle": "^2.0",
|
||||||
"doctrine/doctrine-migrations-bundle": "^3.0",
|
"doctrine/doctrine-migrations-bundle": "^3.0",
|
||||||
"doctrine/orm": "^3.2.0",
|
"doctrine/orm": "^3.2.0",
|
||||||
"dompdf/dompdf": "^v3.0.0",
|
"dompdf/dompdf": "^3.1.2",
|
||||||
"gregwar/captcha-bundle": "^2.1.0",
|
"gregwar/captcha-bundle": "^2.1.0",
|
||||||
"hshn/base64-encoded-file": "^5.0",
|
"hshn/base64-encoded-file": "^5.0",
|
||||||
"jbtronics/2fa-webauthn": "^3.0.0",
|
"jbtronics/2fa-webauthn": "^3.0.0",
|
||||||
|
|
|
||||||
879
composer.lock
generated
879
composer.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -16,15 +16,18 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{% for element in elements %}
|
{% for element in elements %}
|
||||||
|
{# The page div ensures the page breaks, while the page-inner elements restrict the content to the page size. Sine dompdf 3.1.1 we cannot apply the position: absolute; to the page element directly. #}
|
||||||
<div class="page">
|
<div class="page">
|
||||||
{% if options.barcodeType.none %}
|
<div class="page-inner">
|
||||||
{% include "label_system/labels/label_page_none.html.twig" %}
|
{% if options.barcodeType.none %}
|
||||||
{% elseif options.barcodeType.is2D() %}
|
{% include "label_system/labels/label_page_none.html.twig" %}
|
||||||
{% include "label_system/labels/label_page_qr.html.twig" %}
|
{% elseif options.barcodeType.is2D() %}
|
||||||
{% elseif options.barcodeType.is1D() %}
|
{% include "label_system/labels/label_page_qr.html.twig" %}
|
||||||
{% include "label_system/labels/label_page_1d.html.twig" %}
|
{% elseif options.barcodeType.is1D() %}
|
||||||
{% endif %}
|
{% include "label_system/labels/label_page_1d.html.twig" %}
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -3,17 +3,31 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.page {
|
.page {
|
||||||
|
/** We cannot apply the position: absolute trick here, because then dompdf will not respect the page break anymore **/
|
||||||
|
|
||||||
page-break-inside: avoid;
|
page-break-inside: avoid;
|
||||||
page-break-before: avoid;
|
page-break-before: avoid;
|
||||||
page-break-after: always;
|
page-break-after: always;
|
||||||
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-inner {
|
||||||
/* Absolute position prevents automatic page breaks */
|
/* Absolute position prevents automatic page breaks */
|
||||||
|
/*position: absolute;*/
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
page-break-inside: avoid;
|
||||||
|
page-break-before: avoid;
|
||||||
|
page-break-after: avoid;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Last page should not break */
|
/* Last page should not break */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue