HiraokaHyperTools.iTextSharp-LGPL  0.2.5
iTextSharp.text.pdf.Barcode Class Referenceabstract
Inheritance diagram for iTextSharp.text.pdf.Barcode:
iTextSharp.text.pdf.Barcode128 iTextSharp.text.pdf.Barcode39 iTextSharp.text.pdf.BarcodeCodabar iTextSharp.text.pdf.BarcodeEAN iTextSharp.text.pdf.BarcodeEANSUPP iTextSharp.text.pdf.BarcodeInter25 iTextSharp.text.pdf.BarcodePostnet

Public Member Functions

abstract Rectangle PlaceBarcode (PdfContentByte cb, Color barColor, Color textColor)
 
PdfTemplate CreateTemplateWithBarcode (PdfContentByte cb, Color barColor, Color textColor)
 
Image CreateImageWithBarcode (PdfContentByte cb, Color barColor, Color textColor)
 
abstract System.Drawing.Image CreateDrawingImage (System.Drawing.Color foreground, System.Drawing.Color background)
 

Static Public Attributes

const int EAN13 = 1
 
const int EAN8 = 2
 
const int UPCA = 3
 
const int UPCE = 4
 
const int SUPP2 = 5
 
const int SUPP5 = 6
 
const int POSTNET = 7
 
const int PLANET = 8
 
const int CODE128 = 9
 
const int CODE128_UCC = 10
 
const int CODE128_RAW = 11
 
const int CODABAR = 12
 

Protected Attributes

float x
 
float n
 
BaseFont font
 
float size
 
float baseline
 
float barHeight
 
int textAlignment
 
bool generateChecksum
 
bool checksumText
 
bool startStopText
 
bool extended
 
string code = ""
 
bool guardBars
 
int codeType
 
float inkSpreading = 0
 
String altText
 

Properties

float X [get, set]
 
float N [get, set]
 
BaseFont Font [get, set]
 
float Size [get, set]
 
float Baseline [get, set]
 
float BarHeight [get, set]
 
int TextAlignment [get, set]
 
bool GenerateChecksum [get, set]
 
bool ChecksumText [get, set]
 
bool StartStopText [get, set]
 
bool Extended [get, set]
 
virtual string Code [get, set]
 
bool GuardBars [get, set]
 
int CodeType [get, set]
 
abstract Rectangle BarcodeSize [get]
 
float InkSpreading [get, set]
 
String AltText [get, set]
 

Detailed Description

Base class containing properties and methods commom to all barcode types.

Author
Paulo Soares (psoar.nosp@m.es@c.nosp@m.onsis.nosp@m.te.p.nosp@m.t)

Member Function Documentation

◆ CreateDrawingImage()

abstract System.Drawing.Image iTextSharp.text.pdf.Barcode.CreateDrawingImage ( System.Drawing.Color  foreground,
System.Drawing.Color  background 
)
pure virtual

◆ CreateImageWithBarcode()

Image iTextSharp.text.pdf.Barcode.CreateImageWithBarcode ( PdfContentByte  cb,
Color  barColor,
Color  textColor 
)

Creates an Image with the barcode.

Parameters
cbthe PdfContentByte to create the Image. It serves no other use
barColorthe color of the bars. It can be null
textColorthe color of the text. It can be null
Returns
the Image
See also
#placeBarcode(PdfContentByte cb, Color barColor, Color textColor)

◆ CreateTemplateWithBarcode()

PdfTemplate iTextSharp.text.pdf.Barcode.CreateTemplateWithBarcode ( PdfContentByte  cb,
Color  barColor,
Color  textColor 
)

Creates a template with the barcode.

Parameters
cbthe PdfContentByte to create the template. It serves no other use
barColorthe color of the bars. It can be null
textColorthe color of the text. It can be null
Returns
the template
See also
#placeBarcode(PdfContentByte cb, Color barColor, Color textColor)

◆ PlaceBarcode()

abstract Rectangle iTextSharp.text.pdf.Barcode.PlaceBarcode ( PdfContentByte  cb,
Color  barColor,
Color  textColor 
)
pure virtual

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

Parameters
cbthe PdfContentByte where the barcode will be placed
barColorthe color of the bars. It can be null
textColorthe color of the text. It can be null
Returns
the dimensions the barcode occupies

Implemented in iTextSharp.text.pdf.BarcodePostnet, iTextSharp.text.pdf.BarcodeInter25, iTextSharp.text.pdf.BarcodeEANSUPP, iTextSharp.text.pdf.BarcodeEAN, iTextSharp.text.pdf.BarcodeCodabar, iTextSharp.text.pdf.Barcode39, and iTextSharp.text.pdf.Barcode128.

Member Data Documentation

◆ altText

String iTextSharp.text.pdf.Barcode.altText
protected

The alternate text to be used, if present.

◆ barHeight

float iTextSharp.text.pdf.Barcode.barHeight
protected

The height of the bars.

◆ baseline

float iTextSharp.text.pdf.Barcode.baseline
protected

If positive, the text distance under the bars. If zero or negative, the text distance above the bars.

◆ checksumText

bool iTextSharp.text.pdf.Barcode.checksumText
protected

Shows the generated checksum in the the text.

◆ CODABAR

const int iTextSharp.text.pdf.Barcode.CODABAR = 12
static

A type of barcode

◆ code

string iTextSharp.text.pdf.Barcode.code = ""
protected

The code to generate.

◆ CODE128

const int iTextSharp.text.pdf.Barcode.CODE128 = 9
static

A type of barcode

◆ CODE128_RAW

const int iTextSharp.text.pdf.Barcode.CODE128_RAW = 11
static

A type of barcode

◆ CODE128_UCC

const int iTextSharp.text.pdf.Barcode.CODE128_UCC = 10
static

A type of barcode

◆ codeType

int iTextSharp.text.pdf.Barcode.codeType
protected

The code type.

◆ EAN13

const int iTextSharp.text.pdf.Barcode.EAN13 = 1
static

A type of barcode

◆ EAN8

const int iTextSharp.text.pdf.Barcode.EAN8 = 2
static

A type of barcode

◆ extended

bool iTextSharp.text.pdf.Barcode.extended
protected

Generates extended barcode 39.

◆ font

BaseFont iTextSharp.text.pdf.Barcode.font
protected

The text font. null if no text.

◆ generateChecksum

bool iTextSharp.text.pdf.Barcode.generateChecksum
protected

The optional checksum generation.

◆ guardBars

bool iTextSharp.text.pdf.Barcode.guardBars
protected

Show the guard bars for barcode EAN.

◆ inkSpreading

float iTextSharp.text.pdf.Barcode.inkSpreading = 0
protected

The ink spreading.

◆ n

float iTextSharp.text.pdf.Barcode.n
protected

The bar multiplier for wide bars or the distance between bars for Postnet and Planet.

◆ PLANET

const int iTextSharp.text.pdf.Barcode.PLANET = 8
static

A type of barcode

◆ POSTNET

const int iTextSharp.text.pdf.Barcode.POSTNET = 7
static

A type of barcode

◆ size

float iTextSharp.text.pdf.Barcode.size
protected

The size of the text or the height of the shorter bar in Postnet.

◆ startStopText

bool iTextSharp.text.pdf.Barcode.startStopText
protected

Show the start and stop character '*' in the text for the barcode 39 or 'ABCD' for codabar.

◆ SUPP2

const int iTextSharp.text.pdf.Barcode.SUPP2 = 5
static

A type of barcode

◆ SUPP5

const int iTextSharp.text.pdf.Barcode.SUPP5 = 6
static

A type of barcode

◆ textAlignment

int iTextSharp.text.pdf.Barcode.textAlignment
protected

◆ UPCA

const int iTextSharp.text.pdf.Barcode.UPCA = 3
static

A type of barcode

◆ UPCE

const int iTextSharp.text.pdf.Barcode.UPCE = 4
static

A type of barcode

◆ x

float iTextSharp.text.pdf.Barcode.x
protected

The minimum bar width.

Property Documentation

◆ AltText

String iTextSharp.text.pdf.Barcode.AltText
getset

Sets the alternate text. If present, this text will be used instead of the text derived from the supplied code.

Parameters
altTextthe alternate text

◆ BarcodeSize

abstract Rectangle iTextSharp.text.pdf.Barcode.BarcodeSize
get

Gets the maximum area that the barcode and the text, if any, will occupy. The lower left corner is always (0, 0).

Returns
the size the barcode occupies.

◆ BarHeight

float iTextSharp.text.pdf.Barcode.BarHeight
getset

Gets the height of the bars.

Returns
the height of the bars

◆ Baseline

float iTextSharp.text.pdf.Barcode.Baseline
getset

Gets the text baseline. If positive, the text distance under the bars. If zero or negative, the text distance above the bars.

Returns
the baseline.

◆ ChecksumText

bool iTextSharp.text.pdf.Barcode.ChecksumText
getset

Sets the property to show the generated checksum in the the text.

Parameters
checksumTextnew value of property checksumText

◆ Code

virtual string iTextSharp.text.pdf.Barcode.Code
getset

Gets the code to generate.

Returns
the code to generate

◆ CodeType

int iTextSharp.text.pdf.Barcode.CodeType
getset

Gets the code type.

Returns
the code type

◆ Extended

bool iTextSharp.text.pdf.Barcode.Extended
getset

Sets the property to generate extended barcode 39.

Parameters
extendednew value of property extended

◆ Font

BaseFont iTextSharp.text.pdf.Barcode.Font
getset

Gets the text font. null if no text.

Returns
the text font. null if no text

◆ GenerateChecksum

bool iTextSharp.text.pdf.Barcode.GenerateChecksum
getset

The property for the optional checksum generation.

◆ GuardBars

bool iTextSharp.text.pdf.Barcode.GuardBars
getset

Sets the property to show the guard bars for barcode EAN.

Parameters
guardBarsnew value of property guardBars

◆ InkSpreading

float iTextSharp.text.pdf.Barcode.InkSpreading
getset

◆ N

float iTextSharp.text.pdf.Barcode.N
getset

Gets the bar multiplier for wide bars.

Returns
the bar multiplier for wide bars

◆ Size

float iTextSharp.text.pdf.Barcode.Size
getset

Gets the size of the text.

Returns
the size of the text

◆ StartStopText

bool iTextSharp.text.pdf.Barcode.StartStopText
getset

Gets the property to show the start and stop character '*' in the text for the barcode 39.

Parameters
startStopTextnew value of property startStopText

◆ TextAlignment

int iTextSharp.text.pdf.Barcode.TextAlignment
getset

Gets the text Element. Can be Element.ALIGN_LEFT, Element.ALIGN_CENTER or Element.ALIGN_RIGHT.

Returns
the text alignment

◆ X

float iTextSharp.text.pdf.Barcode.X
getset

Gets the minimum bar width.

Returns
the minimum bar width

The documentation for this class was generated from the following file: