| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
This Image-Class is only capable of writing very simple PDF files including rectangles, which is exactly what a QR-Library needs. Horizontal runs of modules are merged into single rectangles to keep the files small. The factory is registered as 'pdf' in the qr script.
Covers the PDF structure (stream length, xref offsets), saving to a path, kind checking, and that the drawn rectangles reproduce the QR matrix in PDF's bottom-up coordinate system.
| Back | FazBrowse Home | New Git URL |
What
Adds a new image factory qrcode.image.pdf.PdfImage that renders the QR code as a PDF document, written from scratch with no third-party dependency. The factory is also registered as the pdf shortcut for the qr console script:
qr --factory pdf --output code.pdf 'some data'Why
PDF is a common target for print workflows (labels, invoices, tickets). A QR code only needs filled rectangles, so a minimal hand-written PDF avoids pulling in a heavyweight dependency like reportlab.
Design notes
Testing