Propozycja: wymienny silnik renderowania (Chromium / Gotenberg) obok dompdf
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start with classes/PDFWrapper.php, classes/TemplateRenderer.php, classes/TwigRenderer.php, and config/renatio/dynamicpdf.php to trace the existing dompdf render path and the HTML-renderer boundary. Review the README’s dompdf limitations and current file/host restrictions before assessing the proposed engine interface and Gotenberg or Chromium integration. Done means the acceptance criteria pass: dompdf remains the default, the alternate engine renders the same flex/grid template and preview, and its security limits are documented and enforced.
Written by the indexing model from the issue text.
Description
Problem
dompdf obsługuje ograniczony podzbiór CSS: bez flexboxa i grida, z niepełnym wsparciem position, ograniczonymi fontami i SVG. Szablony trzeba więc pisać na floatach i tabelach. Demo pluginu też tak robi (views/pdf/invoice.htm używa float-left, clear-both). Gotowego HTML-a i CSS-a (np. z Tailwinda w wersji 3/4) nie da się użyć bez przeróbek. README odsyła do listy niezgodności CSS dompdf (README.md:305-307), a wiele starych issues dotyczy właśnie ograniczeń silnika (#1, #47, #62, #64, #110).
Dowód
- Wrapper dziedziczy po
Barryvdh\DomPDF\PDF(classes/PDFWrapper.php:23), a cała ścieżka renderu (loadTemplate(),render(),PageNumbers::stamp(),RemoteAssetPolicy) jest związana z dompdf. TemplateRendereriTwigRenderer(classes/TemplateRenderer.php,classes/TwigRenderer.php) produkują sam HTML i nie zależą od dompdf. Granica, na której da się podpiąć inny silnik, już istnieje.
Skutek
Złożone dokumenty (wielokolumnowe raporty, wykresy, nowoczesna typografia) wymagają obejść albo innego narzędzia obok pluginu. Szablony, uprawnienia, synchronizacja i podgląd z pluginu wtedy przepadają.
Proponowane rozwiązanie
- Interfejs silnika (HTML na wejściu, PDF na wyjściu, opcje papieru i metadane), z dompdf jako domyślnym.
- Opcjonalny sterownik Gotenberg (usługa HTTP w kontenerze, bez Node na serwerze aplikacji) i/lub Browsershot (Chromium lokalnie), wybierany w
config/renatio/dynamicpdf.phpalbo per render. - Bezpieczeństwo jak w dompdf: brak dostępu do plików poza dozwolonymi katalogami i lista dozwolonych hostów. Chromium domyślnie czyta
file://i sieć, więc trzeba to jawnie ograniczyć. pageNumbers()przez nagłówek/stopkę silnika, a funkcje specyficzne dla dompdf (encrypt(),set*()) z czytelnym wyjątkiem w innym silniku.
Kryteria akceptacji
- Domyślna konfiguracja zachowuje się dokładnie jak dziś (dompdf).
- Po włączeniu sterownika ten sam szablon z flexboxem/gridem renderuje się poprawnie.
- Podgląd PDF w panelu używa skonfigurowanego silnika.
- Ograniczenia plików i hostów obowiązują także w nowym silniku i są opisane w README.
- Dominant language
- PHP
- Stars
- 30
- Forks
- 22
- Avg merge
- 2h 23m
- Merged PRs (30d)
- 77
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mplodowski/dynamicpdf-plugin
-
code-review documentation low-priority
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
mplodowski/dynamicpdf-plugin#295 · 1 comment ·
Maintainers usually reply within 1 day
-
code-review enhancement low-priority
Difficulty 5/5 Over a week Newbie friendliness 30/100
mplodowski/dynamicpdf-plugin#301 · 1 comment ·
Maintainers usually reply within 1 day
-
code-review enhancement low-priority
Difficulty 5/5 Over a week Newbie friendliness 38/100
mplodowski/dynamicpdf-plugin#299 · 1 comment ·
Maintainers usually reply within 1 day
-
code-review enhancement low-priority
Difficulty 5/5 Over a week Newbie friendliness 35/100
mplodowski/dynamicpdf-plugin#298 · 1 comment ·
Maintainers usually reply within 1 day
-
code-review documentation good first issue low-priority
Difficulty 4/5 3-5 days Newbie friendliness 45/100
mplodowski/dynamicpdf-plugin#294 · 1 comment ·
Maintainers usually reply within 1 day
All issues in mplodowski/dynamicpdf-plugin
Similar issues
-
📚 Documentation: Placeholder link `link-to-realtime-docs` in Flutter SDK changelogPossibly taken @ShyneChikwapulo claimed this today. Openapi / realtime product / auth product / messaging product / vcs
Difficulty 1/5 Under an hour Newbie friendliness 82/100
appwrite/appwrite#14272 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
Boavizta/boaviztapi#580 · 1 comment ·
-
Add PrestashopOpenrequest
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
endoflife-date/endoflife.date#11303 ·
Maintainers usually reply within 1 day
-
0. to triage enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day