Class Barcode39
- Namespace
- iTextSharp.text.pdf
- Assembly
- iTextSharp.LGPLv2.Core.dll
Implements the code 39 and code 39 extended. The default parameters are: x = 0.8f; n = 2; font = BaseFont.CreateFont("Helvetica", "winansi", false); size = 8; baseline = size; barHeight = size * 3; textint= Element.ALIGN_CENTER; generateChecksum = false; checksumText = false; startStopText = true; extended = false; @author Paulo Soares (psoares@consiste.pt)
public class Barcode39 : Barcode
- Inheritance
-
Barcode39
- Inherited Members
Constructors
Barcode39()
Creates a new Barcode39.
public Barcode39()
Properties
BarcodeSize
Gets the maximum area that the barcode and the text, if any, will occupy. The lower left corner is always (0, 0).
public override Rectangle BarcodeSize { get; }
Property Value
- Rectangle
the size the barcode occupies.
Methods
CreateDrawingImage(Color, Color)
public override SKBitmap CreateDrawingImage(Color foreground, Color background)
Parameters
Returns
- SKBitmap
GetBarsCode39(string)
Creates the bars. stop characters
public static byte[] GetBarsCode39(string text)
Parameters
text
stringthe text to create the bars. This text does not include the start and
Returns
- byte[]
the bars
GetCode39Ex(string)
Converts the extended text into a normal, escaped text, ready to generate bars.
public static string GetCode39Ex(string text)
Parameters
text
stringthe extended text
Returns
- string
the escaped text
PlaceBarcode(PdfContentByte, BaseColor, BaseColor)
Places the barcode in a PdfContentByte . The barcode is always placed at coodinates (0, 0). Use the translation matrix to move it elsewhere. The bars and text are written in the following colors: barColor textColor Result null null bars and text painted with current fill color barColor null bars and text painted with barColor null textColor bars painted with current color text painted with textColor barColor textColor bars painted with barColor text painted with textColor
public override Rectangle PlaceBarcode(PdfContentByte cb, BaseColor barColor, BaseColor textColor)
Parameters
cb
PdfContentBytethe PdfContentByte where the barcode will be placed
barColor
BaseColorthe color of the bars. It can be null
textColor
BaseColorthe color of the text. It can be null
Returns
- Rectangle
the dimensions the barcode occupies