API Documentation

Barcode/Object/ObjectAbstract.php

Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Barcode
subpackage
Object
version
$Id: ObjectAbstract.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_Barcode_Object_ObjectAbstract

Description

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Zend_Barcode_Object_ObjectAbstract

category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Barcode
Properties
$_barcodeNamespace
$_instructions
$_type
$_height
$_width
$_barHeight
$_barThinWidth
$_barThickWidth
$_factor
$_foreColor
$_backgroundColor
$_withBorder
$_orientation
$_offsetTop
$_offsetLeft
$_text
$_drawText
$_stretchText
$_font
$_fontSize
$_withChecksum
$_withChecksumInText
$_barcodeLength
$_addLeadingZeros
$_mandatoryChecksum
$_substituteChecksumCharacter
$_staticFont
Methods
__construct
_getDefaultOptions
setOptions
setConfig
setBarcodeNamespace
getBarcodeNamespace
getType
setBarHeight
getBarHeight
setBarThinWidth
getBarThinWidth
setBarThickWidth
getBarThickWidth
setFactor
getFactor
setForeColor
getForeColor
setBackgroundColor
getBackgroundColor
setWithBorder
getWithBorder
setReverseColor
setOrientation
getOrientation
setText
getText
_addLeadingZeros
getRawText
getTextToDisplay
setDrawText
getDrawText
setStretchText
getStretchText
setWithChecksum
getWithChecksum
setWithChecksumInText
getWithChecksumInText
setBarcodeFont
setFont
getFont
setFontSize
getFontSize
getQuietZone
_addInstruction
getInstructions
_addPolygon
_addText
checkParams
_checkText
_checkRatio
_checkFontAndOrientation
_calculateWidth
_calculateBarcodeWidth
_calculateHeight
_calculateBarcodeHeight
getHeight
getWidth
getOffsetLeft
getOffsetTop
_rotate
draw
_drawBarcode
_drawBorder
_drawText
validateText
_validateText
_prepareBarcode
_checkParams
_preDrawBarcode
_postDrawBarcode

Description

Class for generate Barcode

Properties

$_addLeadingZeros

$_addLeadingZeros $_addLeadingZeros = 'true'

Activate automatic addition of leading zeros if barcode length is fixed

Details

$_addLeadingZeros
$_addLeadingZeros
boolean
visibility
protected
default
true
final
false
static
false

$_backgroundColor

integer $_backgroundColor = '0xFFFFFF'

Background color of the object

Details

$_backgroundColor
integer
visibility
protected
default
0xFFFFFF
final
false
static
false

$_barHeight

integer $_barHeight = '50'

Height of the bar

Details

$_barHeight
integer
visibility
protected
default
50
final
false
static
false

$_barThickWidth

integer $_barThickWidth = '3'

Width of a thick bar

Details

$_barThickWidth
integer
visibility
protected
default
3
final
false
static
false

$_barThinWidth

integer $_barThinWidth = '1'

Width of a thin bar

Details

$_barThinWidth
integer
visibility
protected
default
1
final
false
static
false

$_barcodeLength

$_barcodeLength $_barcodeLength = 'null'

Fix barcode length (numeric or string like 'even')

Details

$_barcodeLength
$_barcodeLength
integer | string
visibility
protected
default
null
final
false
static
false

$_barcodeNamespace

string $_barcodeNamespace = 'Zend_Barcode_Object'

Namespace of the barcode for autoloading

Details

$_barcodeNamespace
string
visibility
protected
default
Zend_Barcode_Object
final
false
static
false

$_drawText

boolean $_drawText = 'true'

Display (or not) human readable text

Details

$_drawText
boolean
visibility
protected
default
true
final
false
static
false

$_factor

integer $_factor = '1'

Factor to multiply bar and font measure (barHeight, barThinWidth, barThickWidth & fontSize)

Details

$_factor
integer
visibility
protected
default
1
final
false
static
false

$_font

integer|string $_font = 'null'

Font resource - integer (1 to 5): corresponds to GD included fonts - string: corresponds to path of a TTF font

Details

$_font
integer|string
visibility
protected
default
null
final
false
static
false

$_fontSize

float $_fontSize = '10'

Font size

Details

$_fontSize
float
visibility
protected
default
10
final
false
static
false

$_foreColor

integer $_foreColor = '0x000000'

Font and bars color of the object

Details

$_foreColor
integer
visibility
protected
default
0x000000
final
false
static
false

$_height

integer $_height = 'null'

Height of the object

Details

$_height
integer
visibility
protected
default
null
final
false
static
false

$_instructions

array $_instructions = 'array'

Set of drawing instructions

Details

$_instructions
array
visibility
protected
default
array
final
false
static
false

$_mandatoryChecksum

$_mandatoryChecksum $_mandatoryChecksum = 'false'

Activation of mandatory checksum to deactivate unauthorized modification

Details

$_mandatoryChecksum
$_mandatoryChecksum
boolean
visibility
protected
default
false
final
false
static
false

$_offsetLeft

integer $_offsetLeft = 'null'

Offset from the left the object (calculated from the orientation)

Details

$_offsetLeft
integer
visibility
protected
default
null
final
false
static
false

$_offsetTop

integer $_offsetTop = 'null'

Offset from the top the object (calculated from the orientation)

Details

$_offsetTop
integer
visibility
protected
default
null
final
false
static
false

$_orientation

float $_orientation = '0'

Orientation of the barcode in degrees

Details

$_orientation
float
visibility
protected
default
0
final
false
static
false

$_staticFont

string $_staticFont = 'null'

TTF font name: can be set before instanciation of the object

Details

$_staticFont
string
visibility
protected
default
null
final
false
static
true

$_stretchText

boolean $_stretchText = 'false'

Adjust (or not) position of human readable characters with barcode

Details

$_stretchText
boolean
visibility
protected
default
false
final
false
static
false

$_substituteChecksumCharacter

$_substituteChecksumCharacter $_substituteChecksumCharacter = '0'

Character used to substitute checksum character for validation

Details

$_substituteChecksumCharacter
$_substituteChecksumCharacter
mixed
visibility
protected
default
0
final
false
static
false

$_text

string $_text = 'null'

Text to display

Details

$_text
string
visibility
protected
default
null
final
false
static
false

$_type

string $_type = 'null'

Barcode type

Details

$_type
string
visibility
protected
default
null
final
false
static
false

$_width

integer $_width = 'null'

Width of the object

Details

$_width
integer
visibility
protected
default
null
final
false
static
false

$_withBorder

boolean $_withBorder = 'false'

Activate/deactivate border of the object

Details

$_withBorder
boolean
visibility
protected
default
false
final
false
static
false

$_withChecksum

boolean $_withChecksum = 'false'

Drawing of checksum

Details

$_withChecksum
boolean
visibility
protected
default
false
final
false
static
false

$_withChecksumInText

boolean $_withChecksumInText = 'false'

Drawing of checksum inside text

Details

$_withChecksumInText
boolean
visibility
protected
default
false
final
false
static
false

Methods

__construct

__construct( array|Zend_Config $options = null ) : void

Constructor

Arguments
$options
arrayZend_Config
Details
visibility
public
final
false
static
false

_addInstruction

_addInstruction( array $instruction ) :

Add an instruction in the array of instructions

Arguments
$instruction
array
Details
visibility
protected
final
false
static
false

_addLeadingZeros

_addLeadingZeros( string $text, boolean $withoutChecksum = false ) :

Automatically add leading zeros if barcode length is fixed

Arguments
$text
string
$withoutChecksum
boolean
Details
visibility
protected
final
false
static
false

_addPolygon

_addPolygon( array $points, integer $color = null, boolean $filled = true ) :

Add a polygon drawing instruction in the set of instructions

Arguments
$points
array
$color
integer
$filled
boolean
Details
visibility
protected
final
false
static
false

_addText

_addText( string $text, float $size, array $position, string $font, integer $color, string $alignment = center, float $orientation = 0 ) :

Add a text drawing instruction in the set of instructions

Arguments
$text
string
$size
float
$position
array
$font
string
$color
integer
$alignment
string
$orientation
float
Details
visibility
protected
final
false
static
false

_calculateBarcodeHeight

_calculateBarcodeHeight( ) : integer

Height of the barcode

Output
integer
Details
visibility
protected
final
false
static
false

_calculateBarcodeWidth

_calculateBarcodeWidth( ) : integer

Calculate the width of the barcode

Output
integer
Details
visibility
protected
final
false
static
false

_calculateHeight

_calculateHeight( ) : integer

Height of the result object

Output
integer
Details
visibility
protected
final
false
static
false

_calculateWidth

_calculateWidth( ) : integer

Width of the result image (before any rotation)

Output
integer
Details
visibility
protected
final
false
static
false

_checkFontAndOrientation

_checkFontAndOrientation( ) : void

Drawing with an angle is just allow TTF font

Details
visibility
protected
final
false
static
false
throw

_checkParams

_checkParams( ) : void

Checking of parameters after all settings

Details
visibility
protected
final
false
static
false

_checkRatio

_checkRatio( integer $min = 2, integer $max = 3 ) : void

Check the ratio between the thick and the thin bar

Arguments
$min
integer
$max
integer
Details
visibility
protected
final
false
static
false
throw

_checkText

_checkText(  $value = null ) : void

Check if a text is really provided to barcode

Arguments
$value
Details
visibility
protected
final
false
static
false
throw

_drawBarcode

_drawBarcode( ) : void

Draw the barcode

Details
visibility
protected
final
false
static
false

_drawBorder

_drawBorder( ) : void

Partial function to draw border

Details
visibility
protected
final
false
static
false

_drawText

_drawText( ) : void

Partial function to draw text

Details
visibility
protected
final
false
static
false

_getDefaultOptions

_getDefaultOptions( ) : void

Set default options for particular object

Details
visibility
protected
final
false
static
false

_postDrawBarcode

_postDrawBarcode( ) : void

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

Details
visibility
protected
final
false
static
false

_preDrawBarcode

_preDrawBarcode( ) : void

Allow each child to draw something else

Details
visibility
protected
final
false
static
false

_prepareBarcode

_prepareBarcode( ) : array

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

)

Output
array
Details
visibility
protected
final
false
static
false

_rotate

_rotate( float $x1, float $y1 ) : array

Apply rotation on a point in X/Y dimensions

Arguments
$x1
float
x-position before rotation
$y1
float
y-position before rotation
Output
array
Array of two elements corresponding to the new XY point
Details
visibility
protected
final
false
static
false

_validateText

_validateText( string $value, array $options = array ) :

Standard validation for most of barcode objects

Arguments
$value
string
$options
array
Details
visibility
protected
final
false
static
false

checkParams

checkParams( ) : void

Checking of parameters after all settings

Details
visibility
public
final
false
static
false

draw

draw( ) : array

Complete drawing of the barcode

Output
array
Table of instructions
Details
visibility
public
final
false
static
false

getBackgroundColor

getBackgroundColor( ) : integer

Retrieve background color of the image

Output
integer
Details
visibility
public
final
false
static
false

getBarHeight

getBarHeight( ) : integer

Get height of the barcode bar

Output
integer
Details
visibility
public
final
false
static
false

getBarThickWidth

getBarThickWidth( ) : integer

Get thickness of thick bar

Output
integer
Details
visibility
public
final
false
static
false

getBarThinWidth

getBarThinWidth( ) : integer

Get thickness of thin bar

Output
integer
Details
visibility
public
final
false
static
false

getBarcodeNamespace

getBarcodeNamespace( ) : string

Retrieve barcode namespace

Output
string
Details
visibility
public
final
false
static
false

getDrawText

getDrawText( ) : boolean

Retrieve if drawing of text to encode is enabled

Output
boolean
Details
visibility
public
final
false
static
false

getFactor

getFactor( ) : integer

Get factor applying to thinBarWidth - thickBarWidth - barHeight - fontSize

Output
integer
Details
visibility
public
final
false
static
false

getFont

getFont( ) : integer|string

Retrieve the font

Output
integer|string
Details
visibility
public
final
false
static
false

getFontSize

getFontSize( ) : float

Retrieve the size of the font in case of TTF

Output
float
Details
visibility
public
final
false
static
false

getForeColor

getForeColor( ) : unknown

Retrieve color of the barcode and text

Output
unknown
Details
visibility
public
final
false
static
false

getHeight

getHeight(  $recalculate = false ) : integer

Get height of the result object

Arguments
$recalculate
Output
integer
Details
visibility
public
final
false
static
false

getInstructions

getInstructions( ) : array

Retrieve the set of drawing instructions

Output
array
Details
visibility
public
final
false
static
false

getOffsetLeft

getOffsetLeft( boolean $recalculate = false ) : float

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

Arguments
$recalculate
boolean
Output
float
Details
visibility
public
final
false
static
false

getOffsetTop

getOffsetTop( boolean $recalculate = false ) : float

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

Arguments
$recalculate
boolean
Output
float
Details
visibility
public
final
false
static
false

getOrientation

getOrientation( ) : float

Retrieve orientation of barcode and text

Output
float
Details
visibility
public
final
false
static
false

getQuietZone

getQuietZone( ) : integer

Quiet zone before first bar and after the last bar

Output
integer
Details
visibility
public
final
false
static
false

getRawText

getRawText( ) : string

Retrieve text to encode

Output
string
Details
visibility
public
final
false
static
false

getStretchText

getStretchText( ) : boolean

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

Output
boolean
Details
visibility
public
final
false
static
false

getText

getText( ) : string

Retrieve text to encode

Output
string
Details
visibility
public
final
false
static
false

getTextToDisplay

getTextToDisplay( ) : string

Retrieve text to display

Output
string
Details
visibility
public
final
false
static
false

getType

getType( ) : string

Retrieve type of barcode

Output
string
Details
visibility
public
final
false
static
false

getWidth

getWidth(  $recalculate = false ) : integer

Get width of the result object

Arguments
$recalculate
Output
integer
Details
visibility
public
final
false
static
false

getWithBorder

getWithBorder( ) : boolean

Retrieve if border are draw or not

Output
boolean
Details
visibility
public
final
false
static
false

getWithChecksum

getWithChecksum( ) : boolean

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

Output
boolean
Details
visibility
public
final
false
static
false

getWithChecksumInText

getWithChecksumInText( ) : boolean

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

Output
boolean
Details
visibility
public
final
false
static
false

setBackgroundColor

setBackgroundColor( integer $value ) : Zend_Barcode_Object

Set the color of the background

Arguments
$value
integer
Output
Zend_Barcode_Object
Details
visibility
public
final
false
static
false
throw

setBarHeight

setBarHeight( integer $value ) : Zend_Barcode_Object

Set height of the barcode bar

Arguments
$value
integer
Output
Zend_Barcode_Object
Details
visibility
public
final
false
static
false
throw

setBarThickWidth

setBarThickWidth( integer $value ) : Zend_Barcode_Object

Set thickness of thick bar

Arguments
$value
integer
Output
Zend_Barcode_Object
Details
visibility
public
final
false
static
false
throw

setBarThinWidth

setBarThinWidth( integer $value ) : Zend_Barcode_Object

Set thickness of thin bar

Arguments
$value
integer
Output
Zend_Barcode_Object
Details
visibility
public
final
false
static
false
throw

setBarcodeFont

setBarcodeFont( string $font ) : void

Set the font for all instances of barcode

Arguments
$font
string
Details
visibility
public
final
false
static
true

setBarcodeNamespace

setBarcodeNamespace( string $namespace ) : Zend_Barcode_Object

Set barcode namespace for autoloading

Arguments
$namespace
string
Output
Zend_Barcode_Object
Details
visibility
public
final
false
static
false

setConfig

setConfig( Zend_Config $config ) : Zend_Barcode_Object

Set barcode state from config object

Arguments
$config
Zend_Config
Output
Zend_Barcode_Object
Details
visibility
public
final
false
static
false

setDrawText

setDrawText( boolean $value ) : Zend_Barcode_Object

Activate/deactivate drawing of text to encode

Arguments
$value
boolean
Output
Zend_Barcode_Object
Details
visibility
public
final
false
static
false

setFactor

setFactor( integer $value ) : Zend_Barcode_Object

Set factor applying to thinBarWidth - thickBarWidth - barHeight - fontSize

Arguments
$value
integer
Output
Zend_Barcode_Object
Details
visibility
public
final
false
static
false
throw

setFont

setFont( integer|string $value ) : Zend_Barcode_Object

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

Arguments
$value
integerstring
Output
Zend_Barcode_Object
Details
visibility
public
final
false
static
false
throw

setFontSize

setFontSize( float $value ) : Zend_Barcode_Object

Set the size of the font in case of TTF

Arguments
$value
float
Output
Zend_Barcode_Object
Details
visibility
public
final
false
static
false
throw

setForeColor

setForeColor( string $value ) : Zend_Barcode_Object

Set color of the barcode and text

Arguments
$value
string
Output
Zend_Barcode_Object
Details
visibility
public
final
false
static
false
throw

setOptions

setOptions( array $options ) : Zend_Barcode_Object

Set barcode state from options array

Arguments
$options
array
Output
Zend_Barcode_Object
Details
visibility
public
final
false
static
false

setOrientation

setOrientation( float $value ) : Zend_Barcode_Object

Set orientation of barcode and text

Arguments
$value
float
Output
Zend_Barcode_Object
Details
visibility
public
final
false
static
false
throw

setReverseColor

setReverseColor( ) : Zend_Barcode_Object

Allow fast inversion of font/bars color and background color

Output
Zend_Barcode_Object
Details
visibility
public
final
false
static
false

setStretchText

setStretchText( boolean $value ) : Zend_Barcode_Object

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

Arguments
$value
boolean
Output
Zend_Barcode_Object
Details
visibility
public
final
false
static
false
throw

setText

setText( string $value ) : Zend_Barcode_Object

Set text to encode

Arguments
$value
string
Output
Zend_Barcode_Object
Details
visibility
public
final
false
static
false

setWithBorder

setWithBorder( boolean $value ) : Zend_Barcode_Object

Activate/deactivate drawing of the bar

Arguments
$value
boolean
Output
Zend_Barcode_Object
Details
visibility
public
final
false
static
false

setWithChecksum

setWithChecksum( boolean $value ) : Zend_Barcode_Object

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

Arguments
$value
boolean
Output
Zend_Barcode_Object
Details
visibility
public
final
false
static
false

setWithChecksumInText

setWithChecksumInText( boolean $value ) : Zend_Barcode_Object

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

Arguments
$value
boolean
Output
Zend_Barcode_Object
Details
visibility
public
final
false
static
false
throw

validateText

validateText( string $value ) : void

Check for invalid characters

Arguments
$value
string
Text to be ckecked
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.