Cannot set margins with SetMargins
I maintainer di solito rispondono entro 5 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start with the Mpdf class: compare how SetMargins stores its arguments with how the constructor config sets the bottom margin, and check where left and right margins are read when the page is laid out. Reproduce with the snippet in the issue, which calls SetMargins(50,50,50) and then WriteHTML, and confirm the bottom margin and the left/right margins match the constructor values. Done means the bottom, left and right margins take effect through SetMargins as they do through the constructor, with a test covering that. The issue has been open for about three years with one comment and no maintainer decision, so confirm the approach before writing code.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Guidelines
- I understand that if I fail to provide all required details, this issue may be closed without review.
Description of the bug
SetMargins does not support margin-bottom as the constructor config does, plus margin-left and margin-right are not taken into consideration.
This how I fixed the output in my project https://github.com/elaborate-code/row-bloom/commit/683fcd483b428328280fd43263f261afce2b98b6
mPDF version
v8.1.6
PHP Version and environment (server type, cli provider etc., enclosing libraries and their respective versions)
PHP 8.1.6 (Simply running a script with php ./script.php)
Reproducible PHP+CSS+HTML snippet suffering by the error
// script.php
use Mpdf\HTMLParserMode;
use Mpdf\Mpdf;
$mpdf = new Mpdf();
$mpdf->SetMargins(50,50,50);
$mpdf->SetHeader('foo');
$mpdf->SetFooter('foo');
$mpdf->WriteHTML('<p>foo</p>');
$mpdf->WriteHTML('', HTMLParserMode::HEADER_CSS);
$mpdf->OutputFile(__DIR__.'./bar.pdf');
- Lingua principale
- PHP
- Stelle
- 4.7k
- Fork
- 1.1k
- Merge medio
- 6g 11h
- PR unite (30g)
- 4
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di mpdf/mpdf
-
SVG path arcs with an explicit zero radius throw DivisionByZeroErrorForse già presa @Syed-Shehroz-Sohail l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 5 giorni
-
Closing a column set with an image in it leaves the cursor below the page, wasting the rest of itAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 5 giorni
-
8.3: Local fallback for external stylesheets is inverted in CssLoader (basepathIsLocal check negated) — CSS silently dropped when remote fetch failsForse già presa @hemreduru l’ha presa 12 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 5 giorni
-
Tag/Td.php silently clears cell top/bottom borders when a row has a partial border (plus two warnings and a deprecation)Forse già presa @alizamani1616 l’ha presa 61 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 5 giorni
-
AdjustHTML() collapses multiple spaces inside quoted attribute values (src, href)Forse già presa @sornapudisuresh l’ha presa 130 giorni fa. Apertabug/fix help wanted HTML/CSS support
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 5 giorni
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
sync-en
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 2 giorni
-
Перевод устарел
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
follow-up
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno