Table of Contents

Class BarcodePostnet

Namespace
iTextSharp.text.pdf
Assembly
iTextSharp.LGPLv2.Core.dll

Implements the Postnet and Planet barcodes. The default parameters are: n = 72f / 22f; // distance between bars x = 0.02f * 72f; // bar width barHeight = 0.125f * 72f; // height of the tall bars size = 0.05f * 72f; // height of the short bars codeType = POSTNET; // type of code @author Paulo Soares (psoares@consiste.pt)

public class BarcodePostnet : Barcode
Inheritance
BarcodePostnet
Inherited Members

Constructors

BarcodePostnet()

Creates new BarcodePostnet

public BarcodePostnet()

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

foreground Color
background Color

Returns

SKBitmap

GetBarsPostnet(string)

Creates the bars for Postnet.

public static byte[] GetBarsPostnet(string text)

Parameters

text string

the code to be created without checksum

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 PdfContentByte

the PdfContentByte where the barcode will be placed

barColor BaseColor

the color of the bars. It can be null

textColor BaseColor

the color of the text. It can be null

Returns

Rectangle

the dimensions the barcode occupies