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
91 stars 34 forks source link

Incorrect call to TextWrite() in Wiki #11

Closed bh4017 closed 5 years ago

bh4017 commented 5 years ago

In the Wiki, the following example is provided:

page.AddRange(ZPLCommands.TextWrite(10, 150, ElementDrawRotation.NO_ROTATION, ZebraFont.STANDARD_NORMAL, 15, "Hello World!"));

But the TextWrite() method does not support these parameters. The closest overload is:

TextWrite(int left, int top, ElementDrawRotation rotation, ZebraFont font, int height, int width, string text, [int codepage = 850])

Here is a working example:

page.AddRange(ZPLCommands.TextWrite(10, 150, ElementDrawRotation.NO_ROTATION, ZebraFont.STANDARD_NORMAL, 15, 10, "Hello World!"));

rkone commented 5 years ago

There are two overloads for ZPLCommands.TextWrite. The Wiki uses this one:

public static byte[] TextWrite(int left, int top, ElementDrawRotation rotation, int height, string text, int codepage = 850)

This uses the last font the printer printed with. I will update with your suggestion though, in case the user's last font used didn't have the "Hello World!" characters defined...

rkone commented 5 years ago

Noticed as I edited the Wiki that clearly it wasn't using the overload I just quoted (just as you said). Thanks for the tip.