class-TCPDF

It appears that you are using AdBlocking software. The cost of running this website is covered by advertisements. If you like it please feel free to a small amount of money to secure the future of this website.

It appears that you are using AdBlocking software. The cost of running this website is covered by advertisements. If you like it please feel free to a small amount of money to secure the future of this website.

Direct known subclasses

TCPDF
PHP class for generating PDF documents without requiring external extensions.
TCPDF project (http://www.tcpdf.org) has been originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.

This is the class constructor.
It allows to set up the page format, the orientation and the measure unit used in all the methods (except for the font sizes).

This is the class constructor.
It allows to set up the page format, the orientation and the measure unit used in all the methods (except for the font sizes).

IMPORTANT: Please note that this method sets the mb_internal_encoding to ASCII, so if you are using the mbstring module functions with TCPDF you need to correctly set/unset the mb_internal_encoding when needed.

Parameters

$orientation

page orientation. Possible values are (case insensitive):

P or Portrait (default)

L or Landscape

'' (empty string) for automatic orientation

$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 string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat().

$unicode

TRUE means that the input text is unicode (default = true)

$encoding

Charset encoding (used only when converting back html entities); default is UTF-8.

Since

Public

Parameters

$format

The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() documentation or an array of two numbers (width, height) or an array containing the following measures and options:

['format'] = page format name (one of the above);

['Rotate'] : The number of degrees by which the page shall be rotated clockwise when displayed or printed. The value shall be a multiple of 90.

['PZ'] : The page's preferred zoom (magnification) factor.

['MediaBox'] : the boundaries of the physical medium on which the page shall be displayed or printed:

['MediaBox']['llx'] : lower-left x coordinate

['MediaBox']['lly'] : lower-left y coordinate

['MediaBox']['urx'] : upper-right x coordinate

['MediaBox']['ury'] : upper-right y coordinate

['CropBox'] : the visible region of default user space:

['CropBox']['llx'] : lower-left x coordinate

['CropBox']['lly'] : lower-left y coordinate

['CropBox']['urx'] : upper-right x coordinate

['CropBox']['ury'] : upper-right y coordinate

['BleedBox'] : the region to which the contents of the page shall be clipped when output in a production environment:

['BleedBox']['llx'] : lower-left x coordinate

['BleedBox']['lly'] : lower-left y coordinate

['BleedBox']['urx'] : upper-right x coordinate

['BleedBox']['ury'] : upper-right y coordinate

['TrimBox'] : the intended dimensions of the finished page after trimming:

['TrimBox']['llx'] : lower-left x coordinate

['TrimBox']['lly'] : lower-left y coordinate

['TrimBox']['urx'] : upper-right x coordinate

['TrimBox']['ury'] : upper-right y coordinate

['ArtBox'] : the extent of the page's meaningful content:

['ArtBox']['llx'] : lower-left x coordinate

['ArtBox']['lly'] : lower-left y coordinate

['ArtBox']['urx'] : upper-right x coordinate

['ArtBox']['ury'] : upper-right y coordinate

['BoxColorInfo'] :specify the colours and other visual characteristics that should be used in displaying guidelines on the screen for each of the possible page boundaries other than the MediaBox:

['BoxColorInfo'][BOXTYPE]['C'] : an array of three numbers in the range 0-255, representing the components in the DeviceRGB colour space.

['BoxColorInfo'][BOXTYPE]['D'] : dash array defining a pattern of dashes and gaps to be used in drawing dashed guidelines

['trans'] : the style and duration of the visual transition to use when moving from another page to the given page during a presentation

['trans']['Dur'] : The page's display duration (also called its advance timing): the maximum length of time, in seconds, that the page shall be displayed during presentations before the viewer application shall automatically advance to the next page.

['trans']['M'] : (Split, Box and Fly transition styles only) The direction of motion for the specified transition effect: I = Inward from the edges of the page, O = Outward from the center of the pageDefault value: I.

['trans']['Di'] : (Wipe, Glitter, Fly, Cover, Uncover and Push transition styles only) The direction in which the specified transition effect shall moves, expressed in degrees counterclockwise starting from a left-to-right direction. If the value is a number, it shall be one of: 0 = Left to right, 90 = Bottom to top (Wipe only), 180 = Right to left (Wipe only), 270 = Top to bottom, 315 = Top-left to bottom-right (Glitter only). If the value is a name, it shall be None, which is relevant only for the Fly transition when the value of SS is not 1.0. Default value: 0.

['trans']['SS'] : (Fly transition style only) The starting or ending scale at which the changes shall be drawn. If M specifies an inward transition, the scale of the changes drawn shall progress from SS to 1.0 over the course of the transition. If M specifies an outward transition, the scale of the changes drawn shall progress from 1.0 to SS over the course of the transition. Default: 1.0.

['trans']['B'] : (Fly transition style only) If true, the area that shall be flown in is rectangular and opaque. Default: false.

Since

Public

Set regular expression to detect withespaces or word separators.
The pattern delimiter must be the forward-slash character "/".
Some example patterns are:

Non-Unicode or missing PCRE unicode support: "/[^\S\xa0]/"
Unicode and PCRE unicode support: "/(?!\xa0)[\s\p{Z}]/u"
Unicode and PCRE unicode support in Chinese mode: "/(?!\xa0)[\s\p{Z}\p{Lo}]/u"if PCRE unicode support is turned ON ("\P" is the negate class of "\p"):
\s : any whitespace character
\p{Z} : any separator
\p{Lo} : Unicode letter or ideograph that does not have lowercase and uppercase variants. Is used to chunk chinese words.
\xa0 : Unicode Character 'NO-BREAK SPACE' (U+00A0)

Set regular expression to detect withespaces or word separators.
The pattern delimiter must be the forward-slash character "/".
Some example patterns are:

Non-Unicode or missing PCRE unicode support: "/[^\S\xa0]/"
Unicode and PCRE unicode support: "/(?!\xa0)[\s\p{Z}]/u"
Unicode and PCRE unicode support in Chinese mode: "/(?!\xa0)[\s\p{Z}\p{Lo}]/u"if PCRE unicode support is turned ON ("\P" is the negate class of "\p"):
\s : any whitespace character
\p{Z} : any separator
\p{Lo} : Unicode letter or ideograph that does not have lowercase and uppercase variants. Is used to chunk chinese words.
\xa0 : Unicode Character 'NO-BREAK SPACE' (U+00A0)

$this->pagedim[$this->page]['trans'] : the style and duration of the visual transition to use when moving from another page to the given page during a presentation

$this->pagedim[$this->page]['trans']['Dur'] = The page's display duration (also called its advance timing): the maximum length of time, in seconds, that the page shall be displayed during presentations before the viewer application shall automatically advance to the next page.

$this->pagedim[$this->page]['trans']['M'] = (Split, Box and Fly transition styles only) The direction of motion for the specified transition effect: I = Inward from the edges of the page, O = Outward from the center of the pageDefault value: I.

$this->pagedim[$this->page]['trans']['Di'] = (Wipe, Glitter, Fly, Cover, Uncover and Push transition styles only) The direction in which the specified transition effect shall moves, expressed in degrees counterclockwise starting from a left-to-right direction. If the value is a number, it shall be one of: 0 = Left to right, 90 = Bottom to top (Wipe only), 180 = Right to left (Wipe only), 270 = Top to bottom, 315 = Top-left to bottom-right (Glitter only). If the value is a name, it shall be None, which is relevant only for the Fly transition when the value of SS is not 1.0. Default value: 0.

$this->pagedim[$this->page]['trans']['SS'] = (Fly transition style only) The starting or ending scale at which the changes shall be drawn. If M specifies an inward transition, the scale of the changes drawn shall progress from SS to 1.0 over the course of the transition. If M specifies an outward transition, the scale of the changes drawn shall progress from 1.0 to SS over the course of the transition. Default: 1.0.

$this->pagedim[$this->page]['trans']['B'] = (Fly transition style only) If true, the area that shall be flown in is rectangular and opaque. Default: false.

$this->pagedim[$this->page]['MediaBox'] : the boundaries of the physical medium on which the page shall be displayed or printed

$this->pagedim[$this->page]['trans'] : the style and duration of the visual transition to use when moving from another page to the given page during a presentation

$this->pagedim[$this->page]['trans']['Dur'] = The page's display duration (also called its advance timing): the maximum length of time, in seconds, that the page shall be displayed during presentations before the viewer application shall automatically advance to the next page.

$this->pagedim[$this->page]['trans']['M'] = (Split, Box and Fly transition styles only) The direction of motion for the specified transition effect: I = Inward from the edges of the page, O = Outward from the center of the pageDefault value: I.

$this->pagedim[$this->page]['trans']['Di'] = (Wipe, Glitter, Fly, Cover, Uncover and Push transition styles only) The direction in which the specified transition effect shall moves, expressed in degrees counterclockwise starting from a left-to-right direction. If the value is a number, it shall be one of: 0 = Left to right, 90 = Bottom to top (Wipe only), 180 = Right to left (Wipe only), 270 = Top to bottom, 315 = Top-left to bottom-right (Glitter only). If the value is a name, it shall be None, which is relevant only for the Fly transition when the value of SS is not 1.0. Default value: 0.

$this->pagedim[$this->page]['trans']['SS'] = (Fly transition style only) The starting or ending scale at which the changes shall be drawn. If M specifies an inward transition, the scale of the changes drawn shall progress from SS to 1.0 over the course of the transition. If M specifies an outward transition, the scale of the changes drawn shall progress from 1.0 to SS over the course of the transition. Default: 1.0.

$this->pagedim[$this->page]['trans']['B'] = (Fly transition style only) If true, the area that shall be flown in is rectangular and opaque. Default: false.

$this->pagedim[$this->page]['MediaBox'] : the boundaries of the physical medium on which the page shall be displayed or printed

Returns

Since

Public

Enables or disables the automatic page breaking mode. When enabling, the second parameter is the distance from the bottom of the page that defines the triggering limit. By default, the mode is on and the margin is 2 cm.

Enables or disables the automatic page breaking mode. When enabling, the second parameter is the distance from the bottom of the page that defines the triggering limit. By default, the mode is on and the margin is 2 cm.

Since

Public

Activates or deactivates page compression. When activated, the internal representation of each page is compressed, which leads to a compression ratio of about 2 for the resulting document. Compression is on by default.
Note: the Zlib extension is required for this feature. If not present, compression will be turned off.

Activates or deactivates page compression. When activated, the internal representation of each page is compressed, which leads to a compression ratio of about 2 for the resulting document. Compression is on by default.
Note: the Zlib extension is required for this feature. If not present, compression will be turned off.

Since

See

Public

Terminates the PDF document.
It is not necessary to call this method explicitly because Output() does it automatically.
If the document contains no page, AddPage() is called to prevent from getting an invalid document.

Terminates the PDF document.
It is not necessary to call this method explicitly because Output() does it automatically.
If the document contains no page, AddPage() is called to prevent from getting an invalid document.

Since

See

Public

Adds a new page to the document. If a page is already present, the Footer() method is called first to output the footer (if enabled). Then the page is added, the current position set to the top-left corner according to the left and top margins (or top-right if in RTL mode), and Header() is called to display the header (if enabled).
The origin of the coordinate system is at the top-left corner (or top-right for RTL) and increasing ordinates go downwards.

Adds a new page to the document. If a page is already present, the Footer() method is called first to output the footer (if enabled). Then the page is added, the current position set to the top-left corner according to the left and top margins (or top-right if in RTL mode), and Header() is called to display the header (if enabled).
The origin of the coordinate system is at the top-left corner (or top-right for RTL) and increasing ordinates go downwards.

Parameters

$orientation

page orientation. Possible values are (case insensitive):

P or PORTRAIT (default)

L or LANDSCAPE

$format

The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat().

$keepmargins

if true overwrites the default page margins with the current margins

$tocpage

if true set the tocpage state to true (the added page will be used to display Table Of Content).

Since

See

Public

Set start-writing mark on current page stream used to put borders and fills.
Borders and fills are always created after content and inserted on the position marked by this method.
This function must be called after calling Image() function for a background image.
Background images must be always inserted before calling Multicell() or WriteHTMLCell() or WriteHTML() functions.

Set start-writing mark on current page stream used to put borders and fills.
Borders and fills are always created after content and inserted on the position marked by this method.
This function must be called after calling Image() function for a background image.
Background images must be always inserted before calling Multicell() or WriteHTMLCell() or WriteHTML() functions.

Since

See

Public

Set the color array for the specified type ('draw', 'fill', 'text').
It can be expressed in RGB, CMYK or GRAY SCALE components.
The method can be called before the first page is created and the value is retained from page to page.

Set the color array for the specified type ('draw', 'fill', 'text').
It can be expressed in RGB, CMYK or GRAY SCALE components.
The method can be called before the first page is created and the value is retained from page to page.

Returns

Since

Public

Defines the color used for all drawing operations (lines, rectangles and cell borders).
It can be expressed in RGB, CMYK or GRAY SCALE components.
The method can be called before the first page is created and the value is retained from page to page.

Defines the color used for all drawing operations (lines, rectangles and cell borders).
It can be expressed in RGB, CMYK or GRAY SCALE components.
The method can be called before the first page is created and the value is retained from page to page.

Parameters

$color

Array of colors (1, 3 or 4 values).

$ret

If true do not send the PDF command.

Returns

stringthe PDF command

Since

3.1.000 (2008-06-11)

See

Public

Defines the color used for all filling operations (filled rectangles and cell backgrounds).
It can be expressed in RGB, CMYK or GRAY SCALE components.
The method can be called before the first page is created and the value is retained from page to page.

Defines the color used for all filling operations (filled rectangles and cell backgrounds).
It can be expressed in RGB, CMYK or GRAY SCALE components.
The method can be called before the first page is created and the value is retained from page to page.

Returns

Since

Public

Defines the color used for all drawing operations (lines, rectangles and cell borders). It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page.

Defines the color used for all drawing operations (lines, rectangles and cell borders). It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page.

Parameters

$col1

GRAY level for single color, or Red color for RGB (0-255), or CYAN color for CMYK (0-100).

Public

Defines the color used for all filling operations (filled rectangles and cell backgrounds). It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page.

Defines the color used for all filling operations (filled rectangles and cell backgrounds). It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page.

Parameters

$col1

GRAY level for single color, or Red color for RGB (0-255), or CYAN color for CMYK (0-100).

Since

Protected

Imports a TrueType, Type1, core, or CID0 font and makes it available.
It is necessary to generate a font definition file first (read /fonts/utils/README.TXT).
The definition file (and the font file itself when embedding) must be present either in the current directory or in the one indicated by K_PATH_FONTS if the constant is defined. If it could not be found, the error "Could not include font definition file" is generated.

Imports a TrueType, Type1, core, or CID0 font and makes it available.
It is necessary to generate a font definition file first (read /fonts/utils/README.TXT).
The definition file (and the font file itself when embedding) must be present either in the current directory or in the one indicated by K_PATH_FONTS if the constant is defined. If it could not be found, the error "Could not include font definition file" is generated.

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

arraycontaining the font data, or false in case of error.

Since

1.5

See

Public

Sets the font used to print character strings.
The font can be either a standard one or a font added via the AddFont() method. Standard fonts use Windows encoding cp1252 (Western Europe).
The method can be called before the first page is created and the font is retained from page to page.
If you just wish to change the current font size, it is simpler to call SetFontSize().
Note: for the standard fonts, the font metric files must be accessible. There are three possibilities for this:

They are in the current directory (the one where the running script lies)

They are in one of the directories defined by the include_path parameter

They are in the directory defined by the K_PATH_FONTS constant

Sets the font used to print character strings.
The font can be either a standard one or a font added via the AddFont() method. Standard fonts use Windows encoding cp1252 (Western Europe).
The method can be called before the first page is created and the font is retained from page to page.
If you just wish to change the current font size, it is simpler to call SetFontSize().
Note: for the standard fonts, the font metric files must be accessible. There are three possibilities for this:

They are in the current directory (the one where the running script lies)

They are in one of the directories defined by the include_path parameter

They are in the directory defined by the K_PATH_FONTS constant

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 through

O: overline

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.

Since

Public

Parameters

Since

Public

Creates a new internal link and returns its identifier. An internal link is a clickable area which directs to another place within the document.
The identifier can then be passed to Cell(), Write(), Image() or Link(). The destination is defined with SetLink().

Creates a new internal link and returns its identifier. An internal link is a clickable area which directs to another place within the document.
The identifier can then be passed to Cell(), Write(), Image() or Link(). The destination is defined with SetLink().

Since

See

Public

Puts a link on a rectangular area of the page.
Text or image links are generally put via Cell(), Write() or Image(), but this method can be useful for instance to define a clickable area inside an image.

Puts a link on a rectangular area of the page.
Text or image links are generally put via Cell(), Write() or Image(), but this method can be useful for instance to define a clickable area inside an image.

Since

See

Public

Whenever a page break condition is met, the method is called, and the break is issued or not depending on the returned value.
The default implementation returns a value according to the mode selected by SetAutoPageBreak().
This method is called automatically and should not be called directly by the application.

Whenever a page break condition is met, the method is called, and the break is issued or not depending on the returned value.
The default implementation returns a value according to the mode selected by SetAutoPageBreak().
This method is called automatically and should not be called directly by the application.

Since

Protected

Prints a cell (rectangular area) with optional borders, background color and character string. The upper-left corner of the cell corresponds to the current position. The text can be aligned or centered. After the call, the current position moves to the right or to the next line. It is possible to put a link on the text.
If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting.

Prints a cell (rectangular area) with optional borders, background color and character string. The upper-left corner of the cell corresponds to the current position. The text can be aligned or centered. After the call, the current position moves to the right or to the next line. It is possible to put a link on the text.
If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting.

Parameters

$w

Cell width. If 0, the cell extends up to the right margin.

$h

Cell height. Default value: 0.

$txt

String to print. Default value: empty string.

$border

Indicates if borders must be drawn around the cell. The value can be a number:

0: no border (default)

1: frame

or a string containing some or all of the following characters (in any order):

Public

Returns the PDF string code to print a cell (rectangular area) with optional borders, background color and character string. The upper-left corner of the cell corresponds to the current position. The text can be aligned or centered. After the call, the current position moves to the right or to the next line. It is possible to put a link on the text.
If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting.

Returns the PDF string code to print a cell (rectangular area) with optional borders, background color and character string. The upper-left corner of the cell corresponds to the current position. The text can be aligned or centered. After the call, the current position moves to the right or to the next line. It is possible to put a link on the text.
If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting.

Parameters

$w

Cell width. If 0, the cell extends up to the right margin.

$h

Cell height. Default value: 0.

$txt

String to print. Default value: empty string.

$border

Indicates if borders must be drawn around the cell. The value can be a number:

0: no border (default)

1: frame

or a string containing some or all of the following characters (in any order):

This method allows printing text with line breaks.
They can be automatic (as soon as the text reaches the right border of the cell) or explicit (via the \n character). As many cells as necessary are output, one below the other.
Text can be aligned, centered or justified. The cell block can be framed and the background painted.

This method allows printing text with line breaks.
They can be automatic (as soon as the text reaches the right border of the cell) or explicit (via the \n character). As many cells as necessary are output, one below the other.
Text can be aligned, centered or justified. The cell block can be framed and the background painted.

Parameters

$w

Width of cells. If 0, they extend up to the right margin of the page.

$h

Cell minimum height. The cell extends automatically if needed.

$txt

String to print

$border

Indicates if borders must be drawn around the cell. The value can be a number:

0: no border (default)

1: frame

or a string containing some or all of the following characters (in any order):

Author

Since

Public

This method return the estimated height needed for printing a simple text string using the Multicell() method.
Generally, if you want to know the exact height for a block of content you can use the following alternative technique:

This method return the estimated height needed for printing a simple text string using the Multicell() method.
Generally, if you want to know the exact height for a block of content you can use the following alternative technique:

Parameters

$w

Width of cells. If 0, they extend up to the right margin of the page.

$txt

String for calculating his height

$reseth

if true reset the last cell height (default false).

$autopadding

if true, uses internal padding and automatically adjust it to account for line width (default true).

$cellpadding

Internal cell padding, if empty uses default cell padding.

$border

Indicates if borders must be drawn around the cell. The value can be a number:

0: no border (default)

1: frame

or a string containing some or all of the following characters (in any order):

Puts an image in the page.
The upper-left corner must be given.
The dimensions can be specified in different ways:

explicit width and height (expressed in user unit)

one explicit dimension, the other being calculated automatically in order to keep the original proportions

no explicit dimension, in which case the image is put at 72 dpi

Supported formats are JPEG and PNG images whitout GD library and all images supported by GD: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM;
The format can be specified explicitly or inferred from the file extension.
It is possible to put a link on the image.
Remark: if an image is used several times, only one copy will be embedded in the file.

Puts an image in the page.
The upper-left corner must be given.
The dimensions can be specified in different ways:

explicit width and height (expressed in user unit)

one explicit dimension, the other being calculated automatically in order to keep the original proportions

no explicit dimension, in which case the image is put at 72 dpi

Supported formats are JPEG and PNG images whitout GD library and all images supported by GD: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM;
The format can be specified explicitly or inferred from the file extension.
It is possible to put a link on the image.
Remark: if an image is used several times, only one copy will be embedded in the file.

Parameters

$file

Name of the file containing the image or a '@' character followed by the image data string. To link an image without embedding it on the document, set an asterisk character before the URL (i.e.: '*http://www.example.com/image.jpg').

$x

Abscissa of the upper-left corner (LTR) or upper-right corner (RTL).

$y

Ordinate of the upper-left corner (LTR) or upper-right corner (RTL).

$w

Width of the image in the page. If not specified or equal to zero, it is automatically calculated.

$h

Height of the image in the page. If not specified or equal to zero, it is automatically calculated.

If not false scale image dimensions proportionally to fit within the ($w, $h) box. $fitbox can be true or a 2 characters string indicating the image alignment inside the box. The first character indicate the horizontal alignment (L = left, C = center, R = right) the second character indicate the vertical algnment (T = top, M = middle, B = bottom).

$hidden

If true do not display the image.

$fitonpage

If true the image is resized to not exceed page dimensions.

$alt

If true the image will be added as alternative and not directly printed (the ID of the image will be returned).

$altimgs

Array of alternate images IDs. Each alternative image must be an array with two values: an integer representing the image ID (the value returned by the Image method) and a boolean value to indicate if the image is the default for printing.

Since

See

Public

Send the document to a given destination: string, local file or browser.
In the last case, the plug-in may be used (if present) or a download ("Save as" dialog box) may be forced.
The method first calls Close() if necessary to terminate the document.

Send the document to a given destination: string, local file or browser.
In the last case, the plug-in may be used (if present) or a download ("Save as" dialog box) may be forced.
The method first calls Close() if necessary to terminate the document.

Parameters

$name

The name of the file when saved. Note that special characters are removed and blanks characters are replaced with the underscore character.

$dest

Destination where to send the document. It can take one of the following values:

I: send the file inline to the browser (default). The plug-in is used if available. The name given by name is used when one selects the "Save as" option on the link generating the PDF.

D: send to the browser and force a file download with the name given by name.

Returns

Protected

Set additional XMP data to be added on the default XMP data just before the end of "x:xmpmeta" tag.
IMPORTANT: This data is added as-is without controls, so you have to validate your data before using this method!

Set additional XMP data to be added on the default XMP data just before the end of "x:xmpmeta" tag.
IMPORTANT: This data is added as-is without controls, so you have to validate your data before using this method!

Set document protection
Remark: the protection against modification is for people who have the full Acrobat product.
If you don't set any password, the document will open as usual. If you set a user password, the PDF viewer will ask for it before displaying the document. The master password, if different from the user one, can be used to get full access.
Note: protecting a document requires to encrypt it, which increases the processing time a lot. This can cause a PHP time-out in some cases, especially if the document contains images or fonts.

Set document protection
Remark: the protection against modification is for people who have the full Acrobat product.
If you don't set any password, the document will open as usual. If you set a user password, the PDF viewer will ask for it before displaying the document. The master password, if different from the user one, can be used to get full access.
Note: protecting a document requires to encrypt it, which increases the processing time a lot. This can cause a PHP time-out in some cases, especially if the document contains images or fonts.

Parameters

$permissions

the set of permissions (specify the ones you want to block):

print : Print the document;

modify : Modify the contents of the document by operations other than those controlled by 'fill-forms', 'extract' and 'assemble';

fill-forms : Fill in existing interactive form fields (including signature fields), even if 'annot-forms' is not specified;

extract : Extract text and graphics (in support of accessibility to users with disabilities or for other purposes);

assemble : Assemble the document (insert, rotate, or delete pages and create bookmarks or thumbnail images), even if 'modify' is not set;

print-high : Print the document to a representation from which a faithful digital copy of the PDF content could be generated. When this is not set, printing is limited to a low-level representation of the appearance, possibly of degraded quality.

owner : (inverted logic - only for public-key) when set permits change of encryption and enables all other permissions.

Author

Since

Public

Starts a 2D tranformation saving current graphic state.
This function must be called before scaling, mirroring, translation, rotation and skewing.
Use StartTransform() before, and StopTransform() after the transformations to restore the normal behavior.

Starts a 2D tranformation saving current graphic state.
This function must be called before scaling, mirroring, translation, rotation and skewing.
Use StartTransform() before, and StopTransform() after the transformations to restore the normal behavior.

Since

2.1.000 (2008-01-07)

See

Public

Stops a 2D tranformation restoring previous graphic state.
This function must be called after scaling, mirroring, translation, rotation and skewing.
Use StartTransform() before, and StopTransform() after the transformations to restore the normal behavior.

Stops a 2D tranformation restoring previous graphic state.
This function must be called after scaling, mirroring, translation, rotation and skewing.
Use StartTransform() before, and StopTransform() after the transformations to restore the normal behavior.

Parameters

Since

Protected

Append a cubic Bezier curve to the current path. The curve shall extend from the current point to the point (x3, y3), using (x1, y1) and (x2, y2) as the Bezier control points.
The new current point shall be (x3, y3).

Append a cubic Bezier curve to the current path. The curve shall extend from the current point to the point (x3, y3), using (x1, y1) and (x2, y2) as the Bezier control points.
The new current point shall be (x3, y3).

Parameters

$x1

Abscissa of control point 1.

$y1

Ordinate of control point 1.

$x2

Abscissa of control point 2.

$y2

Ordinate of control point 2.

$x3

Abscissa of end point.

$y3

Ordinate of end point.

Since

2.1.000 (2008-01-08)

Protected

Append a cubic Bezier curve to the current path. The curve shall extend from the current point to the point (x3, y3), using the current point and (x2, y2) as the Bezier control points.
The new current point shall be (x3, y3).

Append a cubic Bezier curve to the current path. The curve shall extend from the current point to the point (x3, y3), using the current point and (x2, y2) as the Bezier control points.
The new current point shall be (x3, y3).

Parameters

$x2

Abscissa of control point 2.

$y2

Ordinate of control point 2.

$x3

Abscissa of end point.

$y3

Ordinate of end point.

Since

4.9.019 (2010-04-26)

Protected

Append a cubic Bezier curve to the current path. The curve shall extend from the current point to the point (x3, y3), using (x1, y1) and (x3, y3) as the Bezier control points.
The new current point shall be (x3, y3).

Append a cubic Bezier curve to the current path. The curve shall extend from the current point to the point (x3, y3), using (x1, y1) and (x3, y3) as the Bezier control points.
The new current point shall be (x3, y3).

Public

Parameters

$x

Abscissa of upper-left corner.

$y

Ordinate of upper-left corner.

$w

Width.

$h

Height.

$r

the radius of the circle used to round off the corners of the rectangle.

$round_corner

Draws rounded corner or not. String with a 0 (not rounded i-corner) or 1 (rounded i-corner) in i-position. Positions are, in order and begin to 0: top right, bottom right, bottom left and top left. Default value: all rounded corner ("1111").

$style

Style of rendering. See the getPathPaintOperator() function for more information.

Parameters

the x-axis radius of the ellipse used to round off the corners of the rectangle.

$ry

the y-axis radius of the ellipse used to round off the corners of the rectangle.

$round_corner

Draws rounded corner or not. String with a 0 (not rounded i-corner) or 1 (rounded i-corner) in i-position. Positions are, in order and begin to 0: top right, bottom right, bottom left and top left. Default value: all rounded corner ("1111").

$style

Style of rendering. See the getPathPaintOperator() function for more information.

Set User's Rights for PDF Reader
WARNING: This is experimental and currently do not work.
Check the PDF Reference 8.7.1 Transform Methods,
Table 8.105 Entries in the UR transform parameters dictionary

Set User's Rights for PDF Reader
WARNING: This is experimental and currently do not work.
Check the PDF Reference 8.7.1 Transform Methods,
Table 8.105 Entries in the UR transform parameters dictionary

Parameters

$enable

if true enable user's rights on PDF reader

$document

Names specifying additional document-wide usage rights for the document. The only defined value is "/FullSave", which permits a user to save the document along with modified form and/or annotation data.

$annots

Names specifying additional annotation-related usage rights for the document. Valid names in PDF 1.5 and later are /Create/Delete/Modify/Copy/Import/Export, which permit the user to perform the named operation on annotations.

Names specifying additional signature-related usage rights for the document. The only defined value is /Modify, which permits a user to apply a digital signature to an existing signature form field or clear a signed signature form field.

$ef

Names specifying additional usage rights for named embedded files in the document. Valid names are /Create/Delete/Modify/Import, which permit the user to perform the named operation on named embedded files
Names specifying additional embedded-files-related usage rights for the document.

$formex

Names specifying additional form-field-related usage rights. The only valid name is BarcodePlaintext, which permits text form field data to be encoded as a plaintext two-dimensional barcode.

Parameters

specifies the name of a file containing a bunch of extra certificates to include in the signature which can for example be used to help the recipient to verify the certificate that you used.

$cert_type

The access permissions granted for this document. Valid values shall be: 1 = No changes to the document shall be permitted; any change to the document shall invalidate the signature; 2 = Permitted changes shall be filling in forms, instantiating page templates, and signing; other changes shall invalidate the signature; 3 = Permitted changes shall be the same as for 2, as well as annotation creation, deletion, and modification; other changes shall invalidate the signature.

Author

Since

Protected

Enable document timestamping (requires the OpenSSL Library).
The trusted timestamping improve document security that means that no one should be able to change the document once it has been recorded.
Use with digital signature only!

Enable document timestamping (requires the OpenSSL Library).
The trusted timestamping improve document security that means that no one should be able to change the document once it has been recorded.
Use with digital signature only!

Returns

Since

Public

Returns the string alias used for the total number of pages.
If the current font is unicode type, the returned string is surrounded by additional curly braces.
This alias will be replaced by the total number of pages in the document.

Returns the string alias used for the total number of pages.
If the current font is unicode type, the returned string is surrounded by additional curly braces.
This alias will be replaced by the total number of pages in the document.

Returns

Since

Public

Return the alias for the total number of pages in the current page group.
If the current font is unicode type, the returned string is surrounded by additional curly braces.
This alias will be replaced by the total number of pages in this group.

Return the alias for the total number of pages in the current page group.
If the current font is unicode type, the returned string is surrounded by additional curly braces.
This alias will be replaced by the total number of pages in this group.

Returns

aliasof the current page group

Since

3.0.000 (2008-03-27)

Public

Return the alias for the page number on the current page group.
If the current font is unicode type, the returned string is surrounded by additional curly braces.
This alias will be replaced by the page number (relative to the belonging group).

Return the alias for the page number on the current page group.
If the current font is unicode type, the returned string is surrounded by additional curly braces.
This alias will be replaced by the page number (relative to the belonging group).

FitWindow boolean (Optional) A flag specifying whether to resize the document's window to fit the size of the first displayed page. Default value: false.

CenterWindow boolean (Optional) A flag specifying whether to position the document's window in the center of the screen. Default value: false.

DisplayDocTitle boolean (Optional; PDF 1.4) A flag specifying whether the window's title bar should display the document title taken from the Title entry of the document information dictionary (see Section 10.2.1, "Document Information Dictionary"). If false, the title bar should instead display the name of the PDF file containing the document. Default value: false.

NonFullScreenPageMode name (Optional) The document's page mode, specifying how to display the document on exiting full-screen mode:

UseNone Neither document outline nor thumbnail images visible

UseOutlines Document outline visible

UseThumbs Thumbnail images visible

UseOC Optional content group panel visible

This entry is meaningful only if the value of the PageMode entry in the catalog dictionary (see Section 3.6.1, "Document Catalog") is FullScreen; it is ignored otherwise. Default value: UseNone.

ViewArea name (Optional; PDF 1.4) The name of the page boundary representing the area of a page to be displayed when viewing the document on the screen. Valid values are (see Section 10.10.1, "Page Boundaries").:

MediaBox

CropBox (default)

BleedBox

TrimBox

ArtBox

ViewClip name (Optional; PDF 1.4) The name of the page boundary to which the contents of a page are to be clipped when viewing the document on the screen. Valid values are (see Section 10.10.1, "Page Boundaries").:

MediaBox

CropBox (default)

BleedBox

TrimBox

ArtBox

PrintArea name (Optional; PDF 1.4) The name of the page boundary representing the area of a page to be rendered when printing the document. Valid values are (see Section 10.10.1, "Page Boundaries").:

MediaBox

CropBox (default)

BleedBox

TrimBox

ArtBox

PrintClip name (Optional; PDF 1.4) The name of the page boundary to which the contents of a page are to be clipped when printing the document. Valid values are (see Section 10.10.1, "Page Boundaries").:

MediaBox

CropBox (default)

BleedBox

TrimBox

ArtBox

PrintScaling name (Optional; PDF 1.6) The page scaling option to be selected when a print dialog is displayed for this document. Valid values are:

None, which indicates that the print dialog should reflect no page scaling

AppDefault (default), which indicates that applications should use the current print scaling

Duplex name (Optional; PDF 1.7) The paper handling option to use when printing the file from the print dialog. The following values are valid:

Simplex - Print single-sided

DuplexFlipShortEdge - Duplex and flip on the short edge of the sheet

DuplexFlipLongEdge - Duplex and flip on the long edge of the sheet

Default value: none

PickTrayByPDFSize boolean (Optional; PDF 1.7) A flag specifying whether the PDF page size is used to select the input paper tray. This setting influences only the preset values used to populate the print dialog presented by a PDF viewer application. If PickTrayByPDFSize is true, the check box in the print dialog associated with input paper tray is checked. Note: This setting has no effect on Mac OS systems, which do not provide the ability to pick the input tray by size.

PrintPageRange array (Optional; PDF 1.7) The page numbers used to initialize the print dialog box when the file is printed. The first page of the PDF file is denoted by 1. Each pair consists of the first and last pages in the sub-range. An odd number of integers causes this entry to be ignored. Negative numbers cause the entire array to be ignored. Default value: as defined by PDF viewer application

NumCopies integer (Optional; PDF 1.7) The number of copies to be printed when the print dialog is opened for this file. Supported values are the integers 2 through 5. Values outside this range are ignored. Default value: as defined by PDF viewer application, but typically 1

Set the viewer preferences dictionary controlling the way the document is to be presented on the screen or in print.
(see Section 8.1 of PDF reference, "Viewer Preferences").

FitWindow boolean (Optional) A flag specifying whether to resize the document's window to fit the size of the first displayed page. Default value: false.

CenterWindow boolean (Optional) A flag specifying whether to position the document's window in the center of the screen. Default value: false.

DisplayDocTitle boolean (Optional; PDF 1.4) A flag specifying whether the window's title bar should display the document title taken from the Title entry of the document information dictionary (see Section 10.2.1, "Document Information Dictionary"). If false, the title bar should instead display the name of the PDF file containing the document. Default value: false.

NonFullScreenPageMode name (Optional) The document's page mode, specifying how to display the document on exiting full-screen mode:

UseNone Neither document outline nor thumbnail images visible

UseOutlines Document outline visible

UseThumbs Thumbnail images visible

UseOC Optional content group panel visible

This entry is meaningful only if the value of the PageMode entry in the catalog dictionary (see Section 3.6.1, "Document Catalog") is FullScreen; it is ignored otherwise. Default value: UseNone.

ViewArea name (Optional; PDF 1.4) The name of the page boundary representing the area of a page to be displayed when viewing the document on the screen. Valid values are (see Section 10.10.1, "Page Boundaries").:

MediaBox

CropBox (default)

BleedBox

TrimBox

ArtBox

ViewClip name (Optional; PDF 1.4) The name of the page boundary to which the contents of a page are to be clipped when viewing the document on the screen. Valid values are (see Section 10.10.1, "Page Boundaries").:

MediaBox

CropBox (default)

BleedBox

TrimBox

ArtBox

PrintArea name (Optional; PDF 1.4) The name of the page boundary representing the area of a page to be rendered when printing the document. Valid values are (see Section 10.10.1, "Page Boundaries").:

MediaBox

CropBox (default)

BleedBox

TrimBox

ArtBox

PrintClip name (Optional; PDF 1.4) The name of the page boundary to which the contents of a page are to be clipped when printing the document. Valid values are (see Section 10.10.1, "Page Boundaries").:

MediaBox

CropBox (default)

BleedBox

TrimBox

ArtBox

PrintScaling name (Optional; PDF 1.6) The page scaling option to be selected when a print dialog is displayed for this document. Valid values are:

None, which indicates that the print dialog should reflect no page scaling

AppDefault (default), which indicates that applications should use the current print scaling

Duplex name (Optional; PDF 1.7) The paper handling option to use when printing the file from the print dialog. The following values are valid:

Simplex - Print single-sided

DuplexFlipShortEdge - Duplex and flip on the short edge of the sheet

DuplexFlipLongEdge - Duplex and flip on the long edge of the sheet

Default value: none

PickTrayByPDFSize boolean (Optional; PDF 1.7) A flag specifying whether the PDF page size is used to select the input paper tray. This setting influences only the preset values used to populate the print dialog presented by a PDF viewer application. If PickTrayByPDFSize is true, the check box in the print dialog associated with input paper tray is checked. Note: This setting has no effect on Mac OS systems, which do not provide the ability to pick the input tray by size.

PrintPageRange array (Optional; PDF 1.7) The page numbers used to initialize the print dialog box when the file is printed. The first page of the PDF file is denoted by 1. Each pair consists of the first and last pages in the sub-range. An odd number of integers causes this entry to be ignored. Negative numbers cause the entire array to be ignored. Default value: as defined by PDF viewer application

NumCopies integer (Optional; PDF 1.7) The number of copies to be printed when the print dialog is opened for this file. Supported values are the integers 2 through 5. Values outside this range are ignored. Default value: as defined by PDF viewer application, but typically 1

array of the form (fx, fy, cx, cy, r) where (fx, fy) is the starting point of the gradient with color1, (cx, cy) is the center of the circle with color2, and r is the radius of the circle (see radial_gradient_coords.jpg). (fx, fy) should be inside the circle, otherwise some areas will not be defined.

for one patch mesh: array(float x1, float y1, .... float x12, float y12): 12 pairs of coordinates (normally from 0 to 1) which specify the Bezier control points that define the patch. First pair is the lower left edge point, next is its right control point (control point 2). Then the other points are defined in the order: control point 1, edge point, control point 2 going counter-clockwise around the patch. Last (x12, y12) is the first edge point's left control point (control point 1).

for two or more patch meshes: array[number of patches]: arrays with the following keys for each patch: f: where to put that patch (0 = first patch, 1, 2, 3 = right, top and left of precedent patch - I didn't figure this out completely - just try and error ;-) points: 12 pairs of coordinates of the Bezier control points as above for the first patch, 8 pairs of coordinates for the following patches, ignoring the coordinates already defined by the precedent patch (I also didn't figure out the order of these - also: try and see what's happening) colors: must be 4 colors for the first patch, 2 colors for the following patches

$coords_min

minimum value used by the coordinates. If a coordinate's value is smaller than this it will be cut to coords_min. default: 0

$coords_max

maximum value used by the coordinates. If a coordinate's value is greater than this it will be cut to coords_max. default: 1

$antialias

A flag indicating whether to filter the shading function to prevent aliasing artifacts.

Public

Embed vector-based Adobe Illustrator (AI) or AI-compatible EPS files.
NOTE: EPS is not yet fully implemented, use the setRasterizeVectorImages() method to enable/disable rasterization of vector images using ImageMagick library.
Only vector drawing is supported, not text or bitmap.
Although the script was successfully tested with various AI format versions, best results are probably achieved with files that were exported in the AI3 format (tested with Illustrator CS2, Freehand MX and Photoshop CS2).

Embed vector-based Adobe Illustrator (AI) or AI-compatible EPS files.
NOTE: EPS is not yet fully implemented, use the setRasterizeVectorImages() method to enable/disable rasterization of vector images using ImageMagick library.
Only vector drawing is supported, not text or bitmap.
Although the script was successfully tested with various AI format versions, best results are probably achieved with files that were exported in the AI3 format (tested with Illustrator CS2, Freehand MX and Photoshop CS2).

Parameters

$file

Name of the file containing the image or a '@' character followed by the EPS/AI data string.

$x

Abscissa of the upper-left corner.

$y

Ordinate of the upper-left corner.

$w

Width of the image in the page. If not specified or equal to zero, it is automatically calculated.

$h

Height of the image in the page. If not specified or equal to zero, it is automatically calculated.

$link

URL or identifier returned by AddLink().

$useBoundingBox

specifies whether to position the bounding box (true) or the complete canvas (false) at location (x,y). Default value is true.

$align

Indicates the alignment of the pointer next to image insertion relative to image height. The value can be:

T: top-right for LTR or top-left for RTL

M: middle-right for LTR or middle-left for RTL

B: bottom-right for LTR or bottom-left for RTL

N: next line

$palign

Allows to center or align the image on the current line. Possible values are:

L : left align

C : center

R : right align

'' : empty string : left for LTR or right for RTL

$border

Indicates if borders must be drawn around the cell. The value can be a number:

0: no border (default)

1: frame

or a string containing some or all of the following characters (in any order):

string $style['stretch'] if true stretch the barcode to best fit the available width, otherwise uses $xres resolution for a single bar.

string $style['fitwidth'] if true reduce the width to fit the barcode width + padding. When this option is enabled the 'stretch' option is automatically disabled.

string $style['cellfitalign'] this option works only when 'fitwidth' is true and 'position' is unset or empty. Set the horizontal position of the containing barcode cell inside the specified rectangle: L = left; C = center; R = right.

$align

Indicates the alignment of the pointer next to barcode insertion relative to barcode height. The value can be:

Returns

Protected

Prints a cell (rectangular area) with optional borders, background color and html text string.
The upper-left corner of the cell corresponds to the current position. After the call, the current position moves to the right or to the next line.
If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting.
IMPORTANT: The HTML must be well formatted - try to clean-up it using an application like HTML-Tidy before submitting.
Supported tags are: a, b, blockquote, br, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, img, li, ol, p, pre, small, span, strong, sub, sup, table, tcpdf, td, th, thead, tr, tt, u, ul
NOTE: all the HTML attributes must be enclosed in double-quote.

Prints a cell (rectangular area) with optional borders, background color and html text string.
The upper-left corner of the cell corresponds to the current position. After the call, the current position moves to the right or to the next line.
If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting.
IMPORTANT: The HTML must be well formatted - try to clean-up it using an application like HTML-Tidy before submitting.
Supported tags are: a, b, blockquote, br, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, img, li, ol, p, pre, small, span, strong, sub, sup, table, tcpdf, td, th, thead, tr, tt, u, ul
NOTE: all the HTML attributes must be enclosed in double-quote.

Parameters

$w

Cell width. If 0, the cell extends up to the right margin.

$h

Cell minimum height. The cell extends automatically if needed.

$x

upper-left corner X coordinate

$y

upper-left corner Y coordinate

$html

html text to print. Default value: empty string.

$border

Indicates if borders must be drawn around the cell. The value can be a number:

0: no border (default)

1: frame

or a string containing some or all of the following characters (in any order):

Parameters

Since

Protected

Set the vertical spaces for HTML tags.
The array must have the following structure (example):
$tagvs = array('h1' => array(0 => array('h' => '', 'n' => 2), 1 => array('h' => 1.3, 'n' => 1)));
The first array level contains the tag names,
the second level contains 0 for opening tags or 1 for closing tags,
the third level contains the vertical space unit (h) and the number spaces to add (n).
If the h parameter is not specified, default values are used.

Set the vertical spaces for HTML tags.
The array must have the following structure (example):
$tagvs = array('h1' => array(0 => array('h' => '', 'n' => 2), 1 => array('h' => 1.3, 'n' => 1)));
The first array level contains the tag names,
the second level contains 0 for opening tags or 1 for closing tags,
the third level contains the vertical space unit (h) and the number spaces to add (n).
If the h parameter is not specified, default values are used.

Returns

Since

Public

Output a Table of Content Index (TOC).
This method must be called after all Bookmarks were set.
Before calling this method you have to open the page using the addTOCPage() method.
After calling this method you have to call endTOCPage() to close the TOC page.
You can override this method to achieve different styles.

Output a Table of Content Index (TOC).
This method must be called after all Bookmarks were set.
Before calling this method you have to open the page using the addTOCPage() method.
After calling this method you have to call endTOCPage() to close the TOC page.
You can override this method to achieve different styles.

Parameters

$page

page number where this TOC should be inserted (leave empty for current page).

$numbersfont

set the font for page numbers (please use monospaced font for better alignment).

$filler

string used to fill the space between text and page number.

$toc_name

name to use for TOC bookmark.

$style

Font style for title: B = Bold, I = Italic, BI = Bold + Italic.

$color

RGB color array for bookmark title (values from 0 to 255).

Author

Nicola Asuni

Since

4.5.000 (2009-01-02)

See

Public

Output a Table Of Content Index (TOC) using HTML templates.
This method must be called after all Bookmarks were set.
Before calling this method you have to open the page using the addTOCPage() method.
After calling this method you have to call endTOCPage() to close the TOC page.

Output a Table Of Content Index (TOC) using HTML templates.
This method must be called after all Bookmarks were set.
Before calling this method you have to open the page using the addTOCPage() method.
After calling this method you have to call endTOCPage() to close the TOC page.

Parameters

$page

page number where this TOC should be inserted (leave empty for current page).

Parameters

Returns

Author

Since

Public

Start a new XObject Template.
An XObject Template is a PDF block that is a self-contained description of any sequence of graphics objects (including path objects, text objects, and sampled images).
An XObject Template may be painted multiple times, either on several pages or at several locations on the same page and produces the same results each time, subject only to the graphics state at the time it is invoked.
Note: X,Y coordinates will be reset to 0,0.

Start a new XObject Template.
An XObject Template is a PDF block that is a self-contained description of any sequence of graphics objects (including path objects, text objects, and sampled images).
An XObject Template may be painted multiple times, either on several pages or at several locations on the same page and produces the same results each time, subject only to the graphics state at the time it is invoked.
Note: X,Y coordinates will be reset to 0,0.

Author

Since

See

Public

End the current XObject Template started with startTemplate() and restore the previous graphic state.
An XObject Template is a PDF block that is a self-contained description of any sequence of graphics objects (including path objects, text objects, and sampled images).
An XObject Template may be painted multiple times, either on several pages or at several locations on the same page and produces the same results each time, subject only to the graphics state at the time it is invoked.

End the current XObject Template started with startTemplate() and restore the previous graphic state.
An XObject Template is a PDF block that is a self-contained description of any sequence of graphics objects (including path objects, text objects, and sampled images).
An XObject Template may be painted multiple times, either on several pages or at several locations on the same page and produces the same results each time, subject only to the graphics state at the time it is invoked.

Returns

integerthe XObject Template ID in case of success or false in case of error.

Author

Nicola Asuni

Since

5.8.017 (2010-08-24)

See

Public

Print an XObject Template.
You can print an XObject Template inside the currently opened Template.
An XObject Template is a PDF block that is a self-contained description of any sequence of graphics objects (including path objects, text objects, and sampled images).
An XObject Template may be painted multiple times, either on several pages or at several locations on the same page and produces the same results each time, subject only to the graphics state at the time it is invoked.

Print an XObject Template.
You can print an XObject Template inside the currently opened Template.
An XObject Template is a PDF block that is a self-contained description of any sequence of graphics objects (including path objects, text objects, and sampled images).
An XObject Template may be painted multiple times, either on several pages or at several locations on the same page and produces the same results each time, subject only to the graphics state at the time it is invoked.

Parameters

$id

The ID of XObject Template to print.

$x

X position in user units (empty string = current x position)

$y

Y position in user units (empty string = current y position)

$w

Width in user units (zero = remaining page width)

$h

Height in user units (zero = remaining page height)

$align

Indicates the alignment of the pointer next to template insertion relative to template height. The value can be:

T: top-right for LTR or top-left for RTL

M: middle-right for LTR or middle-left for RTL

B: bottom-right for LTR or bottom-left for RTL

N: next line

$palign

Allows to center or align the template on the current line. Possible values are:

Returns

Author

Since

See

Public

Set no-write regions on page.
A no-write region is a portion of the page with a rectangular or trapezium shape that will not be covered when writing text or html code.
A region is always aligned on the left or right side of the page ad is defined using a vertical segment.
You can set multiple regions for the same page.

Set no-write regions on page.
A no-write region is a portion of the page with a rectangular or trapezium shape that will not be covered when writing text or html code.
A region is always aligned on the left or right side of the page ad is defined using a vertical segment.
You can set multiple regions for the same page.

Author

Since

See

Public

Add a single no-write region on selected page.
A no-write region is a portion of the page with a rectangular or trapezium shape that will not be covered when writing text or html code.
A region is always aligned on the left or right side of the page ad is defined using a vertical segment.
You can set multiple regions for the same page.

Add a single no-write region on selected page.
A no-write region is a portion of the page with a rectangular or trapezium shape that will not be covered when writing text or html code.
A region is always aligned on the left or right side of the page ad is defined using a vertical segment.
You can set multiple regions for the same page.

Parameters

Author

Since

See

Public

Check page for no-write regions and adapt current coordinates and page margins if necessary.
A no-write region is a portion of the page with a rectangular or trapezium shape that will not be covered when writing text or html code.
A region is always aligned on the left or right side of the page ad is defined using a vertical segment.

Check page for no-write regions and adapt current coordinates and page margins if necessary.
A no-write region is a portion of the page with a rectangular or trapezium shape that will not be covered when writing text or html code.
A region is always aligned on the left or right side of the page ad is defined using a vertical segment.

Parameters

Protected

Sets the opening SVG element handler function for the XML parser. (*** TO BE COMPLETED ***)

Sets the opening SVG element handler function for the XML parser. (*** TO BE COMPLETED ***)

Parameters

$parser

The first parameter, parser, is a reference to the XML parser calling the handler.

$name

The second parameter, name, contains the name of the element for which this handler is called. If case-folding is in effect for this parser, the element name will be in uppercase letters.

$attribs

The third parameter, attribs, contains an associative array with the element's attributes (if any). The keys of this array are the attribute names, the values are the attribute values. Attribute names are case-folded on the same criteria as element names. Attribute values are not case-folded. The original order of the attributes can be retrieved by walking through attribs the normal way, using each(). The first key in the array was the first attribute, and so on.