DanieLeeuwner/JSZPL

Inject label width (^PW) in ZPL output

Closed this issue · 2 comments

lionep commented

Thank you for this great library !

My printer defaults settings is 3 inches, and I would like to print regardless the settings on 4 inches labels.
If I'm adding manually in the generated ZPL (right below ^XA)

^PW812

(812 is 203dpi x 4inches).

Is there a way to inject custom ZPL commands, or to support PW / LL commands ?

Thanks !

Hi, can you try using the Raw component for this purpose.

lionep commented

Just read about the Raw element, which allow to set any ZPL command :

const pageWidth = new Raw();
pageWidth.data = '^PW812';
label.content.push(pageWidth);

I can also do the same with LL command to automatically cut the label after X lines printed.

Sorry for this !