A two dimensional pattern design for secure documents serves as both a
machine readable code and an aesthetic part of the documents' design. A
method for generating the design generates a variable auxiliary message
comprising message values and maps the message values to a two
dimensional pattern of areas on the document. The areas each comprise an
arrangement of pixels on the printed document. Depending on a value of
the message mapped to a corresponding area, the method assigns a visible
structure to the corresponding area. Different visible structures are
assignable to a single value of the message to create a visible design
having a desired aesthetic appearance.