private BlackMarkType GetBlackMarkType() { BlackMarkType type = BlackMarkType.Invalid; if (BlackMarkDetectionIsEnabled) { type = blackMarkType; } return(type); }
/// <summary> /// Sample : Creating printing paste text with black mark commands. /// </summary> private byte[] CreatePrintBlackMarkPasteTextCommands(string pasteText) { // Your printer emulation. Emulation emulation = SharedInformationManager.SelectedEmulation; // Creating localize receipt commands sample is in "LocalizeReceipts/'Language'Receipt.cs" LocalizeReceipt localizeReceipt = SharedInformationManager.SelectedLocalizeReceipt; // Select using double height. bool doubleHeight = (bool)doubleHeightCheckBox.IsChecked; // Select black mark type. BlackMarkType blackMarkType = SharedInformationManager.SelectedBlackMarkType; byte[] commands = PrinterFunctions.CreatePasteTextBlackMarkData(emulation, localizeReceipt, pasteText, doubleHeight, blackMarkType, false); return(commands); }
public static byte[] CreateBlackMarkData(Emulation emulation, BlackMarkType type) { byte[] data = Encoding.UTF8.GetBytes("Hello World.\n"); ICommandBuilder builder = StarIoExt.CreateCommandBuilder(emulation); builder.BeginDocument(); builder.AppendBlackMark(type); builder.Append(data); builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed); //builder.AppendBlackMark(BlackMarkType.Invalid); builder.EndDocument(); return(builder.Commands); }
private string GetBlackMarkTypeDescription(BlackMarkType type) { string description = ""; switch (type) { default: case BlackMarkType.Invalid: description = "Invalid"; break; case BlackMarkType.Valid: description = "Valid"; break; case BlackMarkType.ValidWithDetection: description = "Valid With Detection"; break; } return(description); }
/// <summary> /// Sample : Creating printing receipt with black mark commands. /// </summary> public static byte[] CreateLocalizeReceiptWithBlackMarkCommands(ReceiptInformationManager receiptInfo) { // Your printer emulation. Emulation emulation = SharedInformationManager.GetSelectedEmulation(); // Select black mark type. BlackMarkType blackMarkType = SharedInformationManager.GetSelectedBlackMarkType(); // Creating localize receipt commands sample is in "LocalizeReceipts/'Language'Receipt.cs" ReceiptInformationManager.ReceiptType type = receiptInfo.Type; LocalizeReceipt localizeReceipt = receiptInfo.LocalizeReceipt; byte[] commands; switch (receiptInfo.Type) { default: case ReceiptInformationManager.ReceiptType.Text: commands = PrinterFunctions.CreateTextBlackMarkData(emulation, localizeReceipt, blackMarkType, false); break; } return(commands); }
public static byte[] CreatePasteTextBlackMarkData(StarIoExtEmulation emulation, LocalizeReceipts.ILocalizeReceipts localizeReceipts, string text, bool doubleHeight, BlackMarkType type, bool utf8) { ICommandBuilder commandBuilder = Extension.CreateCommandBuilder(emulation); commandBuilder.BeginDocument(); commandBuilder.AppendBlackMark(type); if (doubleHeight) { commandBuilder.AppendMultipleHeight(2); localizeReceipts.AppendPasteTextLabelData(commandBuilder, text, utf8); commandBuilder.AppendMultipleHeight(1); } else { localizeReceipts.AppendPasteTextLabelData(commandBuilder, text, utf8); } commandBuilder.AppendCutPaper(CutPaperAction.PartialCutWithFeed); // commandBuilder.AppendBlackMark(BlackMarkType.Invalid); commandBuilder.EndDocument(); return(commandBuilder.Commands); }
public static byte[] CreateTextBlackMarkData(StarIoExtEmulation emulation, LocalizeReceipts.ILocalizeReceipts localizeReceipts, BlackMarkType type, bool utf8) { ICommandBuilder commandBuilder = Extension.CreateCommandBuilder(emulation); commandBuilder.BeginDocument(); commandBuilder.AppendBlackMark(type); localizeReceipts.AppendTextLabelData(commandBuilder, utf8); commandBuilder.AppendCutPaper(CutPaperAction.PartialCutWithFeed); // commandBuilder.AppendBlackMark(BlackMarkType.Invalid); commandBuilder.EndDocument(); return(commandBuilder.Commands); }
public static byte[] CreatePasteTextBlackMarkData(Emulation emulation, LocalizeReceipt localizeReceipt, string pasteText, bool doubleHeight, BlackMarkType type, bool utf8) { ICommandBuilder builder = StarIoExt.CreateCommandBuilder(emulation); builder.BeginDocument(); builder.AppendBlackMark(type); if (doubleHeight) { builder.AppendMultipleHeight(2); localizeReceipt.AppendPasteTextLabelData(builder, pasteText, utf8); builder.AppendMultipleHeight(1); } else { localizeReceipt.AppendPasteTextLabelData(builder, pasteText, utf8); } builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed); builder.EndDocument(); return(builder.Commands); }
public static byte[] CreateTextBlackMarkData(Emulation emulation, LocalizeReceipt localizeReceipt, BlackMarkType type, bool utf8) { ICommandBuilder builder = StarIoExt.CreateCommandBuilder(emulation); builder.BeginDocument(); builder.AppendBlackMark(type); localizeReceipt.AppendTextLabelData(builder, utf8); builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed); builder.EndDocument(); return(builder.Commands); }
public static void SetBlackMarkType(BlackMarkType type) { SelectedModelManager.BlackMarkType = type; }