sprain / php-swiss-qr-bill

A PHP library to create Swiss QR bills | QR-Rechnung in PHP erstellen
MIT License
282 stars 82 forks source link

Feature proposal: Add DomPdfOutput #178

Open liedekef opened 2 years ago

liedekef commented 2 years ago

Is it possible to support dompdf as output, next to pdf and tcpdf? See https://github.com/dompdf/dompdf It has svg support, should have no issues with utf-8 etc ...

sprain commented 2 years ago

Possibly.

I do not know DomPdf and I am currently unsure whether I want to support more Output types right within this library. But you surely could build a DomPdfOutput as a standalone enhancement to this library.

kohlerdominik commented 2 years ago

@sprain Dompdf is very popular. If I would use a PHP-based PDF converter in a project, I would eiter use TCPDF or DOMPDF, depending which renders better for the given use case.

Therefore, I think adding Dompdf as output wouldn't be a bad idea. Especially if @liedekef would create a PR :).

sprain commented 2 years ago

Especially if @liedekef would create a PR :).

I would definitely consider merging a PR :)

liedekef commented 2 years ago

Well, since dompdf is like "converting html to pdf", I would need to know the complete output requirements before starting to work on this. If then dompdf is able to deliver, I'll create a PR.

sprain commented 2 years ago

since dompdf is like "converting html to pdf"

In that case it‘s worth trying what happens if you feed the output of HtmlOutput to DomPdf. Maybe this already does the trick and no specific DomPdfOutput is needed?

ckoGH commented 2 years ago

DomPdf is usable with php-swiss-qr-bill and HtmlOutput. Changes recommended: 1) Use FILE_FORMAT_PNG instead of FILE_FORMAT_SVG. 2) CSS Extension: #qr-bill-currency { float: none !important; display: inline-block; } #qr-bill-amount { display: inline-block; } This solves the effect mentioned in Issue #122.