Which PDF Programs Run It
A PixelBinary barcode is redrawn by JavaScript inside the PDF. Whether it changes when the text changes depends on the program the form is opened with.
| PDF program | What happens |
|---|---|
| Adobe Acrobat, Acrobat Reader (Windows, macOS) | The programs the form was made for. The barcode follows the text when you leave the field. If nothing happens, JavaScript is switched off: Preferences > JavaScript > Enable Acrobat JavaScript. |
| DocuWrit 0.4 and later | Asks before it runs the script (Scripts in documents). Then the barcode follows the text when you leave the field, on screen and in the saved or printed copy. It is drawn smaller than in Acrobat. |
| Firefox (its built-in viewer) and other viewers built on pdf.js; DocuWrit 0.3 | The script runs. After a change the screen shows the rows of 0 and 1 instead of the squares, because these viewers show a changed read-only field in a plain font. Print or save the form: the copy has the barcode. |
| Viewers without form JavaScript: many phone viewers and viewers built into web browsers | They show the barcode that was saved in the file. It does not change when the text changes. |
Before you hand out a form: open it in the programs your readers use, change the text, print it, and scan the result.
Why there are two fields and two fonts
A barcode is many lines of text, and PDF programs do not agree on how far apart the lines of a multi-line field are:
| Viewer | Distance from one line to the next |
|---|---|
| Adobe Acrobat, Acrobat Reader | the font's own line height — for PixelBinary exactly 1.0 × the font size |
| pdf.js (Firefox, DocuWrit) | always 1.35 × the font size, whatever the font says |
With squares of 1.0 × 1.0 the second group would leave a white stripe between every two rows, and no scanner reads that. So every barcode has two fields in the same place: one with PixelBinary-010101 and one with PixelBinary Tall135, whose squares are 1.35 × 1.35 of the font size. The script asks the viewer what it is, fills the field that fits and empties the other one.
Nothing appears, or the barcode does not change
- Leave the field. The barcode is redrawn when you click somewhere else on the page, not while you type.
- Allow scripts. Acrobat: Preferences > JavaScript. DocuWrit: the yellow bar above the document.
- Save the file to your computer first. A PDF opened inside a web browser is usually shown by the browser's own viewer, not by the program you expect.
- The text is too long. The field shows nothing when the text does not fit a code. Shorten it.
- Rows of 0 and 1 instead of squares. In Firefox that is expected on screen (see the table above); in DocuWrit, update to version 0.4 or later. In Acrobat it means the font is not embedded in the form: install the fonts, then set the font of the barcode fields again and save.
- Thin white lines between the squares on screen. A screen effect at some zoom levels in some viewers; zoom in or print. The printed code does not have them.
Back to Add a barcode to your own form.