ERPNext Conference 2019* Blog

How to print barcode label


We did not add any new button.
We jusy created a new primt. Format of the documents and that print format have all thr page size and print design


Hi @fkardame, I have been trying to print expiry date in V11, but the variable is not giving me any data, am I doing something wrong? how did you set it up?


Check if the batch field is named as ‘batch’ or ‘batch_no’


Is there any possible help that i can get with the labels?
I need as design

Item code
Item price

I have knowledge on custom print format for sales order, invoice, pos invoice
But no clue how to proceed with custom print format for labels ( i have a zebra desktop printer also ) for this purpose ,
Any help on this topic is appreciated , like from where to start


If you do a google search for ZPL Manual you should turn up several links to the Zebra Print Language user manual. Is it downloadable in PDF format and contains complete information on how to setup a label format using simple examples.

If you prefer to do it visually, you can go to the Zebra website and search for the free downloadable version of their Zebra Designer software. It is a drag-and-drop visual editor to make label layouts. You can test your layout by printing it directly to the Zebra printer. If it turns out the way you want then you print to file the same label and it will give you the ZPL code in the file you need to place in your print format.

Getting the manual and learning the language is the best bet, but there is an alternative if you are not good with code.

Also have a look at this thread for more details and examples:



Thanks for your reply BKM, you remember the thread i post before , i tried what you told me just as for testing , and i checked the option print to file and i got the code of the label i still need to add the texts as mentioned in the post above, though that’s not the problem for me atm , i don’t have knowledge in print format on how to integrate this print to file code and link it to my database to fetch ( item code, item price and barcode number ) this is my recent problem , like i tested the code mentioned with your thread that you linked but whenever i press print zpl i get the code from purchase receipt and not the barcode , i was just testing, i think differences in field is the issue because i just want a demo , but this thread is not working for me due to being able to see the code when pressing on print zpl , and i don’t see a label


Zebra has browserprint.js so you can do raw printing directly with ease. You just need install it then include browserprint.js api in your app then you’re ready to go


I use a small program ZPL Designer, , to preview the label using the code generated. Just copy the code after you press print zpl and paste it into the program and click on Preview. I used the program for designing the label first and then transferring the design back to ERPNext.


thank you @petereb for your reply, i tested the code that you shared , but when pressing print zpl, i just see code , i don’t see the preview of the label , the problem is now i need help with custom format as i said on top i just tried to copy your custom format , but it said to me check error logs or contact tech support though i have knowledge with custom formats Llike SINV, POS as i mentioned on top, i just want it to test and check where i can change as i wanted it or related fields. but i get this error log.


Please go through this post and check if you can understand it…
This does not required any app to be used. It is just a Print format script used as per the size of the barcode paper.
and sent to the printer using the browser print method.
Let me know if you need any help.