Install & Compatibility
Where this runs
tested against v0.8.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.132s · 37.5MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.3s · import 0.124s · 38MB
36MB installed
● package 36MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
encode
✓ from pdf417gen import encode
Import encode function directly; no submodule.
render_image
✓ from pdf417gen import render_image
Render barcode as a PIL Image.
render_svg
✓ from pdf417gen import render_svg
Render barcode as an SVG string.
to_legacy_barcodes
✓ from pdf417gen import to_legacy_barcodes
Convert to list of boolean rows for custom rendering.
Encode a string and render as image. Requires Pillow.
from pdf417gen import encode, render_image
from PIL import Image
# Encode a string into barcode codewords
codes = encode('Hello, PDF417!')
# Render as PIL Image (returns a PIL Image object)
image = render_image(codes) # type: Image.Image
image.save('barcode.png')
Errors
Common errors & fixes
NameError: name 'render_image' is not defined
Forgot to import render_image, or imported from wrong module.
fixUse: `from pdf417gen import render_image`
ModuleNotFoundError: No module named 'PIL'
Pillow is required for render_image but not installed automatically.
fixInstall Pillow: `pip install Pillow`
pdf417gen.encode() got multiple values for argument 'columns'
Passed both positional and keyword argument for columns, or incorrect signature.
fixUse keyword arguments: `encode('data', columns=5)` instead of positional. Upgrade
Version history
0.8.1latest on PyPI · released Jan 23, 2025
Audit
Dependencies
No dependency data recorded yet.