Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,12 @@ Or in Python:

.. code:: python


import qrcode
import qrcode.image.svg


method = input("What method?: ")

if method == 'basic':
# Simple factory, just a set of rects.
factory = qrcode.image.svg.SvgImage
Expand All @@ -134,8 +137,10 @@ Or in Python:
else:
# Combined path factory, fixes white space that may occur when zooming
factory = qrcode.image.svg.SvgPathImage

img = qrcode.make('Some data here', image_factory=factory)

img.save('some_file.svg')

Two other related factories are available that work the same, but also fill the
background of the SVG with white::
Expand Down