Class BarcodeCodabar
- Namespace
- iTextSharp.text.pdf
- Assembly
- iTextSharp.LGPLv2.Core.dll
Implements the code codabar. The default parameters are: x = 0.8f; n = 2; font = BaseFont.CreateFont("Helvetica", "winansi", false); size = 8; baseline = size; barHeight = size * 3; textAlignment = Element.ALIGN_CENTER; generateChecksum = false; checksumText = false; startStopText = false; @author Paulo Soares (psoares@consiste.pt)
public class BarcodeCodabar : Barcode
- Inheritance
-
BarcodeCodabar
- Inherited Members
Constructors
BarcodeCodabar()
Creates a new BarcodeCodabar.
public BarcodeCodabar()
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
CalculateChecksum(string)
public static string CalculateChecksum(string code)
Parameters
code
string
Returns
CreateDrawingImage(Color, Color)
public override SKBitmap CreateDrawingImage(Color foreground, Color background)
Parameters
Returns
- SKBitmap
GetBarsCodabar(string)
Creates the bars.
public static byte[] GetBarsCodabar(string text)
Parameters
text
stringthe text to create the bars
Returns
- byte[]
the bars
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