public
boolean
|
#
empty_string( $str )
Determine whether a string is empty.
Determine whether a string is empty.
Parameters
- $str
- string to be checked
Returns
boolean true if string is empty
|
public
PDF
|
#
__construct( string $orientation = 'P', string $unit = 'mm', mixed $format = 'A4', boolean $unicode = true, string $encoding = 'UTF-8', boolean $diskcache = false, $pdfa = false )
init pdf object
Parameters
- $orientation
page orientation. Possible values are (case insensitive):
- P or Portrait (default)
- L or Landscape
- $unit
User measure unit. Possible values are:
- pt: point
- mm: millimeter (default)
- cm: centimeter
- in: inch
A point equals 1/72 of inch, that is to say about 0.35 mm (an inch being 2.54 cm). This is a very common unit in typography; font sizes are expressed in that unit.
- $format
The format used for pages. It can be either one of the following values (case insensitive) or a custom format in the form of a two-element array containing the width and the height (expressed in the unit given by unit).
- 4A0
- 2A0
- A0
- A1
- A2
- A3
- A4 (default)
- A5
- A6
- A7
- A8
- A9
- A10
- B0
- B1
- B2
- B3
- B4
- B5
- B6
- B7
- B8
- B9
- B10
- C0
- C1
- C2
- C3
- C4
- C5
- C6
- C7
- C8
- C9
- C10
- RA0
- RA1
- RA2
- RA3
- RA4
- SRA0
- SRA1
- SRA2
- SRA3
- SRA4
- LETTER
- LEGAL
- EXECUTIVE
- FOLIO
- $unicode
- TRUE means that the input text is unicode (default = true)
- $encoding
- charset encoding; default is UTF-8
- $diskcache
- if TRUE reduce the RAM memory usage by caching temporary data on filesystem (slower).
- $pdfa
- If TRUE set the document to PDF/A mode.
Returns
|
private
|
|
private
|
|
public
|
#
TableRow( array $columns, array $aligns, array $widths, integer $border = 0, integer $rowspacing = 5, integer $cellpaddingY = 0 )
create a row of a table
sample:$pdf->TableRow(array($desc, number_format($price, 2, ',', '')) ,array("R","R"), array(165, 25), 1);
create a row of a table
sample:$pdf->TableRow(array($desc, number_format($price, 2, ',', '')) ,array("R","R"), array(165, 25), 1);
Parameters
- $columns
- $aligns
- $widths
- $border
- $rowspacing
- $cellpaddingY
|
public
|
#
SetFont( string $family, string $style = '', float $size = 0, string $fontfile = '', $subset = false, $out = true )
Sets the font used to print character strings. For full unicode support, see also the documentation of the constructor
Sets the font used to print character strings. For full unicode support, see also the documentation of the constructor
Parameters
- $family
Family font. It can be either a name defined by AddFont() or one of the standard Type1 families (case insensitive):
- times (Times-Roman)
- timesb (Times-Bold)
- timesi (Times-Italic)
- timesbi (Times-BoldItalic)
- helvetica (Helvetica)
- helveticab (Helvetica-Bold)
- helveticai (Helvetica-Oblique)
- helveticabi (Helvetica-BoldOblique)
- courier (Courier)
- courierb (Courier-Bold)
- courieri (Courier-Oblique)
- courierbi (Courier-BoldOblique)
- symbol (Symbol)
- zapfdingbats (ZapfDingbats)
It is also possible to pass an empty string. In that case, the current family is retained.
- $style
Font style. Possible values are (case insensitive):
- empty string: regular
- B: bold
- I: italic
- U: underline
- D: line trough
or any combination. The default value is regular. Bold and italic styles do not apply to Symbol and ZapfDingbats basic fonts or other fonts when not defined.
- $size
- Font size in points. The default value is the current size. If no size has been specified since the beginning of the document, the value taken is 12
- $fontfile
- The font definition file. By default, the name is built from the family and style, in lower case with no spaces.
- $subset
- if true embedd only a subset of the font (stores only the information related to the used characters); if false embedd full font; if 'default' uses the default value set using setFontSubsetting(). This option is valid only for TrueTypeUnicode fonts. If you want to enable users to change the document, set this parameter to false. If you subset the font, the person who receives your PDF would need to have your same font in order to make changes to your PDF. The file size of the PDF would also be smaller because you are embedding only part of a font.
- $out
- if true output the font size command, otherwise only set the font properties.
|
public
array
|
#
AddFont( string $family, string $style = '', string $fontfile = '', $subset = false )
Imports a TrueType, Type1, core, or CID0 font and makes it available. For full unicode support, see also the documentation of the constructor
Imports a TrueType, Type1, core, or CID0 font and makes it available. For full unicode support, see also the documentation of the constructor
Parameters
- $family
- Font family. The name can be chosen arbitrarily. If it is a standard family name, it will override the corresponding font.
- $style
Font style. Possible values are (case insensitive):
- empty string: regular (default)
- B: bold
- I: italic
- BI or IB: bold italic
- $fontfile
- The font definition file. By default, the name is built from the family and style, in lower case with no spaces.
- $subset
- if true embedd only a subset of the font (stores only the information related to the used characters); if false embedd full font; if 'default' uses the default value set using setFontSubsetting(). This option is valid only for TrueTypeUnicode fonts. If you want to enable users to change the document, set this parameter to false. If you subset the font, the person who receives your PDF would need to have your same font in order to make changes to your PDF. The file size of the PDF would also be smaller because you are embedding only part of a font.
Returns
array containing the font data, or false in case of error.
|
public
|
#
Error( string $msg )
This method is automatically called in case of fatal error and throw an exception
This method is automatically called in case of fatal error and throw an exception
Parameters
|