public void SetText(string sText, Enumerations.FontSize oFontSize = Enumerations.FontSize.Medium, FontStyle oFontStyle = FontStyle.Regular, bool bFontExpanded = false, Enumerations.TextAlignmentType oTextAlignmentType = Enumerations.TextAlignmentType.Center, bool bBreakLine = true)
        {
            string sSpaces;

            switch (oTextAlignmentType)
            {
            case Enumerations.TextAlignmentType.Center:
                sSpaces = PrintUtility.GetCenterAlignmentText(sText, TotalCharactersPerLine, oFontSize);
                SetText(sSpaces, oFontSize, FontStyle.Regular, bFontExpanded, Enumerations.TextAlignmentType.Left, false);
                break;

            case Enumerations.TextAlignmentType.Right:
                sSpaces = PrintUtility.GetRightAlignmentText(sText, TotalCharactersPerLine, oFontSize);
                SetText(sSpaces, oFontSize, FontStyle.Regular, bFontExpanded, Enumerations.TextAlignmentType.Left, false);
                break;

            case Enumerations.TextAlignmentType.Left:
            default:
                break;
            }

            int iItalic    = oFontStyle.ToString().Contains(FontStyle.Italic.ToString()) ? 1 : 0;
            int iUnderline = oFontStyle.ToString().Contains(FontStyle.Underline.ToString()) ? 1 : 0;
            int iExpanded  = bFontExpanded ? 1 : 0;
            int iBold      = oFontStyle.ToString().Contains(FontStyle.Bold.ToString()) ? 1 : 0;

            Commands.Add(new Command("BematechInterface.FormataTX", () => BematechInterface.FormataTX(sText, (int)oFontSize, iItalic, iUnderline, iExpanded, iBold)));

            if (bBreakLine)
            {
                BreakLine(1);
            }
        }
        public void BreakLine(int iNumBreaks)
        {
            if (iNumBreaks <= 0)
            {
                return;
            }

            const string sBreakLineCommand = "\r\n";

            while (iNumBreaks > 0)
            {
                Commands.Add(new Command("BematechInterface.ComandoTX", () => BematechInterface.ComandoTX(sBreakLineCommand, sBreakLineCommand.Length)));
                iNumBreaks--;
            }
        }
        public void SetCutPaper(Enumerations.CutType oPrintCutType)
        {
            switch (oPrintCutType)
            {
            case Enumerations.CutType.None:
                // No cut.
                break;

            case Enumerations.CutType.Partial:
                Commands.Add(new Command("BematechInterface.AcionaGuilhotina", () => BematechInterface.AcionaGuilhotina(0)));
                break;

            case Enumerations.CutType.Full:
                Commands.Add(new Command("BematechInterface.AcionaGuilhotina", () => BematechInterface.AcionaGuilhotina(1)));
                break;
            }
        }
        public void SetVoucher(Enumerations.BarcodeType oBarcodeType, string sCode)
        {
            if (string.IsNullOrEmpty(sCode))
            {
                return;
            }

            Commands.Add(new Command("BematechInterface.ConfiguraCodigoBarras", () => BematechInterface.ConfiguraCodigoBarras(50, 0, 2, 0, 90)));

            BreakLine(1);

            //TODO: Implement all Barcode Types
            switch (oBarcodeType)
            {
            case Enumerations.BarcodeType.CODE128:
                Commands.Add(new Command("BematechInterface.ImprimeCodigoBarrasCODE128", () => BematechInterface.ImprimeCodigoBarrasCODE128(sCode)));
                break;
            }
        }
 public void SetImage(string sImagePath)
 {
     Commands.Add(new Command("BematechInterface.ImprimeBmpEspecial", () => BematechInterface.ImprimeBmpEspecial(sImagePath, -1, 0, 0)));
 }
        public void InitCommunication()
        {
            var sCommunicationPort = GetPrinterComPort;

            Commands.Add(new Command("BematechInterface.IniciaPorta", () => BematechInterface.IniciaPorta(sCommunicationPort)));
        }
 public BematechController(IPrinter printer)
     : base(printer)
 {
     Commands.Add(new Command("BematechInterface.ConfiguraModeloImpressora", () => BematechInterface.ConfiguraModeloImpressora(Convert.ToInt32(PrinterConfig.Model))));
 }
 public void CheckStatus()
 {
     Commands.Add(new Command("BematechInterface.Le_Status", () => BematechInterface.Le_Status()));
 }
 public void CloseCommunication()
 {
     Commands.Add(new Command("BematechInterface.FechaPorta", () => BematechInterface.FechaPorta()));
 }