Zend\Barcode\Object\Ean13
Class for generate Ean13 barcode
Synopsis
class Ean13
extends AbstractObject
{
- // members
- protected array $codingMap;
- protected array $parities;
- // Inherited members from AbstractObject
- protected string $barcodeNamespace;
- protected array $instructions;
- protected string $type;
- protected int $height;
- protected int $width;
- protected integer $barHeight;
- protected integer $barThinWidth;
- protected integer $barThickWidth;
- protected integer $factor;
- protected integer $foreColor;
- protected integer $backgroundColor;
- protected bool $withBorder;
- protected bool $withQuietZones;
- protected bool $mandatoryQuietZones;
- protected integer $orientation;
- protected int $offsetTop;
- protected int $offsetLeft;
- protected string $text;
- protected bool $drawText;
- protected bool $stretchText;
- protected int|string $font;
- protected integer $fontSize;
- protected bool $withChecksum;
- protected bool $withChecksumInText;
- protected int $barcodeLength;
- protected bool $addLeadingZeros;
- protected bool $mandatoryChecksum;
- protected integer $substituteChecksumCharacter;
- // methods
- protected void getDefaultOptions()
- protected int calculateBarcodeWidth()
- protected void checkSpecificParams()
- protected array prepareBarcode()
- public int getChecksum()
- protected void drawText()
- protected void drawEan13Text()
- // Inherited methods from AbstractObject
- public void __construct()
- protected void getDefaultOptions()
- public ObjectInterface setOptions()
- public ObjectInterface setBarcodeNamespace()
- public string getBarcodeNamespace()
- public string getType()
- public ObjectInterface setBarHeight()
- public int getBarHeight()
- public ObjectInterface setBarThinWidth()
- public int getBarThinWidth()
- public ObjectInterface setBarThickWidth()
- public int getBarThickWidth()
- public ObjectInterface setFactor()
- public int getFactor()
- public ObjectInterface setForeColor()
- public int getForeColor()
- public ObjectInterface setBackgroundColor()
- public int getBackgroundColor()
- public ObjectInterface setWithBorder()
- public bool getWithBorder()
- public AbstractObject setWithQuietZones()
- public bool getWithQuietZones()
- public ObjectInterface setReverseColor()
- public ObjectInterface setOrientation()
- public float getOrientation()
- public ObjectInterface setText()
- public string getText()
- protected string addLeadingZeros()
- public string getRawText()
- public string getTextToDisplay()
- public ObjectInterface setDrawText()
- public bool getDrawText()
- public ObjectInterface setStretchText()
- public bool getStretchText()
- public ObjectInterface setWithChecksum()
- public bool getWithChecksum()
- public ObjectInterface setWithChecksumInText()
- public bool getWithChecksumInText()
- public ObjectInterface setFont()
- public int|string getFont()
- public ObjectInterface setFontSize()
- public float getFontSize()
- public int getQuietZone()
- protected void addInstruction()
- public array getInstructions()
- protected void addPolygon()
- protected void addText()
- public bool checkParams()
- protected void checkText()
- protected void checkRatio()
- protected void checkFontAndOrientation()
- protected int calculateWidth()
- protected abstract int calculateBarcodeWidth()
- protected int calculateHeight()
- protected int calculateBarcodeHeight()
- public int getHeight()
- public int getWidth()
- public float getOffsetLeft()
- public float getOffsetTop()
- protected array rotate()
- public array draw()
- protected void drawBarcode()
- protected void drawBorder()
- protected void drawText()
- public void validateText()
- protected void validateSpecificText()
- protected abstract array prepareBarcode()
- protected abstract void checkSpecificParams()
- protected void preDrawBarcode()
- protected void postDrawBarcode()
Hierarchy
Extends
Extended by
Members
protected
- $addLeadingZeros
—
Zend\Barcode\Object\bool
Activate automatic addition of leading zeros if barcode length is fixed - $backgroundColor
—
int
Background color of the object - $barHeight
—
int
Height of the bar - $barThickWidth
—
int
Width of a thick bar - $barThinWidth
—
int
Width of a thin bar - $barcodeLength
—
int
Fix barcode length (numeric or string like 'even') - $barcodeNamespace
—
string
Namespace of the barcode for autoloading - $codingMap
—
array
Coding map - 0 = narrow bar - 1 = wide bar - $drawText
—
Zend\Barcode\Object\bool
Display (or not) human readable text - $factor
—
int
Factor to multiply bar and font measure (barHeight, barThinWidth, barThickWidth & fontSize) - $font
—
Zend\Barcode\Object\int|string
Font resource - integer (1 to 5): corresponds to GD included fonts - string: corresponds to path of a TTF font - $fontSize
—
float
Font size - $foreColor
—
int
Font and bars color of the object - $height
—
int
Height of the object - $instructions
—
array
Set of drawing instructions - $mandatoryChecksum
—
Zend\Barcode\Object\bool
Activation of mandatory checksum to deactivate unauthorized modification - $mandatoryQuietZones
—
Zend\Barcode\Object\bool
Force quiet zones even if - $offsetLeft
—
int
Offset from the left the object (calculated from the orientation) - $offsetTop
—
int
Offset from the top the object (calculated from the orientation) - $orientation
—
float
Orientation of the barcode in degrees - $parities
- $stretchText
—
Zend\Barcode\Object\bool
Adjust (or not) position of human readable characters with barcode - $substituteChecksumCharacter
—
mixed
Character used to substitute checksum character for validation - $text
—
string
Text to display - $type
—
string
Barcode type - $width
—
int
Width of the object - $withBorder
—
Zend\Barcode\Object\bool
Activate/deactivate border of the object - $withChecksum
—
Zend\Barcode\Object\bool
Drawing of checksum - $withChecksumInText
—
Zend\Barcode\Object\bool
Drawing of checksum inside text - $withQuietZones
—
Zend\Barcode\Object\bool
Activate/deactivate drawing of quiet zones
Methods
protected
- calculateBarcodeWidth() — Width of the barcode (in pixels)
- checkSpecificParams() — Partial check of interleaved EAN/UPC barcode
- drawEan13Text()
- drawText() — Partial function to draw text
- getDefaultOptions() — Default options for Postnet barcode
- prepareBarcode() — Prepare array to draw barcode
public
- getChecksum() — Get barcode checksum
Inherited from Zend\Barcode\Object\AbstractObject
protected
- addInstruction() — Add an instruction in the array of instructions
- addLeadingZeros() — Automatically add leading zeros if barcode length is fixed
- addPolygon() — Add a polygon drawing instruction in the set of instructions
- addText() — Add a text drawing instruction in the set of instructions
- calculateBarcodeHeight() — Height of the barcode
- calculateBarcodeWidth() — Calculate the width of the barcode
- calculateHeight() — Height of the result object
- calculateWidth() — Width of the result image (before any rotation)
- checkFontAndOrientation() — Drawing with an angle is just allow TTF font
- checkRatio() — Check the ratio between the thick and the thin bar
- checkSpecificParams() — Checking of parameters after all settings
- checkText() — Check if a text is really provided to barcode
- drawBarcode() — Draw the barcode
- drawBorder() — Partial function to draw border
- drawText() — Partial function to draw text
- getDefaultOptions() — Set default options for particular object
- postDrawBarcode() — Allow each child to draw something else (ex: bearer bars in interleaved 2 of 5 code)
- preDrawBarcode() — Allow each child to draw something else
- prepareBarcode() — Each child must prepare the barcode and return a table like array( 0 => array( 0 => int (visible(black) or not(white)) 1 => int (width of the bar) 2 => float (0->1 position from the top of the beginning of the bar in %) 3 => float (0->1 position from the top of the end of the bar in %) ), 1 => ...
- rotate() — Apply rotation on a point in X/Y dimensions
- validateSpecificText() — Standard validation for most of barcode objects
public
- checkParams() — Checking of parameters after all settings
- draw() — Complete drawing of the barcode
- getBackgroundColor() — Retrieve background color of the image
- getBarHeight() — Get height of the barcode bar
- getBarThickWidth() — Get thickness of thick bar
- getBarThinWidth() — Get thickness of thin bar
- getBarcodeNamespace() — Retrieve barcode namespace
- getDrawText() — Retrieve if drawing of text to encode is enabled
- getFactor() — Get factor applying to thinBarWidth - thickBarWidth - barHeight - fontSize
- getFont() — Retrieve the font
- getFontSize() — Retrieve the size of the font in case of TTF
- getForeColor() — Retrieve color of the barcode and text
- getHeight() — Get height of the result object
- getInstructions() — Retrieve the set of drawing instructions
- getOffsetLeft() — Calculate the offset from the left of the object if an orientation is activated
- getOffsetTop() — Calculate the offset from the top of the object if an orientation is activated
- getOrientation() — Retrieve orientation of barcode and text
- getQuietZone() — Quiet zone before first bar and after the last bar
- getRawText() — Retrieve text to encode
- getStretchText() — Retrieve if the adjustment of the position of the characters to the position of the bars is enabled
- getText() — Retrieve text to encode
- getTextToDisplay() — Retrieve text to display
- getType() — Retrieve type of barcode
- getWidth() — Get width of the result object
- getWithBorder() — Retrieve if border are draw or not
- getWithChecksum() — Retrieve if the checksum character is automatically added to the barcode text
- getWithChecksumInText() — Retrieve if the checksum character is automatically added to the barcode text
- getWithQuietZones() — Retrieve if quiet zones are draw or not
- setBackgroundColor() — Set the color of the background
- setBarHeight() — Set height of the barcode bar
- setBarThickWidth() — Set thickness of thick bar
- setBarThinWidth() — Set thickness of thin bar
- setBarcodeNamespace() — Set barcode namespace for autoloading
- setDrawText() — Activate/deactivate drawing of text to encode
- setFactor() — Set factor applying to thinBarWidth - thickBarWidth - barHeight - fontSize
- setFont() — Set the font: - if integer between 1 and 5, use gd built-in fonts - if string, $value is assumed to be the path to a TTF font
- setFontSize() — Set the size of the font in case of TTF
- setForeColor() — Set color of the barcode and text
- setOptions() — Set barcode state from options array
- setOrientation() — Set orientation of barcode and text
- setReverseColor() — Allow fast inversion of font/bars color and background color
- setStretchText() — Activate/deactivate the adjustment of the position of the characters to the position of the bars
- setText() — Set text to encode
- setWithBorder() — Activate/deactivate drawing of the bar
- setWithChecksum() — Activate/deactivate the automatic generation of the checksum character added to the barcode text
- setWithChecksumInText() — Activate/deactivate the automatic generation of the checksum character added to the barcode text
- setWithQuietZones() — Activate/deactivate drawing of the quiet zones
- validateText() — Check for invalid characters