rkone / sharpzebra

A .net library that simplifies printing to Zebra printers in their native EPL2/ZPL languages without needing to know EPL2 or ZPL.
MIT License
89 stars 34 forks source link

Add option DataMatrix #9

Closed Rondinelly closed 5 years ago

Rondinelly commented 5 years ago

If it to interests you, I implemented the DataMatrix barcode writing for ZPL according to the Manual

Follow example:

var page = new List<byte>();
page.AddRange(ZPLCommands.ClearPrinter(printerSetting));
page.AddRange(ZPLCommands.DataMatrixWrite(10, 10, ElementDrawRotation.NO_ROTATION, 10, "Test"));          

 Print(page, printerSetting);

Result:

http://labelary.com/viewer.html?density=8&width=4&height=6&units=inches&index=0&zpl=%5EXA%5EMMT%5EPR0%2C12%2C12~TA000%5ELH0%2C0~SD30%5EPW812%5EFO10%2C10%5EBXN%2C%2010%2C200%2C%2C%2C%2C%2C1%2C%5EFDTest%5EFS%5EXZ

There were also some indentations due to the Visual Studio.

If need some adjustment, I'm ready to do it.

rkone commented 5 years ago

Great! Thanks for the submission!