New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PR for a PDF writer welcome? #256
Comments
Please note that #255 is about using the qr code in pdfs unrelated to the pdf generator in use. For example, the current issue also exists with PrinceXML which turns html input into a pdf. So your idea might be a good use-case for some people, but is not a replacement for #255. |
Ok! :-) |
Hi @JanSlabon I don't think there is really a demand for this feature at the moment as there are already some very compatible formats and I think including a PDF generator / dependency is not desirable. If you can keep it very small it is ok, but otherwise I would prefer a separate library providing the PDF Writer (which you can still easily use with this library). |
Ok, what a pitty. I don't want to impose something here but simply thought it would be a good feature addition. Because the only way to get a vector based output is EPS or SVG. Both formats needs to be re-interpreted and converted to PDF later on. So the PDF generation library needs to be able to interpret these formats (not all libraries support this - and some have problems as seen in #255). A writer is not big or complicated. We just did this here, too: https://github.com/chillerlan/php-qrcode/blob/main/src/Output/QRFpdf.php Feel free to ping me if there's a demand for it in the future. |
I do think it is useful so if you think it is not too big or complicated and we can keep additional dependencies optional (via composer suggest) such a feature is more than welcome. |
I'm not sure if this is already planed or why ever nobody did this before, so I ask before we would start:
We would use FPDF under the hood and the QR codes will be created as simple vector based PDF files. Simliar to the EPS output + logo. We would left the labels because this can be done in the PDF generation class that imports the resulting PDF later on (FPDF, TCPDF, tFPDF,...) with FPDI.
I'm not sure if the dependency to FPDF should be hard (in the composer.json) or optional.
The class name would be
Endroid\QrCode\Writer\FpdfWriter
. ThegetName()
method would return"pdf"
or"fpdf"
?What do you think? :-)
PS: This will also make the SVG interpretation of TCPDF obsolete which seems to be buggy as noted in #255.
The text was updated successfully, but these errors were encountered: