HiraokaHyperTools.iTextSharp-LGPL  0.2.5
iTextSharp.text.pdf.Barcode128 Class Reference
Inheritance diagram for iTextSharp.text.pdf.Barcode128:
iTextSharp.text.pdf.Barcode

Public Member Functions

 Barcode128 ()
 
override Rectangle PlaceBarcode (PdfContentByte cb, Color barColor, Color textColor)
 
override System.Drawing.Image CreateDrawingImage (System.Drawing.Color foreground, System.Drawing.Color background)
 
- Public Member Functions inherited from iTextSharp.text.pdf.Barcode
PdfTemplate CreateTemplateWithBarcode (PdfContentByte cb, Color barColor, Color textColor)
 
Image CreateImageWithBarcode (PdfContentByte cb, Color barColor, Color textColor)
 

Static Public Member Functions

static String RemoveFNC1 (String code)
 
static String GetHumanReadableUCCEAN (String code)
 
static string GetRawText (string text, bool ucc)
 
static byte[] GetBarsCode128Raw (string text)
 

Static Public Attributes

const char CODE_AB_TO_C = (char)99
 
const char CODE_AC_TO_B = (char)100
 
const char CODE_BC_TO_A = (char)101
 
const char FNC1_INDEX = (char)102
 
const char START_A = (char)103
 
const char START_B = (char)104
 
const char START_C = (char)105
 
const char FNC1 = '\u00ca'
 
const char DEL = '\u00c3'
 
const char FNC3 = '\u00c4'
 
const char FNC2 = '\u00c5'
 
const char SHIFT = '\u00c6'
 
const char CODE_C = '\u00c7'
 
const char CODE_A = '\u00c8'
 
const char FNC4 = '\u00c8'
 
const char STARTA = '\u00cb'
 
const char STARTB = '\u00cc'
 
const char STARTC = '\u00cd'
 
- Static Public Attributes inherited from iTextSharp.text.pdf.Barcode
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
 

Properties

override RectangleBarcodeSize [get]
 
override string? Code [set]
 
- Properties inherited from iTextSharp.text.pdf.Barcode
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]
 

Additional Inherited Members

- Protected Attributes inherited from iTextSharp.text.pdf.Barcode
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
 

Detailed Description

Implements the code 128 and UCC/EAN-128. Other symbologies are allowed in raw mode.

The code types allowed are:

  • CODE128 - plain barcode 128.
  • CODE128_UCC - support for UCC/EAN-128 with a full list of AI.
  • CODE128_RAW - raw mode. The code attribute has the actual codes from 0 to 105 followed by '\uffff' and the human readable text.

The default parameters are:

x = 0.8f;
font = BaseFont.CreateFont("Helvetica", "winansi", false);
size = 8;
baseline = size;
barHeight = size * 3;
textint= Element.ALIGN_CENTER;
codeType = CODE128;
Author
Paulo Soares (psoar.nosp@m.es@c.nosp@m.onsis.nosp@m.te.p.nosp@m.t)

Constructor & Destructor Documentation

◆ Barcode128()

iTextSharp.text.pdf.Barcode128.Barcode128 ( )

Creates new Barcode128

Member Function Documentation

◆ CreateDrawingImage()

override System.Drawing.Image iTextSharp.text.pdf.Barcode128.CreateDrawingImage ( System.Drawing.Color  foreground,
System.Drawing.Color  background 
)
virtual

◆ GetBarsCode128Raw()

static byte [] iTextSharp.text.pdf.Barcode128.GetBarsCode128Raw ( string  text)
static

Generates the bars. The input has the actual barcodes, not the human readable text.

Parameters
textthe barcode
Returns
the bars

◆ GetHumanReadableUCCEAN()

static String iTextSharp.text.pdf.Barcode128.GetHumanReadableUCCEAN ( String  code)
static

Gets the human readable text of a sequence of AI.

Parameters
codethe text
Returns
the human readable text

◆ GetRawText()

static string iTextSharp.text.pdf.Barcode128.GetRawText ( string  text,
bool  ucc 
)
static

Converts the human readable text to the characters needed to create a barcode. Some optimization is done to get the shortest code.

Parameters
textthe text to convert
ucctrue if it is an UCC/EAN-128. In this case the character FNC1 is added
Returns
the code ready to be fed to GetBarsCode128Raw()

◆ PlaceBarcode()

override Rectangle iTextSharp.text.pdf.Barcode128.PlaceBarcode ( PdfContentByte  cb,
Color  barColor,
Color  textColor 
)
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

Implements iTextSharp.text.pdf.Barcode.

◆ RemoveFNC1()

static String iTextSharp.text.pdf.Barcode128.RemoveFNC1 ( String  code)
static

Removes the FNC1 codes in the text.

Parameters
codethe text to clean
Returns
the cleaned text

Member Data Documentation

◆ CODE_A

const char iTextSharp.text.pdf.Barcode128.CODE_A = '\u00c8'
static

◆ CODE_AB_TO_C

const char iTextSharp.text.pdf.Barcode128.CODE_AB_TO_C = (char)99
static

The charset code change.

◆ CODE_AC_TO_B

const char iTextSharp.text.pdf.Barcode128.CODE_AC_TO_B = (char)100
static

The charset code change.

◆ CODE_BC_TO_A

const char iTextSharp.text.pdf.Barcode128.CODE_BC_TO_A = (char)101
static

The charset code change.

◆ CODE_C

const char iTextSharp.text.pdf.Barcode128.CODE_C = '\u00c7'
static

◆ DEL

const char iTextSharp.text.pdf.Barcode128.DEL = '\u00c3'
static

◆ FNC1

const char iTextSharp.text.pdf.Barcode128.FNC1 = '\u00ca'
static

◆ FNC1_INDEX

const char iTextSharp.text.pdf.Barcode128.FNC1_INDEX = (char)102
static

The code for UCC/EAN-128.

◆ FNC2

const char iTextSharp.text.pdf.Barcode128.FNC2 = '\u00c5'
static

◆ FNC3

const char iTextSharp.text.pdf.Barcode128.FNC3 = '\u00c4'
static

◆ FNC4

const char iTextSharp.text.pdf.Barcode128.FNC4 = '\u00c8'
static

◆ SHIFT

const char iTextSharp.text.pdf.Barcode128.SHIFT = '\u00c6'
static

◆ START_A

const char iTextSharp.text.pdf.Barcode128.START_A = (char)103
static

The start code.

◆ START_B

const char iTextSharp.text.pdf.Barcode128.START_B = (char)104
static

The start code.

◆ START_C

const char iTextSharp.text.pdf.Barcode128.START_C = (char)105
static

The start code.

◆ STARTA

const char iTextSharp.text.pdf.Barcode128.STARTA = '\u00cb'
static

◆ STARTB

const char iTextSharp.text.pdf.Barcode128.STARTB = '\u00cc'
static

◆ STARTC

const char iTextSharp.text.pdf.Barcode128.STARTC = '\u00cd'
static

Property Documentation

◆ BarcodeSize

override Rectangle? iTextSharp.text.pdf.Barcode128.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.

◆ Code

override string? iTextSharp.text.pdf.Barcode128.Code
set

Sets the code to generate. If it's an UCC code and starts with '(' it will be split by the AI. This code in UCC mode is valid:

(01)00000090311314(10)ABC123(15)060916

Parameters
codethe code to generate

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