PixelBinary 1.0
A QR code and a Data Matrix code drawn by a PDF form itself - with a font and a little JavaScript.
https://jimran.com/pixelbinary.html

WHAT IT IS
  A barcode is a grid of black and white squares. The font PixelBinary draws the character 1 as a
  black square and the character 0 as a white square of the same size, with no space between
  characters or between lines. So a barcode is just text: one line of 0s and 1s per row.
  A script in the PDF turns what somebody types into that text, and a read-only text field that
  uses the font shows it. No server, no plug-in, no image: the code changes when the text changes.

IN THIS FOLDER
  PixelBinary-Barcode-Example.pdf   Type a text, click outside the field: both codes are redrawn.
  fonts/PixelBinary-010101.otf      The font. 0 = empty square, 1 to 9 = filled square.
  fonts/PixelBinary-Tall135.ttf     The same idea with squares 1.35 x 1.35 of the font size, for
                                    viewers that put the lines of a text field 1.35 font sizes apart.
  PixelBinary-script.js             The script of the example (two barcode libraries and a short
                                    piece of glue), ready to paste into your own form.
  LICENSE-OFL.txt, LICENSE-MIT.txt  The licenses. Short version: use it for anything, free.

MAKE YOUR OWN FORM  (needs a PDF editor that can add form fields, embed a font and add JavaScript)
  1. Install both fonts, so your editor can embed them in the form.
  2. Add the text field people type into, for example "Text".
  3. Where the barcode goes, add a text field named "QR": read-only, multi-line, font
     PixelBinary-010101, no border, no fill colour, about 200 x 200 points.
     Add a second field of the same size in the same place, named "QRTall", same settings but font
     PixelBinary Tall135, font size 2.
  4. Add PixelBinary-script.js as a document-level JavaScript.
  5. In the field "Text", add this as its Validate script:
         PixelBinary.show(this, "QR", PixelBinary.qr(event.value));
     For a Data Matrix code use  PixelBinary.datamatrix(event.value)  instead.
  The field names are yours to choose; the second field is always the first name plus "Tall".
  The script picks the largest font size at which the code fits the field (PixelBinary.box is the
  usable size in points; change it if your fields are not 200 points).

WHY TWO FIELDS PER BARCODE
  PDF viewers do not agree on how far apart the lines of a multi-line field are. Adobe Acrobat uses
  the font's own line height (1.0 x the font size for this font). Viewers built on pdf.js, such as
  Firefox and DocuWrit, always use 1.35 x the font size, which would leave white stripes between
  the rows. The script fills the field whose font fits the viewer and empties the other one.

WHERE IT WORKS
  Adobe Acrobat and Acrobat Reader (Windows, macOS): the programs it was made for. Allow JavaScript
      (Edit > Preferences > JavaScript) if it is switched off.
  DocuWrit 0.4 or later (free, https://jimran.com/docuwrit.html): allow scripts for the document
      when it asks; the barcodes then follow the text (drawn smaller than in Acrobat).
  Firefox and other viewers built on pdf.js: the script runs; after a change the screen may show
      the rows of 0 and 1 instead of the squares, and the barcode is drawn when the form is printed
      or saved.
  Viewers without form JavaScript (many phone and browser viewers): they show the barcode that
      was saved in the file; it does not change when the text changes.

LIMITS
  The example accepts up to 200 characters. QR codes use error correction level M.
  Text is encoded as Latin-1 bytes; test characters outside it with your scanner before relying on them.
  Always scan a code you are going to depend on.

CREDITS
  PixelBinary fonts      Copyright (c) 2006 Trilaworks, 2026 JimRan Software. SIL Open Font License 1.1.
  Data Matrix            tualo-datamatrix, Copyright 2013 tualo solutions GmbH (Thomas Hoffmann). MIT.
                         https://github.com/tualo/tualo-datamatrix
  QR Code                quickresponse() from "2D barcode symbol creation by javascript",
                         Copyright (c) 2020 Alois Zingl. MIT.  https://github.com/zingl/2D-Barcode
  Glue script, example   Copyright (c) 2019-2026 JimRan Software. MIT.
  "QR Code" is a registered trademark of DENSO WAVE INCORPORATED.
