Class BarcodeInter25
- Namespace
- iTextSharp.text.pdf
- Assembly
- iTextSharp.LGPLv2.Core.dll
Implements the code interleaved 2 of 5. The text can include non numeric characters that are printed but do not generate bars. 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; @author Paulo Soares (psoares@consiste.pt)
public class BarcodeInter25 : Barcode
- Inheritance
-
BarcodeInter25
- Inherited Members
Constructors
BarcodeInter25()
Creates new BarcodeInter25
public BarcodeInter25()
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
GetBarsInter25(string)
Creates the bars for the barcode.
public static byte[] GetBarsInter25(string text)
Parameters
text
stringthe text. It can contain non numeric characters
Returns
- byte[]
the barcode
GetChecksum(string)
Calculates the checksum.
public static char GetChecksum(string text)
Parameters
text
stringthe numeric text
Returns
- char
the checksum
KeepNumbers(string)
Deletes all the non numeric characters from text .
public static string KeepNumbers(string text)
Parameters
text
stringthe text
Returns
- string
a string with only numeric characters
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