Problems with starting of the sample code

May 13, 2016 at 4:14 PM
Hello,

I am using the sample code from your qickguide and have some issues with it! This is my code I am using in C#
    private void metroButton4_Click(object sender, EventArgs e)
    {
        PrinterSettings ps = new PrinterSettings();
        ps.PrinterName = "ZDesigner GK420t";
        ps.Width = 203 * 4;
        ps.Length = 203 * 6;
        ps.Darkness = 30;

        List<byte> page = new List<byte>();
        page.AddRange(ZPLCommands.ClearPrinter(ps));

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

        page.AddRange(ZPLCommands.PrintBuffer(1));
        new SpoolPrinter(ps).Print(page.ToArray());
    }
and I am getting this mistakes for this line
page.AddRange(ZPLCommands.TextWrite(10, 150, ElementDrawRotation.NO_ROTATION, ZebraFont.STANDARD_NORMAL, 15, "Hello World!"));

Error CS1503 Argument 6: cannot convert from 'string' to 'int' -> this onfor the value "Hello World"
Error CS1503 Argument 5: cannot convert from 'int' to 'string' -> this for the value 15
Error CS1503 Argument 4: cannot convert from 'Com.SharpZebra.ZebraFont' to 'int' -> this is for the value ZebraFont.STANDARD_NORMAL

Can anyone help me and tell me what I am doing wrong?

Cheers and Thanks
Stefan
Coordinator
May 15, 2016 at 5:39 PM
I think the problem is you don't have the correct version. It should be v0.91 that you can get from the downloads area. I unfortunately have never updated the depository, which is what I assume you are using.