Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Propozycja: wymienny silnik renderowania (Chromium / Gotenberg) obok dompdf

Open
#300 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
docker, php
Domain
backend

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

code-review enhancement low-priority

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.
  • TemplateRenderer i TwigRenderer (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.php albo 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mplodowski/dynamicpdf-plugin

All issues in mplodowski/dynamicpdf-plugin

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.