public bool DrawPersonInfo(PrintParameter printPra, ref ZBRGraphics g)
        {
            //float X = 0;
            //float Y = 0;
            string[] pos;

            int iCountParams = printPra.printstr.Length;

            if (true)
            {
                for (int i = 0; i < iCountParams; i++)
                {
                    pos = printPra.position[i].Split(',');

                    //X = GetHPixel((float)Convert.ToDouble(pos[0]));
                    //Y = GetVPixel((float)Convert.ToDouble(pos[1]));

                    int X = Convert.ToInt32(GetHPixel((float)Convert.ToDouble(pos[0])));
                    int Y = Convert.ToInt32(GetVPixel((float)Convert.ToDouble(pos[1])));

                    int err = 0;
                    g.DrawText((int)X, (int)Y, Encoding.Default.GetBytes(printPra.printstr[i]), Encoding.Default.GetBytes("宋体"), 8, 0, 0, out err);
                    g.DrawText((int)X, (int)Y + 1, Encoding.Default.GetBytes(printPra.printstr[i]), Encoding.Default.GetBytes("宋体"), 8, 0, 0, out err);

                    //ret = PrintText((int)X, (int)Y, printPra.printstr[i], 8, "宋体", false);
                    //ret = PrintText((int)X, (int)Y + 1, printPra.printstr[i], 8, "宋体", false);
                }
            }
            return(true);
        }
        // Printing on Both Sides ---------------------------------------------------------------------------

        public void PrintBothSides(string drvName, string frontText, string imgPath,
                                   string backText, out int jobID, out string msg)
        {
            jobID = 0;
            msg   = string.Empty;

            int         errValue; // value of 0 indicates no errors
            ZBRGraphics graphics = null;

            try
            {
                // Creates a Graphics Buffer
                graphics = new ZBRGraphics();

                if (graphics.InitGraphics(ASCIIEncoding.ASCII.GetBytes(drvName), "job", out jobID, out errValue) == 0)
                {
                    msg = "Printing InitGraphics Error: " + errValue.ToString();
                    return;
                }

                // Draws Text into the Graphics Buffer
                int fontStyle = FONT_BOLD | FONT_ITALIC | FONT_UNDERLINE | FONT_STRIKETHRU;

                if (graphics.DrawText(35, 575, ASCIIEncoding.ASCII.GetBytes(frontText), ASCIIEncoding.ASCII.GetBytes("Arial"), 12, fontStyle,
                                      0xFF0000, out errValue) == 0)
                {
                    msg = "Printing DrawText Error: " + errValue.ToString();
                    return;
                }

                // Draws a line into the Graphics Buffer
                if (graphics.DrawLine(35, 300, 300, 300, 0xFF0000, (float)5.0, out errValue) == 0)
                {
                    msg = "Printing DrawLine Error: " + errValue.ToString();
                    return;
                }

                // Places an Image from a File into the Graphics Buffer
                if (graphics.DrawImage(ASCIIEncoding.ASCII.GetBytes(imgPath + "\\Zebra.bmp"), 30, 30, 200, 150, out errValue) == 0)
                {
                    msg = "Printing DrawImage Error: " + errValue.ToString();
                    return;
                }

                // Sends Barcode Data to the Monochrome Buffer
                if (graphics.DrawBarcode(35, 500, 0, 0, 1, 3, 30, 1, ASCIIEncoding.ASCII.GetBytes("123456789"), out errValue) == 0)
                {
                    msg = "Printing DrawBarcode Error: " + errValue.ToString();
                    return;
                }

                // Prints the Graphics Buffer (Front Side)
                if (graphics.PrintGraphics(out errValue) == 0)
                {
                    msg = "Printing PrintGraphics Error: " + errValue.ToString();
                    return;
                }

                // Clears the Graphics Buffer
                if (graphics.ClearGraphics(out errValue) == 0)
                {
                    msg = "Printing ClearGraphics Error: " + errValue.ToString();
                    return;
                }

                // Draws Text into the Graphics Buffer
                if (graphics.DrawText(30, 575, ASCIIEncoding.ASCII.GetBytes(backText), ASCIIEncoding.ASCII.GetBytes("Arial"), 12, fontStyle, 0,
                                      out errValue) == 0)
                {
                    msg = "Printing DrawText Error: " + errValue.ToString();
                    return;
                }

                // Prints the Graphics Buffer (Back Side)
                if (graphics.PrintGraphics(out errValue) == 0)
                {
                    msg = "Printing PrintGraphics Error: " + errValue.ToString();
                    return;
                }
            }
            catch (Exception ex)
            {
                msg += ex.ToString();
                System.Windows.Forms.MessageBox.Show(ex.ToString(), "PrintBothSides");
            }
            finally
            {
                if (graphics != null)
                {
                    // Starts the printing process and releases the Graphics Buffer
                    if (graphics.CloseGraphics(out errValue) == 0)
                    {
                        msg = "Printing CloseGraphics Error: " + errValue.ToString();
                    }
                    graphics = null;
                }
            }
        }