public static PrintableBuilder SetFont(this PrintableBuilder builder, FontMode fontMode = FontMode.FontA) { if (builder == null) { throw new ArgumentNullException(nameof(builder)); } return(builder.Add(new SetFont(fontMode))); }
public static PrintableBuilder SetCodePage(this PrintableBuilder builder, byte codePage) { if (builder == null) { throw new ArgumentNullException(nameof(builder)); } return(builder.Add(new SetCodePage(codePage))); }
public static PrintableBuilder Feed(this PrintableBuilder builder) { if (builder == null) { throw new ArgumentNullException(nameof(builder)); } return(builder.Add(new Feed())); }
public static PrintableBuilder Cut(this PrintableBuilder builder, CutType type = CutType.Partial) { if (builder == null) { throw new ArgumentNullException(nameof(builder)); } return(builder.Add(new Cut(type))); }
public static PrintableBuilder SetJustification(this PrintableBuilder builder, JustificationType justificationType = JustificationType.Left) { if (builder == null) { throw new ArgumentNullException(nameof(builder)); } return(builder.Add(new SetJustification(justificationType))); }
public static PrintableBuilder AddTextLine(this PrintableBuilder builder, string content = "", CodePage codePage = CodePage.Default, Encoding encoding = null, bool feed = true) { if (builder == null) { throw new ArgumentNullException(nameof(builder)); } return(builder.Add(new TextLine(content, codePage, encoding, feed))); }
public byte[] GetBytes() { var builder = new PrintableBuilder(); var contentBytes = _encoding.GetBytes(_content); builder .Add(new SetCodePage(_codePage)) .Add(contentBytes); if (_feed) { builder.Add(new Feed()); } builder.Add(new SetCodePage(CodePage.Default)); return(builder.ToArray()); }
public static PrintableBuilder AddBarcode(this PrintableBuilder builder, string content = "", int height = 32, BarcodeType barcodeType = BarcodeType.Code128) { if (builder == null) { throw new ArgumentNullException(nameof(builder)); } return(builder.Add(new Barcode(content, height, barcodeType))); }