protected virtual void GetPosition([NotNull] T svgElement, [NotNull] Matrix sourceMatrix, [NotNull] Matrix viewMatrix, out int horizontalStart, out int verticalStart, out FieldOrientation fieldOrientation, out float fontSize) { if (svgElement == null) { throw new ArgumentNullException(nameof(svgElement)); } if (sourceMatrix == null) { throw new ArgumentNullException(nameof(sourceMatrix)); } if (viewMatrix == null) { throw new ArgumentNullException(nameof(viewMatrix)); } this.ZplTransformer.Transform(svgElement, sourceMatrix, viewMatrix, out var x, out var y, out fontSize); horizontalStart = (int)x; verticalStart = (int)y; fieldOrientation = this.ZplTransformer.GetFieldOrientation(sourceMatrix, viewMatrix); }
/// <exception cref="ArgumentNullException"><paramref name="svgElement" /> is <see langword="null" />.</exception> /// <exception cref="ArgumentNullException"><paramref name="fontName" /> is <see langword="null" />.</exception> /// <exception cref="ArgumentNullException"><paramref name="text" /> is <see langword="null" />.</exception> /// <exception cref="ArgumentNullException"><paramref name="zplContainer" /> is <see langword="null" />.</exception> protected virtual void AddTranslationToContainer([NotNull] T svgElement, int horizontalStart, int verticalStart, [NotNull] string fontName, FieldOrientation fieldOrientation, int characterHeight, int width, [NotNull] string text, [NotNull] ZplContainer zplContainer) { if (fontName == null) { throw new ArgumentNullException(nameof(fontName)); } if (text == null) { throw new ArgumentNullException(nameof(text)); } if (zplContainer == null) { throw new ArgumentNullException(nameof(zplContainer)); } zplContainer.Body.Add(this.ZplCommands.FieldTypeset(horizontalStart, verticalStart)); zplContainer.Body.Add(this.ZplCommands.Font(fontName, fieldOrientation, characterHeight, width, text)); }
/// <summary> /// EAN-13 Barcode /// </summary> /// <param name="content"></param> /// <param name="positionX"></param> /// <param name="positionY"></param> /// <param name="height"></param> /// <param name="moduleWidth"></param> /// <param name="wideBarToNarrowBarWidthRatio"></param> /// <param name="fieldOrientation"></param> /// <param name="printInterpretationLine"></param> /// <param name="printInterpretationLineAboveCode"></param> /// <param name="bottomToTop"></param> public ZplBarcodeEan13( string content, int positionX, int positionY, int height = 100, int moduleWidth = 2, double wideBarToNarrowBarWidthRatio = 3, FieldOrientation fieldOrientation = FieldOrientation.Normal, bool printInterpretationLine = true, bool printInterpretationLineAboveCode = false, bool bottomToTop = false) : base(content, positionX, positionY, height, moduleWidth, wideBarToNarrowBarWidthRatio, fieldOrientation, printInterpretationLine, printInterpretationLineAboveCode, bottomToTop) { if (!IsDigitsOnly(content)) { throw new ArgumentException("EAN-13 Barcode allow only digits", nameof(content)); } }
public FontInfo(string fontName, FieldOrientation fieldOrientation, int fontWidth, int fontHeight) { this.FontName = fontName; this.FieldOrientation = fieldOrientation; this.FontWidth = fontWidth; this.FontHeight = fontHeight; }
/// <summary> /// Code 39 Barcode /// </summary> /// <param name="content"></param> /// <param name="positionX"></param> /// <param name="positionY"></param> /// <param name="height"></param> /// <param name="moduleWidth"></param> /// <param name="wideBarToNarrowBarWidthRatio"></param> /// <param name="fieldOrientation"></param> /// <param name="printInterpretationLine"></param> /// <param name="printInterpretationLineAboveCode"></param> /// <param name="mod43CheckDigit"></param> /// <param name="bottomToTop"></param> public ZplBarcode39( string content, int positionX, int positionY, int height = 100, int moduleWidth = 2, double wideBarToNarrowBarWidthRatio = 3, FieldOrientation fieldOrientation = FieldOrientation.Normal, bool printInterpretationLine = true, bool printInterpretationLineAboveCode = false, bool mod43CheckDigit = false, bool bottomToTop = false) : base(content, positionX, positionY, height, moduleWidth, wideBarToNarrowBarWidthRatio, fieldOrientation, printInterpretationLine, printInterpretationLineAboveCode, bottomToTop) { Mod43CheckDigit = mod43CheckDigit; }
public void SetNextFont( string fontName, FieldOrientation fieldOrientation, int fontWidth, int fontHeight) { this.NextFont = new FontInfo(fontName, fieldOrientation, fontWidth, fontHeight); }
public ZplFont( int fontWidth = 30, int fontHeight = 30, string fontName = "0", FieldOrientation fieldOrientation = FieldOrientation.Normal) { FontName = fontName; FieldOrientation = fieldOrientation; FontWidth = fontWidth; FontHeight = fontHeight; }
/// <summary> /// Data Matrix Bar Code /// </summary> /// <param name="content"></param> /// <param name="positionX"></param> /// <param name="positionY"></param> /// <param name="height"></param> /// <param name="fieldOrientation"></param> /// <param name="bottomToTop"></param> public ZplDataMatrix( string content, int positionX, int positionY, int height = 100, FieldOrientation fieldOrientation = FieldOrientation.Normal, bool bottomToTop = false ) : base(positionX, positionY, bottomToTop) { Content = content; FieldOrientation = fieldOrientation; Height = height; }
public virtual string Code39BarCode(FieldOrientation fieldOrientation, int barCodeHeight, [NotNull] string content, PrintInterpretationLine printInterpretationLine = PrintInterpretationLine.Yes, PrintInterpretationLineAboveCode printInterpretationLineAboveCode = PrintInterpretationLineAboveCode.No, Mod43Check mod43Check = Mod43Check.No) { if (content == null) { throw new ArgumentNullException(nameof(content)); } return($"^B3{(char) fieldOrientation},{(char) mod43Check},{barCodeHeight},{(char) printInterpretationLine},{(char) printInterpretationLineAboveCode}^FD{content}^FS"); }
public virtual string Interleaved2Of5BarCode(FieldOrientation fieldOrientation, int barCodeHeight, [NotNull] string content, PrintInterpretationLine printInterpretationLine = PrintInterpretationLine.Yes, PrintInterpretationLineAboveCode printInterpretationLineAboveCode = PrintInterpretationLineAboveCode.No, CalculateAndPrintMod10CheckDigit calculateAndPrintMod10CheckDigit = CalculateAndPrintMod10CheckDigit.No) { if (content == null) { throw new ArgumentNullException(nameof(content)); } return($"^B2{(char) fieldOrientation},{barCodeHeight},{(char) printInterpretationLine},{(char) printInterpretationLineAboveCode},{(char) calculateAndPrintMod10CheckDigit}^FD{content}^FS"); }
public ZplGraphicSymbol( GraphicSymbolCharacter character, int positionX, int positionY, int width, int height, FieldOrientation fieldOrientation = FieldOrientation.Normal) : base(positionX, positionY) { Character = character; FieldOrientation = fieldOrientation; Width = width; Height = height; }
public virtual string Code128BarCode(FieldOrientation fieldOrientation, int barCodeHeight, [NotNull] string content, PrintInterpretationLine printInterpretationLine = PrintInterpretationLine.Yes, PrintInterpretationLineAboveCode printInterpretationLineAboveCode = PrintInterpretationLineAboveCode.No, UccCheckDigit uccCheckDigit = UccCheckDigit.No, Mode mode = Mode.NoSelectedMode) { if (content == null) { throw new ArgumentNullException(nameof(content)); } return($"^BC{(char) fieldOrientation},{barCodeHeight},{(char) printInterpretationLine},{(char) printInterpretationLineAboveCode},{(char) uccCheckDigit},{(char) mode}^FD{content}^FS"); }
public virtual string AztecBarCode(FieldOrientation fieldOrientation, int magnificationFactor, [NotNull] string content, ExtendedChannelInterpretationCodeIndicator extendedChannelInterpretationCodeIndicator = ExtendedChannelInterpretationCodeIndicator.No, int errorControlAndSymbolSizeTypeIndictaor = 0, MenuSymbolIndicator menuSymbolIndicator = MenuSymbolIndicator.No, int numberOfSymbolsForStructuredAppend = 1) { if (content == null) { throw new ArgumentNullException(nameof(content)); } return($"^B0{(char) fieldOrientation},{magnificationFactor},{(char) extendedChannelInterpretationCodeIndicator},{errorControlAndSymbolSizeTypeIndictaor},{(char) menuSymbolIndicator},{numberOfSymbolsForStructuredAppend}^FD{content}^FS"); }
public virtual string Font([NotNull] string fontName, FieldOrientation fieldOrientation, int characterHeight, int width, [NotNull] string text) { if (fontName == null) { throw new ArgumentNullException(nameof(fontName)); } if (text == null) { throw new ArgumentNullException(nameof(text)); } return($"^A{fontName}{(char) fieldOrientation},{characterHeight},{width}^FD{text}^FS"); }
public string RenderFieldOrientation(FieldOrientation fieldOrientation) { switch (fieldOrientation) { case FieldOrientation.Normal: return("N"); case FieldOrientation.Rotated90: return("R"); case FieldOrientation.Rotated180: return("I"); case FieldOrientation.Rotated270: return("B"); } throw new NotImplementedException("Unknown Field Orientation"); }
public ZplBarcode( string content, int positionX, int positionY, int height, int moduleWidth, double wideBarToNarrowBarWidthRatio, FieldOrientation fieldOrientation, bool printInterpretationLine, bool printInterpretationLineAboveCode, bool bottomToTop = false) : base(positionX, positionY, bottomToTop) { Content = content; Height = height; ModuleWidth = moduleWidth; WideBarToNarrowBarWidthRatio = wideBarToNarrowBarWidthRatio; FieldOrientation = fieldOrientation; PrintInterpretationLine = printInterpretationLine; PrintInterpretationLineAboveCode = printInterpretationLineAboveCode; }
/// <summary> /// Ansi Codabar Barcode /// </summary> /// <param name="content"></param> /// <param name="startCharacter">A,B,C,D</param> /// <param name="stopCharacter">A,B,C,D</param> /// <param name="positionX"></param> /// <param name="positionY"></param> /// <param name="height"></param> /// <param name="moduleWidth"></param> /// <param name="wideBarToNarrowBarWidthRatio"></param> /// <param name="fieldOrientation"></param> /// <param name="printInterpretationLine"></param> /// <param name="printInterpretationLineAboveCode"></param> /// <param name="checkDigit"></param> /// <param name="bottomToTop"></param> public ZplBarcodeAnsiCodabar( string content, char startCharacter, char stopCharacter, int positionX, int positionY, int height = 100, int moduleWidth = 2, double wideBarToNarrowBarWidthRatio = 3, FieldOrientation fieldOrientation = FieldOrientation.Normal, bool printInterpretationLine = true, bool printInterpretationLineAboveCode = false, bool checkDigit = false, bool bottomToTop = false) : base(content, positionX, positionY, height, moduleWidth, wideBarToNarrowBarWidthRatio, fieldOrientation, printInterpretationLine, printInterpretationLineAboveCode, bottomToTop) { if (!IsValidCharacter(startCharacter)) { throw new InvalidOperationException("ANSI Codabar start charactor must be one of A, B, C, D"); } if (!IsValidCharacter(stopCharacter)) { throw new InvalidOperationException("ANSI Codabar stop charactor must be one of A, B, C, D"); } CheckDigit = checkDigit; StartCharacter = char.ToUpper(startCharacter); StopCharacter = char.ToUpper(stopCharacter); }
public FontDefinition SetOrientation(FieldOrientation orientation) { _orientation = orientation; return this; }
public FontDefinition(string fontType, int size) { Height = size; FontType = fontType; _orientation = FieldOrientation.Normal; }
public bool ShouldSerializeFieldOrientation() => SerializeDefaults || !FieldOrientation.Equals(ZPLForgeDefaults.Elements.Symbol.FieldOrientation);
public LabelTextGenerator SetFont(string type, FieldOrientation orientation, int size) { _font = new FontDefinition(type, size); _font.SetOrientation(orientation); return this; }