1263. Class

1263.1. Zend\Barcode\Object\AbstractObject

Class for generate Barcode

1263.1.1. Methods

1263.1.1.1. __construct

__construct()

Constructor

Parameters:array|Traversable

1263.1.1.2. getDefaultOptions

getDefaultOptions()

Set default options for particular object

Return type:void

1263.1.1.3. setOptions

setOptions()

Set barcode state from options array

Parameters:array
Return type:ZendBarcodeObjectObjectInterface

1263.1.1.4. setBarcodeNamespace

setBarcodeNamespace()

Set barcode namespace for autoloading

Parameters:string
Return type:ZendBarcodeObjectObjectInterface

1263.1.1.5. getBarcodeNamespace

getBarcodeNamespace()

Retrieve barcode namespace

Return type:string

1263.1.1.6. getType

getType()

Retrieve type of barcode

Return type:string

1263.1.1.7. setBarHeight

setBarHeight()

Set height of the barcode bar

Parameters:integer
Return type:ZendBarcodeObjectObjectInterface @throw ZendBarcodeObjectExceptionExceptionInterface

1263.1.1.8. getBarHeight

getBarHeight()

Get height of the barcode bar

Return type:integer

1263.1.1.9. setBarThinWidth

setBarThinWidth()

Set thickness of thin bar

Parameters:integer
Return type:ZendBarcodeObjectObjectInterface @throw ZendBarcodeObjectExceptionExceptionInterface

1263.1.1.10. getBarThinWidth

getBarThinWidth()

Get thickness of thin bar

Return type:integer

1263.1.1.11. setBarThickWidth

setBarThickWidth()

Set thickness of thick bar

Parameters:integer
Return type:ZendBarcodeObjectObjectInterface @throw ZendBarcodeObjectExceptionExceptionInterface

1263.1.1.12. getBarThickWidth

getBarThickWidth()

Get thickness of thick bar

Return type:integer

1263.1.1.13. setFactor

setFactor()

Set factor applying to thinBarWidth - thickBarWidth - barHeight - fontSize

Parameters:float
Return type:ZendBarcodeObjectObjectInterface @throw ZendBarcodeObjectExceptionExceptionInterface

1263.1.1.14. getFactor

getFactor()

Get factor applying to thinBarWidth - thickBarWidth - barHeight - fontSize

Return type:integer

1263.1.1.15. setForeColor

setForeColor()

Set color of the barcode and text

Parameters:string
Return type:ZendBarcodeObjectObjectInterface @throw ZendBarcodeObjectExceptionExceptionInterface

1263.1.1.16. getForeColor

getForeColor()

Retrieve color of the barcode and text

Return type:integer

1263.1.1.17. setBackgroundColor

setBackgroundColor()

Set the color of the background

Parameters:integer
Return type:ZendBarcodeObjectObjectInterface @throw ZendBarcodeObjectExceptionExceptionInterface

1263.1.1.18. getBackgroundColor

getBackgroundColor()

Retrieve background color of the image

Return type:integer

1263.1.1.19. setWithBorder

setWithBorder()

Activate/deactivate drawing of the bar

Parameters:bool
Return type:ZendBarcodeObjectObjectInterface

1263.1.1.20. getWithBorder

getWithBorder()

Retrieve if border are draw or not

Return type:bool

1263.1.1.21. setWithQuietZones

setWithQuietZones()

Activate/deactivate drawing of the quiet zones

Parameters:bool
Return type:AbstractObject

1263.1.1.22. getWithQuietZones

getWithQuietZones()

Retrieve if quiet zones are draw or not

Return type:bool

1263.1.1.23. setReverseColor

setReverseColor()

Allow fast inversion of font/bars color and background color

Return type:ZendBarcodeObjectObjectInterface

1263.1.1.24. setOrientation

setOrientation()

Set orientation of barcode and text

Parameters:float
Return type:ZendBarcodeObjectObjectInterface @throw ZendBarcodeObjectExceptionExceptionInterface

1263.1.1.25. getOrientation

getOrientation()

Retrieve orientation of barcode and text

Return type:float

1263.1.1.26. setText

setText()

Set text to encode

Parameters:string
Return type:ZendBarcodeObjectObjectInterface

1263.1.1.27. getText

getText()

Retrieve text to encode

Return type:string

1263.1.1.28. addLeadingZeros

addLeadingZeros()

Automatically add leading zeros if barcode length is fixed

Parameters:
  • string
  • bool
Return type:

string

1263.1.1.29. getRawText

getRawText()

Retrieve text to encode

Return type:string

1263.1.1.30. getTextToDisplay

getTextToDisplay()

Retrieve text to display

Return type:string

1263.1.1.31. setDrawText

setDrawText()

Activate/deactivate drawing of text to encode

Parameters:bool
Return type:ZendBarcodeObjectObjectInterface

1263.1.1.32. getDrawText

getDrawText()

Retrieve if drawing of text to encode is enabled

Return type:bool

1263.1.1.33. setStretchText

setStretchText()

Activate/deactivate the adjustment of the position of the characters to the position of the bars

Parameters:bool
Return type:ZendBarcodeObjectObjectInterface @throw ZendBarcodeObjectExceptionExceptionInterface

1263.1.1.34. getStretchText

getStretchText()

Retrieve if the adjustment of the position of the characters to the position of the bars is enabled

Return type:bool

1263.1.1.35. setWithChecksum

setWithChecksum()

Activate/deactivate the automatic generation of the checksum character added to the barcode text

Parameters:bool
Return type:ZendBarcodeObjectObjectInterface

1263.1.1.36. getWithChecksum

getWithChecksum()

Retrieve if the checksum character is automatically added to the barcode text

Return type:bool

1263.1.1.37. setWithChecksumInText

setWithChecksumInText()

Activate/deactivate the automatic generation of the checksum character added to the barcode text

Parameters:bool
Return type:ZendBarcodeObjectObjectInterface @throw ZendBarcodeObjectExceptionExceptionInterface

1263.1.1.38. getWithChecksumInText

getWithChecksumInText()

Retrieve if the checksum character is automatically added to the barcode text

Return type:bool

1263.1.1.39. setFont

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
Parameters:integer|string
Return type:ZendBarcodeObjectObjectInterface @throw ZendBarcodeObjectExceptionExceptionInterface

1263.1.1.40. getFont

getFont()

Retrieve the font

Return type:integer|string

1263.1.1.41. setFontSize

setFontSize()

Set the size of the font in case of TTF

Parameters:float
Return type:ZendBarcodeObjectObjectInterface @throw ZendBarcodeObjectExceptionExceptionInterface

1263.1.1.42. getFontSize

getFontSize()

Retrieve the size of the font in case of TTF

Return type:float

1263.1.1.43. getQuietZone

getQuietZone()

Quiet zone before first bar and after the last bar

Return type:integer

1263.1.1.44. addInstruction

addInstruction()

Add an instruction in the array of instructions

Parameters:array

1263.1.1.45. getInstructions

getInstructions()

Retrieve the set of drawing instructions

Return type:array

1263.1.1.46. addPolygon

addPolygon()

Add a polygon drawing instruction in the set of instructions

Parameters:
  • array
  • integer
  • bool

1263.1.1.47. addText

addText()

Add a text drawing instruction in the set of instructions

Parameters:
  • string
  • float
  • array
  • string
  • integer
  • string
  • float

1263.1.1.48. checkParams

checkParams()

Checking of parameters after all settings

Return type:bool

1263.1.1.49. checkText

checkText()

Check if a text is really provided to barcode

Return type:void @throw ZendBarcodeObjectExceptionExceptionInterface

1263.1.1.50. checkRatio

checkRatio()

Check the ratio between the thick and the thin bar

Parameters:
  • integer
  • integer
Return type:

void @throw ZendBarcodeObjectExceptionExceptionInterface

1263.1.1.51. checkFontAndOrientation

checkFontAndOrientation()

Drawing with an angle is just allow TTF font

Return type:void @throw ZendBarcodeObjectExceptionExceptionInterface

1263.1.1.52. calculateWidth

calculateWidth()

Width of the result image (before any rotation)

Return type:integer

1263.1.1.53. calculateBarcodeWidth

calculateBarcodeWidth()

Calculate the width of the barcode

Return type:integer

1263.1.1.54. calculateHeight

calculateHeight()

Height of the result object

Return type:integer

1263.1.1.55. calculateBarcodeHeight

calculateBarcodeHeight()

Height of the barcode

Return type:integer

1263.1.1.56. getHeight

getHeight()

Get height of the result object

Parameters:bool
Return type:integer

1263.1.1.57. getWidth

getWidth()

Get width of the result object

Parameters:bool
Return type:integer

1263.1.1.58. getOffsetLeft

getOffsetLeft()

Calculate the offset from the left of the object if an orientation is activated

Parameters:bool
Return type:float

1263.1.1.59. getOffsetTop

getOffsetTop()

Calculate the offset from the top of the object if an orientation is activated

Parameters:bool
Return type:float

1263.1.1.60. rotate

rotate()

Apply rotation on a point in X/Y dimensions

Parameters:
  • float – x-position before rotation
  • float – y-position before rotation
Return type:

array Array of two elements corresponding to the new XY point

1263.1.1.61. draw

draw()

Complete drawing of the barcode

Return type:array Table of instructions

1263.1.1.62. drawBarcode

drawBarcode()

Draw the barcode

Return type:void

1263.1.1.63. drawBorder

drawBorder()

Partial function to draw border

Return type:void

1263.1.1.64. drawText

drawText()

Partial function to draw text

Return type:void

1263.1.1.65. validateText

validateText()

Check for invalid characters

Parameters:string – Text to be checked
Return type:void

1263.1.1.66. validateSpecificText

validateSpecificText()

Standard validation for most of barcode objects

Parameters:
  • string
  • array

1263.1.1.67. prepareBarcode

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 => ...

)

Return type:array

1263.1.1.68. checkSpecificParams

checkSpecificParams()

Checking of parameters after all settings

Return type:void

1263.1.1.69. preDrawBarcode

preDrawBarcode()

Allow each child to draw something else

Return type:void

1263.1.1.70. postDrawBarcode

postDrawBarcode()

Allow each child to draw something else (ex: bearer bars in interleaved 2 of 5 code)

Return type:void

Project Versions

Table Of Contents

Previous topic

1262. Class

Next topic

1264. Class

This Page