CRM_Utils_PDF_Label
extends TCPDF
in package
Class CRM_Utils_PDF_Label
Table of Contents
Properties
- $charSize : float
- Character size (in points)
- $countX : float
- Counter for positioning labels
- $countY : float
- Counter for positioning labels
- $defaults : array<string|int, mixed>
- Default label format values
- $fontName : string
- Name of the font
- $fontStyle : string
- 'B' bold, 'I' italic, 'BI' bold+italic
- $format : array<string|int, mixed>
- Current label format values
- $formatName : string
- Name of format
- $height : float
- Height of label
- $lineHeight : float
- Line Height of label - used in event code
- $marginLeft : float
- Left margin of labels
- $marginTop : float
- Top margin of labels
- $metricDoc : string
- Metric used for all PDF doc measurements
- $orientation : string
- Paper orientation
- $paddingLeft : float
- Space between text and left edge of label
- $paddingTop : float
- Space between text and top edge of label
- $paper_dimensions : array<string|int, mixed>
- Paper dimensions array (w, h)
- $paperSize : string
- Paper size name
- $width : float
- Width of label
- $xNumber : float
- Number of labels horizontally
- $xSpace : float
- Horizontal space between 2 labels
- $yNumber : float
- Number of labels vertically
- $ySpace : float
- Vertical space between 2 labels
- $generatorMethod : string|null
- Custom method for generating label, called against $this->generatorObject
- $generatorObject : object
- Custom object used for generating label, used alongside $this->generatorMethod
Methods
- __construct() : mixed
- Constructor.
- AddPdfLabel() : mixed
- Print a label.
- generateLabel() : mixed
- Generate the pdf of one label (can be modified using SetGenerator)
- getFontNames() : array<string|int, mixed>
- Get the available font names.
- getFormatValue() : float|int|mixed
- LabelSetFormat() : mixed
- initialize label format settings.
- SetGenerator() : mixed
Properties
$charSize
Character size (in points)
public
float
$charSize
$countX
Counter for positioning labels
public
float
$countX
= 0
$countY
Counter for positioning labels
public
float
$countY
= 0
$defaults
Default label format values
public
array<string|int, mixed>
$defaults
$fontName
Name of the font
public
string
$fontName
$fontStyle
'B' bold, 'I' italic, 'BI' bold+italic
public
string
$fontStyle
$format
Current label format values
public
array<string|int, mixed>
$format
$formatName
Name of format
public
string
$formatName
$height
Height of label
public
float
$height
$lineHeight
Line Height of label - used in event code
public
float
$lineHeight
= 0
$marginLeft
Left margin of labels
public
float
$marginLeft
$marginTop
Top margin of labels
public
float
$marginTop
$metricDoc
Metric used for all PDF doc measurements
public
string
$metricDoc
$orientation
Paper orientation
public
string
$orientation
$paddingLeft
Space between text and left edge of label
public
float
$paddingLeft
$paddingTop
Space between text and top edge of label
public
float
$paddingTop
$paper_dimensions
Paper dimensions array (w, h)
public
array<string|int, mixed>
$paper_dimensions
$paperSize
Paper size name
public
string
$paperSize
$width
Width of label
public
float
$width
$xNumber
Number of labels horizontally
public
float
$xNumber
$xSpace
Horizontal space between 2 labels
public
float
$xSpace
$yNumber
Number of labels vertically
public
float
$yNumber
$ySpace
Vertical space between 2 labels
public
float
$ySpace
$generatorMethod
Custom method for generating label, called against $this->generatorObject
protected
string|null
$generatorMethod
= \NULL
$generatorObject
Custom object used for generating label, used alongside $this->generatorMethod
protected
object
$generatorObject
Methods
__construct()
Constructor.
public
__construct(mixed $format[, string|Unit $unit = 'mm' ]) : mixed
Parameters
- $format : mixed
-
Either the name of a Label Format in the Option Value table. or an array of Label Format values.
- $unit : string|Unit = 'mm'
-
Unit of measure for the PDF document
AddPdfLabel()
Print a label.
public
AddPdfLabel(mixed $texte) : mixed
Parameters
- $texte : mixed
generateLabel()
Generate the pdf of one label (can be modified using SetGenerator)
public
generateLabel(string $text) : mixed
Parameters
- $text : string
getFontNames()
Get the available font names.
public
getFontNames() : array<string|int, mixed>
Return values
array<string|int, mixed>getFormatValue()
public
getFormatValue(string $name[, bool $convert = FALSE ]) : float|int|mixed
Parameters
- $name : string
- $convert : bool = FALSE
Return values
float|int|mixedLabelSetFormat()
initialize label format settings.
public
LabelSetFormat(mixed &$format, mixed $unit) : mixed
Parameters
- $format : mixed
- $unit : mixed
SetGenerator()
public
SetGenerator(mixed $objectinstance[, string $methodname = 'generateLabel' ]) : mixed
Parameters
- $objectinstance : mixed
- $methodname : string = 'generateLabel'