0 Replies Latest reply on Oct 19, 2018 6:28 AM by Davide Rimondi

    C# PrintDocument class and card Encoding

    Davide Rimondi

      Hi All,

        I'm new with Zebra technologies,  for our customer we also handle card printing with magstripe encoding,

      currently we are using C# and PrintDocument , now ,since we are going to move on Zebra ZC100 (Firmware 201.01.03)

      printers, I'm doing some test.

      Unfortunately the same code seems not working on Zebra printer, basically the tracks are printed in front of the card instead

      of encoded in the magstripe, 

      Could you kindly help me?

      Thanks

      Davide

       

      the code is pretty sample

      private void ZebraPrintingNoSdk(PrintPageEventArgs e)
              {
                  var g = e.Graphics;
                  SizeF sz = e.Graphics.VisibleClipBounds.Size;
                  e.Graphics.Clear(System.Drawing.Color.Transparent);            
                  e.Graphics.RotateTransform(DEGREES);
                  var track1 = "~1%B" + PrintInfo.AlphaArg1 + "^" +PrintInfo.AlphaArg2  + "^4586540000000000000000000000?";
                  var track2 = "~2;" + PrintInfo.NumericArg1 + "=99125013800000000?";
                //Encoding on magstripe 
                  g.DrawString(track1, new Font("Verdana", 3, System.Drawing.FontStyle.Regular), SystemBrushes.ControlText, 0.0f, -195,new StringFormat() { Trimming = StringTrimming.Character });
                  g.DrawString(track2, new Font("Verdana", 3, System.Drawing.FontStyle.Regular), SystemBrushes.ControlText, 0.0f, -190, new StringFormat() { Trimming = StringTrimming.Character });
      
      
                  //print on front            
                  g.DrawString(PrintInfo.AlphaArg1, new Font("Verdana", 9, System.Drawing.FontStyle.Bold), SystemBrushes.ControlText, X, Y);
                  e.HasMorePages = false;
              }