endroid / qr-code

QR Code Generator
https://endroid.nl
MIT License
4.33k stars 721 forks source link

[Feature Request] SvgWriter with choice of code generation policy - Option to Use Previous SVG Generation Method with <defs> #443

Closed kojot-kk closed 2 months ago

kojot-kk commented 3 months ago

Hello,

I've been benefiting from your library and appreciate the efficiency it offers. I've noticed the recent shift from using the block to direct element embedding within SVGs.

The method used before significantly aids in modifying the code, thanks to its organized structure that simplifies post-generation edits.

Could you consider offering the previous based generation as an optional policy?

Thank you for your work on this library and for considering this suggestion to enhance its adaptability and usefulness.

Best,

Krzysztof

endroid commented 2 months ago

Hi @kojot-kk in 5.0.9 you can now pass an option SvgWriter::WRITER_OPTION_COMPACT => false to disable compact SVG generation and fall back to XML block definitions. Good luck!

kojot-kk commented 2 months ago

Thanks a lot!

sdespont commented 1 month ago

@endroid Thank you very much for the option ! Because for some reasons, including an SVG QR-Code compacted (with <path>) in a TCPDF document increase a lot the file size (+50% for a 120-page document) !

endroid commented 1 month ago

Thank you!