iText 8.0.2 API
All Classes Namespaces Functions Variables Enumerations Enumerator Properties
iText.Barcodes.Barcode1D Class Referenceabstract
Inheritance diagram for iText.Barcodes.Barcode1D:
iText.Barcodes.Barcode128 iText.Barcodes.Barcode39 iText.Barcodes.BarcodeCodabar iText.Barcodes.BarcodeEAN iText.Barcodes.BarcodeEANSUPP iText.Barcodes.BarcodeInter25 iText.Barcodes.BarcodeMSI iText.Barcodes.BarcodePostnet

Public Member Functions

virtual float  GetX ()
  Gets the minimum bar width. More...
 
virtual void  SetX (float x)
  Sets the minimum bar width. More...
 
virtual float  GetN ()
  Gets the bar multiplier for wide bars. More...
 
virtual void  SetN (float n)
  Sets the bar multiplier for wide bars. More...
 
virtual PdfFont  GetFont ()
  Gets the text font. More...
 
virtual void  SetFont (PdfFont font)
  Sets the text font. More...
 
virtual float  GetSize ()
 
virtual void  SetSize (float size)
  Sets the size of the text. More...
 
virtual float  GetBaseline ()
  Gets the text baseline. More...
 
virtual void  SetBaseline (float baseline)
  Sets the text baseline. More...
 
virtual float  GetBarHeight ()
  Gets the height of the bars. More...
 
virtual void  SetBarHeight (float barHeight)
  Sets the height of the bars. More...
 
virtual int  GetTextAlignment ()
  Gets the text alignment. More...
 
virtual void  SetTextAlignment (int textAlignment)
  Sets the text alignment. More...
 
virtual bool  IsGenerateChecksum ()
  Gets the optional checksum generation. More...
 
virtual void  SetGenerateChecksum (bool generateChecksum)
  Setter for property generateChecksum. More...
 
virtual bool  IsChecksumText ()
  Gets the property to show the generated checksum in the the text. More...
 
virtual void  SetChecksumText (bool checksumText)
  Sets the property to show the generated checksum in the the text. More...
 
virtual bool  IsStartStopText ()
  Sets the property to show the start and stop character '*' in the text for the barcode 39. More...
 
virtual void  SetStartStopText (bool startStopText)
  Gets the property to show the start and stop character '*' in the text for the barcode 39. More...
 
virtual bool  IsExtended ()
  Gets the property to generate extended barcode 39. More...
 
virtual void  SetExtended (bool extended)
  Sets the property to generate extended barcode 39. More...
 
virtual String  GetCode ()
  Gets the code to generate. More...
 
virtual void  SetCode (String code)
  Sets the code to generate. More...
 
virtual bool  IsGuardBars ()
  Gets the property to show the guard bars for barcode EAN. More...
 
virtual void  SetGuardBars (bool guardBars)
  Sets the property to show the guard bars for barcode EAN. More...
 
virtual int  GetCodeType ()
  Gets the code type. More...
 
virtual void  SetCodeType (int codeType)
  Sets the code type. More...
 
abstract Rectangle  GetBarcodeSize ()
  Gets the maximum area that the barcode and the text, if any, will occupy. More...
 
abstract Rectangle  PlaceBarcode (PdfCanvas canvas, Color barColor, Color textColor)
  Places the barcode in a PdfCanvas. More...
 
virtual float  GetInkSpreading ()
  Gets the amount of ink spreading. More...
 
virtual void  SetInkSpreading (float inkSpreading)
  Sets the amount of ink spreading. More...
 
virtual String  GetAltText ()
  Gets the alternate text. More...
 
virtual void  SetAltText (String altText)
  Sets the alternate text. More...
 
virtual PdfFormXObject  CreateFormXObject (PdfDocument document)
  Creates a PdfFormXObject with the barcode. More...
 
virtual PdfFormXObject  CreateFormXObject (Color barColor, Color textColor, PdfDocument document)
  Creates a PdfFormXObject with the barcode. More...
 
virtual void  FitWidth (float width)
  Make the barcode occupy the specified width. More...
 

Static Public Attributes

const int  ALIGN_LEFT = 1
 
const int  ALIGN_RIGHT = 2
 
const int  ALIGN_CENTER = 3
 

Member Function Documentation

◆ CreateFormXObject() [1/2]

virtual PdfFormXObject iText.Barcodes.Barcode1D.CreateFormXObject ( Color  barColor,
Color  textColor,
PdfDocument  document 
)
inlinevirtual

Creates a PdfFormXObject with the barcode.

Parameters
barColor The color of the bars. It can be null
textColor The color of the text. It can be null
document The document
Returns
the XObject
See also
PlaceBarcode(iText.Kernel.Pdf.Canvas.PdfCanvas, iText.Kernel.Colors.Color, iText.Kernel.Colors.Color)

◆ CreateFormXObject() [2/2]

virtual PdfFormXObject iText.Barcodes.Barcode1D.CreateFormXObject ( PdfDocument  document )
inlinevirtual

Creates a PdfFormXObject with the barcode.

Creates a PdfFormXObject with the barcode. Default bar color and text color will be used.

Parameters
document The document
Returns
The XObject
See also
CreateFormXObject(iText.Kernel.Colors.Color, iText.Kernel.Colors.Color, iText.Kernel.Pdf.PdfDocument)

◆ FitWidth()

virtual void iText.Barcodes.Barcode1D.FitWidth ( float  width )
inlinevirtual

Make the barcode occupy the specified width.

Make the barcode occupy the specified width. Usually this is achieved by adjusting bar widths.

Parameters
width The width

Reimplemented in iText.Barcodes.BarcodePostnet.

◆ GetAltText()

virtual String iText.Barcodes.Barcode1D.GetAltText ( )
inlinevirtual

Gets the alternate text.

Returns
the alternate text

◆ GetBarcodeSize()

abstract Rectangle iText.Barcodes.Barcode1D.GetBarcodeSize ( )
pure virtual

Gets the maximum area that the barcode and the text, if any, will occupy.

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.

Implemented in iText.Barcodes.BarcodeEAN, iText.Barcodes.Barcode128, iText.Barcodes.Barcode39, iText.Barcodes.BarcodeCodabar, iText.Barcodes.BarcodeInter25, iText.Barcodes.BarcodeMSI, iText.Barcodes.BarcodePostnet, and iText.Barcodes.BarcodeEANSUPP.

◆ GetBarHeight()

virtual float iText.Barcodes.Barcode1D.GetBarHeight ( )
inlinevirtual

Gets the height of the bars.

Returns
the height of the bars

◆ GetBaseline()

virtual float iText.Barcodes.Barcode1D.GetBaseline ( )
inlinevirtual

Gets the text baseline.

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.

◆ GetCode()

virtual String iText.Barcodes.Barcode1D.GetCode ( )
inlinevirtual

Gets the code to generate.

Returns
the code to generate

◆ GetCodeType()

virtual int iText.Barcodes.Barcode1D.GetCodeType ( )
inlinevirtual

Gets the code type.

Returns
the code type

◆ GetFont()

virtual PdfFont iText.Barcodes.Barcode1D.GetFont ( )
inlinevirtual

Gets the text font.

Gets the text font. null if no text.

Returns
the text font. null if no text

◆ GetInkSpreading()

virtual float iText.Barcodes.Barcode1D.GetInkSpreading ( )
inlinevirtual

Gets the amount of ink spreading.

Returns
the ink spreading

◆ GetN()

virtual float iText.Barcodes.Barcode1D.GetN ( )
inlinevirtual

Gets the bar multiplier for wide bars.

Returns
the bar multiplier for wide bars

◆ GetTextAlignment()

virtual int iText.Barcodes.Barcode1D.GetTextAlignment ( )
inlinevirtual

Gets the text alignment.

Returns
the text alignment

◆ GetX()

virtual float iText.Barcodes.Barcode1D.GetX ( )
inlinevirtual

Gets the minimum bar width.

Returns
the minimum bar width

◆ IsChecksumText()

virtual bool iText.Barcodes.Barcode1D.IsChecksumText ( )
inlinevirtual

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

Returns
value of property checksumText

◆ IsExtended()

virtual bool iText.Barcodes.Barcode1D.IsExtended ( )
inlinevirtual

Gets the property to generate extended barcode 39.

Returns
value of property extended.

◆ IsGenerateChecksum()

virtual bool iText.Barcodes.Barcode1D.IsGenerateChecksum ( )
inlinevirtual

Gets the optional checksum generation.

Returns
the optional checksum generation

◆ IsGuardBars()

virtual bool iText.Barcodes.Barcode1D.IsGuardBars ( )
inlinevirtual

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

Returns
value of property guardBars

◆ IsStartStopText()

virtual bool iText.Barcodes.Barcode1D.IsStartStopText ( )
inlinevirtual

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

Returns
value of property startStopText

◆ PlaceBarcode()

abstract Rectangle iText.Barcodes.Barcode1D.PlaceBarcode ( PdfCanvas  canvas,
Color  barColor,
Color  textColor 
)
pure virtual

Places the barcode in a PdfCanvas.

Places the barcode in a PdfCanvas. The barcode is always placed at coordinates (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
canvas the PdfCanvas where the barcode will be placed
barColor the color of the bars. It can be null
textColor the color of the text. It can be null
Returns
the dimensions the barcode occupies

Implemented in iText.Barcodes.BarcodeEAN, iText.Barcodes.Barcode128, iText.Barcodes.Barcode39, iText.Barcodes.BarcodeCodabar, iText.Barcodes.BarcodeInter25, iText.Barcodes.BarcodeMSI, iText.Barcodes.BarcodeEANSUPP, and iText.Barcodes.BarcodePostnet.

◆ SetAltText()

virtual void iText.Barcodes.Barcode1D.SetAltText ( String  altText )
inlinevirtual

Sets the alternate text.

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

Parameters
altText the alternate text

◆ SetBarHeight()

virtual void iText.Barcodes.Barcode1D.SetBarHeight ( float  barHeight )
inlinevirtual

Sets the height of the bars.

Parameters
barHeight the height of the bars

◆ SetBaseline()

virtual void iText.Barcodes.Barcode1D.SetBaseline ( float  baseline )
inlinevirtual

Sets the text baseline.

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

Parameters
baseline the baseline.

◆ SetChecksumText()

virtual void iText.Barcodes.Barcode1D.SetChecksumText ( bool  checksumText )
inlinevirtual

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

Parameters
checksumText new value of property checksumText

◆ SetCode()

virtual void iText.Barcodes.Barcode1D.SetCode ( String  code )
inlinevirtual

Sets the code to generate.

Parameters
code the code to generate

Reimplemented in iText.Barcodes.Barcode128.

◆ SetCodeType()

virtual void iText.Barcodes.Barcode1D.SetCodeType ( int  codeType )
inlinevirtual

Sets the code type.

Parameters
codeType the code type

◆ SetExtended()

virtual void iText.Barcodes.Barcode1D.SetExtended ( bool  extended )
inlinevirtual

Sets the property to generate extended barcode 39.

Parameters
extended new value of property extended

◆ SetFont()

virtual void iText.Barcodes.Barcode1D.SetFont ( PdfFont  font )
inlinevirtual

Sets the text font.

Parameters
font the text font. Set to null to suppress any text

◆ SetGenerateChecksum()

virtual void iText.Barcodes.Barcode1D.SetGenerateChecksum ( bool  generateChecksum )
inlinevirtual

Setter for property generateChecksum.

Parameters
generateChecksum New value of property generateChecksum.

◆ SetGuardBars()

virtual void iText.Barcodes.Barcode1D.SetGuardBars ( bool  guardBars )
inlinevirtual

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

Parameters
guardBars new value of property guardBars

◆ SetInkSpreading()

virtual void iText.Barcodes.Barcode1D.SetInkSpreading ( float  inkSpreading )
inlinevirtual

Sets the amount of ink spreading.

Sets the amount of ink spreading. This value will be subtracted to the width of each bar. The actual value will depend on the ink and the printing medium.

Parameters
inkSpreading the ink spreading

◆ SetN()

virtual void iText.Barcodes.Barcode1D.SetN ( float  n )
inlinevirtual

Sets the bar multiplier for wide bars.

Parameters
n the bar multiplier for wide bars

◆ SetSize()

virtual void iText.Barcodes.Barcode1D.SetSize ( float  size )
inlinevirtual

Sets the size of the text.

Parameters
size the size of the text

◆ SetStartStopText()

virtual void iText.Barcodes.Barcode1D.SetStartStopText ( bool  startStopText )
inlinevirtual

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

Parameters
startStopText new value of property startStopText

◆ SetTextAlignment()

virtual void iText.Barcodes.Barcode1D.SetTextAlignment ( int  textAlignment )
inlinevirtual

Sets the text alignment.

Parameters
textAlignment the text alignment

◆ SetX()

virtual void iText.Barcodes.Barcode1D.SetX ( float  x )
inlinevirtual

Sets the minimum bar width.

Parameters
x the minimum bar width