
Then the rendering code takes the barcode from the GUI, uses the library to get the bar widths, and draws the barcode with these widths and the fonts selected by the user.īecause I wanted to make the plugin easy to use, I wrote a shell script to concatenate the relevant JavaScript files and remove the #import lines. The GUI code doesn’t contain any logic, it just lets the user enter the relevant details.

barcode_library doesn’t know anything about InDesign, all it does is produce a data structure giving the relative bar widths. Really barcode_main.js should be split up into two files, one for the GUI and one for rendering the barcode.Įach part of the code does one thing.

It’s an example of writing structured, modular code for an InDesign plugin.
