mnooner256 / pyqrcode

Python 3 module to generate QR Codes
BSD 3-Clause "New" or "Revised" License
408 stars 75 forks source link

Optimized SVG QR Codes #8

Closed heuer closed 9 years ago

heuer commented 9 years ago

This commit adds more options to the svg method (i.e. omit XML declaration, custom CSS class definitions etc.). Further, it does not draw many <line>s but one <path> element.

Caution: The output does not use the SVG height/width attributes anymore but a viewBox. IMO this is preferable since the QR code could be embedded in different (HTML) environments and defines its height/width automatically.

heuer commented 9 years ago

Fixed debug path output

heuer commented 9 years ago

I am unsure if the html5 method is useful, though. Probably not. :) I think it's preferable to add an example to the docs:

>>> # Generate SVG element which can be embedded into HTML5
>>> qr.svg(file, xmldecl=False, svgns=False)
heuer commented 9 years ago

I changed my implementation, I'll open another pull request.