...

/

Reading and Writing PDF417 Codes

Reading and Writing PDF417 Codes

Learn how to write and read PDF417 codes using Python.

We'll cover the following...

Writing data to the PDF417

Below, we can see a simple example of how to generate a PDF417 barcode.

Python 3.10.4
from pdf417gen import encode, render_image
data = """https://educative.io"""
encoded = encode(data)
image = render_image(encoded)
image.save('output/PDF417_edu.png')

Line 1: First, we import the encode() and render_image() functions from the pdf417gen library.

Line 3: We then define a variable called data with our data. In this ...