Methods and apparatus, including computer systems and program products,
for creating and using documents with machine-readable codes. A computer
program displays a list of fields in an electronic document, receives
user input selecting one or more of the fields, automatically generates
generation instructions for a machine-readable code to be displayed in a
final appearance of the electronic document, and stores the generation
instructions in the electronic document. The generation instructions
specify that the machine-readable code is to be produced using data to be
provided for the selected fields. In some embodiments, the program can
also evaluate the user input, as well as user modifications made to the
electronic document, to determine whether the machine-readable code is
validly configured. By guiding users through the process of setting up
machine-readable codes, the program can help users create forms with
machine-readable codes that have a high probability of being scanned and
decoded successfully.