Low-level encoding of pdf417 bardocde

145 Views Asked by At

I am trying to generate a pdf417 barcode in LaTeX. If I got it right, I can represent the code as a list of zeros and ones and then turn it into black and white boxes using LaTeX.

I am following this page http://grandzebu.net/informatique/codbar-en/pdf417.htm

I have a python code that generates the codewords (high-level encoding):

from pdf417 import encode
import sys

# Some data to encode
text = sys.argv[1]
cols = int(sys.argv[2])
sec_lev = int(sys.argv[3])

# Convert to code words
codewords = encode(text, columns=cols, security_level=sec_lev, encoding="utf-8")

You can do print(codewords) to see the array.

How can I convert it to 0s and 1s (low-level encoding)?

P.S. I know how to produce an .svg using this library and embed it into a .pdf file produced by LaTeX, but I want to make this work using (Lua)LaTeX similar to this answer https://tex.stackexchange.com/a/88610/100689

0

There are 0 best solutions below