I would widen my search to other print stream formats, like ZPL.
See the last item in
for an extension-free approach.
To achieve unique numbering among multiple workers, consider allocating them separate number ranges, to avoid having to keep a central number data base.