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.

Class TCPDF

Direct known subclasses

MC_TCPDF, TCPDF_IMPORT, TOC_TCPDF
Package: com\tecnick\tcpdf
Author: Nicola Asuni - info@tecnick.com
Version: 6.2.8
Brief: PHP class for generating PDF documents without requiring external extensions.
Class:

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.


Located at tcpdf.php
Methods summary
public
# __construct( $orientation = 'P', $unit = 'mm', $format = 'A4', $unicode = true, $encoding = 'UTF-8', $diskcache = false, $pdfa = false )

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

public
# __destruct( )

Default destructor.

public
# setPageUnit( $unit )

Set the units of measure for the document.

protected
# setPageFormat( $format, $orientation = 'P' )

Change the format of the current page

public
# setPageOrientation( $orientation, $autopagebreak = '', $bottommargin = '' )

Set page orientation.

public
# setSpacesRE( $re = '/[^\S\xa0]/' )

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)
public
# setRTL( $enable, $resetx = true )

Enable or disable Right-To-Left language mode

public boolean
# getRTL( )

Return the RTL status

public
# setTempRTL( $mode )

Force temporary RTL language direction

public boolean
# isRTLTextDir( )

Return the current temporary RTL status

public
# setLastH( $h )

Set the last cell height.

public
# getCellHeight( $fontsize, $padding = TRUE )

Return the cell height

public
# resetLastH( )

Reset the last cell height.

public last
# getLastH( )

Get the last cell height.

public
# setImageScale( $scale )

Set the adjusting factor to convert pixels to user units.

public float
# getImageScale( )

Returns the adjusting factor to convert pixels to user units.

public array
# getPageDimensions( $pagenum = '' )

Returns an array of page dimensions:

  • $this->pagedim[$this->page]['w'] = page width in points
  • $this->pagedim[$this->page]['h'] = height in points
  • $this->pagedim[$this->page]['wk'] = page width in user units
  • $this->pagedim[$this->page]['hk'] = page height in user units
  • $this->pagedim[$this->page]['tm'] = top margin
  • $this->pagedim[$this->page]['bm'] = bottom margin
  • $this->pagedim[$this->page]['lm'] = left margin
  • $this->pagedim[$this->page]['rm'] = right margin
  • $this->pagedim[$this->page]['pb'] = auto page break
  • $this->pagedim[$this->page]['or'] = page orientation
  • $this->pagedim[$this->page]['olm'] = original left margin
  • $this->pagedim[$this->page]['orm'] = original right margin
  • $this->pagedim[$this->page]['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.
  • $this->pagedim[$this->page]['PZ'] = The page's preferred zoom (magnification) factor.
  • $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']['S'] = transition style : Split, Blinds, Box, Wipe, Dissolve, Glitter, R, Fly, Push, Cover, Uncover, Fade
    • $this->pagedim[$this->page]['trans']['D'] = The duration of the transition effect, in seconds.
    • $this->pagedim[$this->page]['trans']['Dm'] = (Split and Blinds transition styles only) The dimension in which the specified transition effect shall occur: H = Horizontal, V = Vertical. Default value: H.
    • $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]['MediaBox']['llx'] = lower-left x coordinate in points
    • $this->pagedim[$this->page]['MediaBox']['lly'] = lower-left y coordinate in points
    • $this->pagedim[$this->page]['MediaBox']['urx'] = upper-right x coordinate in points
    • $this->pagedim[$this->page]['MediaBox']['ury'] = upper-right y coordinate in points
  • $this->pagedim[$this->page]['CropBox'] : the visible region of default user space
    • $this->pagedim[$this->page]['CropBox']['llx'] = lower-left x coordinate in points
    • $this->pagedim[$this->page]['CropBox']['lly'] = lower-left y coordinate in points
    • $this->pagedim[$this->page]['CropBox']['urx'] = upper-right x coordinate in points
    • $this->pagedim[$this->page]['CropBox']['ury'] = upper-right y coordinate in points
  • $this->pagedim[$this->page]['BleedBox'] : the region to which the contents of the page shall be clipped when output in a production environment
    • $this->pagedim[$this->page]['BleedBox']['llx'] = lower-left x coordinate in points
    • $this->pagedim[$this->page]['BleedBox']['lly'] = lower-left y coordinate in points
    • $this->pagedim[$this->page]['BleedBox']['urx'] = upper-right x coordinate in points
    • $this->pagedim[$this->page]['BleedBox']['ury'] = upper-right y coordinate in points
  • $this->pagedim[$this->page]['TrimBox'] : the intended dimensions of the finished page after trimming
    • $this->pagedim[$this->page]['TrimBox']['llx'] = lower-left x coordinate in points
    • $this->pagedim[$this->page]['TrimBox']['lly'] = lower-left y coordinate in points
    • $this->pagedim[$this->page]['TrimBox']['urx'] = upper-right x coordinate in points
    • $this->pagedim[$this->page]['TrimBox']['ury'] = upper-right y coordinate in points
  • $this->pagedim[$this->page]['ArtBox'] : the extent of the page's meaningful content
    • $this->pagedim[$this->page]['ArtBox']['llx'] = lower-left x coordinate in points
    • $this->pagedim[$this->page]['ArtBox']['lly'] = lower-left y coordinate in points
    • $this->pagedim[$this->page]['ArtBox']['urx'] = upper-right x coordinate in points
    • $this->pagedim[$this->page]['ArtBox']['ury'] = upper-right y coordinate in points
public integer
# getPageWidth( $pagenum = '' )

Returns the page width in units.

public integer
# getPageHeight( $pagenum = '' )

Returns the page height in units.

public integer
# getBreakMargin( $pagenum = '' )

Returns the page break margin.

public integer
# getScaleFactor( )

Returns the scale factor (number of points in user unit).

public
# SetMargins( $left, $top, $right = -1, $keepmargins = false )

Defines the left, top and right margins.

public
# SetLeftMargin( $margin )

Defines the left margin. The method can be called before creating the first page. If the current abscissa gets out of page, it is brought back to the margin.

public
# SetTopMargin( $margin )

Defines the top margin. The method can be called before creating the first page.

public
# SetRightMargin( $margin )

Defines the right margin. The method can be called before creating the first page.

public
# SetCellPadding( $pad )

Set the same internal Cell padding for top, right, bottom, left-

public
# setCellPaddings( $left = '', $top = '', $right = '', $bottom = '' )

Set the internal Cell paddings.

public array
# getCellPaddings( )

Get the internal Cell padding array.

public
# setCellMargins( $left = '', $top = '', $right = '', $bottom = '' )

Set the internal Cell margins.

public array
# getCellMargins( )

Get the internal Cell margin array.

protected array
# adjustCellPadding( $brd = 0 )

Adjust the internal Cell padding array to take account of the line width.

public
# SetAutoPageBreak( $auto, $margin = 0 )

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.

public boolean
# getAutoPageBreak( )

Return the auto-page-break mode (true or false).

public
# SetDisplayMode( $zoom, $layout = 'SinglePage', $mode = 'UseNone' )

Defines the way the document is to be displayed by the viewer.

public
# SetCompression( $compress = true )

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.

public
# setSRGBmode( $mode = false )

Set flag to force sRGB_IEC61966-2.1 black scaled ICC color profile for the whole document.

public
# SetDocInfoUnicode( $unicode = true )

Turn on/off Unicode mode for document information dictionary (meta tags). This has effect only when unicode mode is set to false.

public
# SetTitle( $title )

Defines the title of the document.

public
# SetSubject( $subject )

Defines the subject of the document.

public
# SetAuthor( $author )

Defines the author of the document.

public
# SetKeywords( $keywords )

Associates keywords with the document, generally in the form 'keyword1 keyword2 ...'.

public
# SetCreator( $creator )

Defines the creator of the document. This is typically the name of the application that generates the PDF.

public
# Error( $msg )

Throw an exception or print an error message and die if the K_TCPDF_PARSER_THROW_EXCEPTION_ERROR constant is set to true.

public
# Open( )

This method begins the generation of the PDF document. It is not necessary to call it explicitly because AddPage() does it automatically. Note: no page is created by this method

public
# Close( )

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.

public
# setPage( $pnum, $resetmargins = false )

Move pointer at the specified document page and update page dimensions.

public
# lastPage( $resetmargins = false )

Reset pointer to the last document page.

public integer
# getPage( )

Get current document page number.

public integer
# getNumPages( )

Get the total number of insered pages.

public
# addTOCPage( $orientation = '', $format = '', $keepmargins = false )

Adds a new TOC (Table Of Content) page to the document.

public
# endTOCPage( )

Terminate the current TOC (Table Of Content) page

public
# AddPage( $orientation = '', $format = '', $keepmargins = false, $tocpage = false )

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.

public
# endPage( $tocpage = false )

Terminate the current page

public
# startPage( $orientation = '', $format = '', $tocpage = false )

Starts a new page to the document. The page must be closed using the endPage() function. The origin of the coordinate system is at the top-left corner and increasing ordinates go downwards.

public
# setPageMark( )

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.

protected
# setContentMark( $page = 0 )

Set start-writing mark on selected page. Borders and fills are always created after content and inserted on the position marked by this method.

public
# setHeaderData( $ln = '', $lw = 0, $ht = '', $hs = '', $tc = array(0,0,0), $lc = array(0,0,0) )

Set header data.

public
# setFooterData( $tc = array(0,0,0), $lc = array(0,0,0) )

Set footer data.

public array()
# getHeaderData( )

Returns header data:

  • $ret['logo'] = logo image
  • $ret['logo_width'] = width of the image logo in user units
  • $ret['title'] = header title
  • $ret['string'] = header description string
public
# setHeaderMargin( $hm = 10 )

Set header margin. (minimum distance between header and top page margin)

public float
# getHeaderMargin( )

Returns header margin in user units.

public
# setFooterMargin( $fm = 10 )

Set footer margin. (minimum distance between footer and bottom page margin)

public float
# getFooterMargin( )

Returns footer margin in user units.

public
# setPrintHeader( $val = true )

Set a flag to print page header.

public
# setPrintFooter( $val = true )

Set a flag to print page footer.

public float
# getImageRBX( )

Return the right-bottom (or left-bottom for RTL) corner X coordinate of last inserted image

public float
# getImageRBY( )

Return the right-bottom (or left-bottom for RTL) corner Y coordinate of last inserted image

public
# resetHeaderTemplate( )

Reset the xobject template used by Header() method.

public
# setHeaderTemplateAutoreset( $val = true )

Set a flag to automatically reset the xobject template used by Header() method at each page.

public
# Header( )

This method is used to render the page header. It is automatically called by AddPage() and could be overwritten in your own inherited class.

protected
# setHeader( )

This method is used to render the page header.

protected
# setFooter( )

This method is used to render the page footer.

protected true
# inPageBody( )

Check if we are on the page body (excluding page header and footer).

protected
# setTableHeader( )

This method is used to render the table header on new page (if any).

public integer
# PageNo( )

Returns the current page number.

public (array)
# getAllSpotColors( )

Returns the array of spot colors.

public
# AddSpotColor( $name, $c, $m, $y, $k )

Defines a new spot color. 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.

public (string)
# setSpotColor( $type, $name, $tint = 100 )

Set the spot color for the specified type ('draw', 'fill', 'text').

public
# SetDrawSpotColor( $name, $tint = 100 )

Defines the spot color used for all drawing operations (lines, rectangles and cell borders).

public
# SetFillSpotColor( $name, $tint = 100 )

Defines the spot color used for all filling operations (filled rectangles and cell backgrounds).

public
# SetTextSpotColor( $name, $tint = 100 )

Defines the spot color used for text.

public (string)
# setColorArray( $type, $color, $ret = false )

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.

public string
# SetDrawColorArray( $color, $ret = false )

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.

public
# SetFillColorArray( $color, $ret = false )

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.

public
# SetTextColorArray( $color, $ret = false )

Defines the color used for text. 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.

public (string)
# setColor( $type, $col1 = 0, $col2 = -1, $col3 = -1, $col4 = -1, $ret = false, $name = '' )

Defines the color used by the specified type ('draw', 'fill', 'text').

public string
# SetDrawColor( $col1 = 0, $col2 = -1, $col3 = -1, $col4 = -1, $ret = false, $name = '' )

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.

public (string)
# SetFillColor( $col1 = 0, $col2 = -1, $col3 = -1, $col4 = -1, $ret = false, $name = '' )

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.

public (string)
# SetTextColor( $col1 = 0, $col2 = -1, $col3 = -1, $col4 = -1, $ret = false, $name = '' )

Defines the color used for text. 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.

public mixed
# GetStringWidth( $s, $fontname = '', $fontstyle = '', $fontsize = 0, $getarray = false )

Returns the length of a string in user unit. A font must be selected.

public mixed
# GetArrStringWidth( $sa, $fontname = '', $fontstyle = '', $fontsize = 0, $getarray = false )

Returns the string length of an array of chars in user unit or an array of characters widths. A font must be selected.

public float
# GetCharWidth( $char, $notlast = true )

Returns the length of the char in user unit for the current font considering current stretching and spacing (tracking).

public float
# getRawCharWidth( $char )

Returns the length of the char in user unit for the current font.

public integer
# GetNumChars( $s )

Returns the numbero of characters in a string.

protected
# getFontsList( )

Fill the list of available fonts ($this->fontlist).

public array
# AddFont( $family, $style = '', $fontfile = '', $subset = 'default' )

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.

public
# SetFont( $family, $style = '', $size = null, $fontfile = '', $subset = 'default', $out = true )

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


public
# SetFontSize( $size, $out = true )

Defines the size of the current font.

public array
# getFontBBox( )

Returns the bounding box of the current font in user units.

public float
# getAbsFontMeasure( $s )

Convert a relative font measure into absolute value.

public mixed
# getCharBBox( $char )

Returns the glyph bounding box of the specified character in the current font in user units.

public integer
# getFontDescent( $font, $style = '', $size = 0 )

Return the font descent value

public integer
# getFontAscent( $font, $style = '', $size = 0 )

Return the font ascent value.

public (boolean)
# isCharDefined( $char, $font = '', $style = '' )

Return true in the character is present in the specified font.

public (string)
# replaceMissingChars( $text, $font = '', $style = '', $subs = array() )

Replace missing font characters on selected font with specified substitutions.

public
# SetDefaultMonospacedFont( $font )

Defines the default monospaced font.

public
# Annotation( $x, $y, $w, $h, $text, $opt = array('Subtype'=>'Text'), $spaces = 0 )

Puts a markup annotation on a rectangular area of the page. !!!!THE ANNOTATION SUPPORT IS NOT YET FULLY IMPLEMENTED !!!!

protected
# _putEmbeddedFiles( )

Embedd the attached files.

public
# Text( $x, $y, $txt, $fstroke = false, $fclip = false, $ffill = true, $border = 0, $ln = 0, $align = '', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M', $rtloff = false )

Prints a text cell at the specified position. This method allows to place a string precisely on the page.

public boolean
# AcceptPageBreak( )

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.

protected boolean
# checkPageBreak( $h = 0, $y = '', $addpage = true )

Add page if needed.

public
# Cell( $w, $h = 0, $txt = '', $border = 0, $ln = 0, $align = '', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M' )

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.

protected string
# getCellCode( $w, $h = 0, $txt = '', $border = 0, $ln = 0, $align = '', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M' )

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.

protected integer
# replaceChar( $oldchar, $newchar )

Replace a char if is defined on the current font.

protected string
# getCellBorder( $x, $y, $w, $h, $brd )

Returns the code to draw the cell border

public integer
# MultiCell( $w, $h, $txt, $border = 0, $align = 'J', $fill = false, $ln = 1, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 0, $valign = 'T', $fitcell = false )

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.

public float
# getNumLines( $txt, $w = 0, $reseth = false, $autopadding = true, $cellpadding = '', $border = 0 )

This method return the estimated number of lines for print a simple text string using Multicell() method.

public float
# getStringHeight( $w, $txt, $reseth = false, $autopadding = true, $cellpadding = '', $border = 0 )

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:

public mixed
# Write( $h, $txt, $link = '', $fill = false, $align = '', $ln = false, $stretch = 0, $firstline = false, $firstblock = false, $maxh = 0, $wadj = 0, $margin = '' )

This method prints text from the current position.

protected integer
# getRemainingWidth( )

Returns the remaining width between the current position and margins.

protected array($w,
# fitBlock( $w, $h, $x, $y, $fitonpage = false )

Set the block dimensions accounting for page breaks and page/column fitting

public image
# Image( $file, $x = '', $y = '', $w = 0, $h = 0, $type = '', $link = '', $align = '', $resize = false, $dpi = 300, $palign = '', $ismask = false, $imgmask = false, $border = 0, $fitbox = false, $hidden = false, $fitonpage = false, $alt = false, $altimgs = array() )

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.

protected
# ImagePngAlpha( $file, $x, $y, $wpx, $hpx, $w, $h, $type, $link, $align, $resize, $dpi, $palign, $filehash = '' )

Extract info from a PNG image with alpha channel using the Imagick or GD library.

protected
# getGDgamma( $img, $c )

Get the GD-corrected PNG gamma value from alpha color

public
# Ln( $h = '', $cell = false )

Performs a line break. The current abscissa goes back to the left margin and the ordinate increases by the amount passed in parameter.

public float
# GetX( )

Returns the relative X value of current position. The value is relative to the left border for LTR languages and to the right border for RTL languages.

public float
# GetAbsX( )

Returns the absolute X value of current position.

public float
# GetY( )

Returns the ordinate of the current position.

public
# SetX( $x, $rtloff = false )

Defines the abscissa of the current position. If the passed value is negative, it is relative to the right of the page (or left if language is RTL).

public
# SetY( $y, $resetx = true, $rtloff = false )

Moves the current abscissa back to the left margin and sets the ordinate. If the passed value is negative, it is relative to the bottom of the page.

public
# SetXY( $x, $y, $rtloff = false )

Defines the abscissa and ordinate of the current position. If the passed values are negative, they are relative respectively to the right and bottom of the page.

public
# SetAbsX( $x )

Set the absolute X coordinate of the current pointer.

public
# SetAbsY( $y )

Set the absolute Y coordinate of the current pointer.

public
# SetAbsXY( $x, $y )

Set the absolute X and Y coordinates of the current pointer.

public string
# Output( $name = 'doc.pdf', $dest = 'I' )

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.

public
# _destroy( $destroyall = false, $preserve_objcopy = false )

Unset all class variables except the following critical variables.

protected
# _dochecks( )

Check for locale-related bug

protected array
# getInternalPageNumberAliases( $a = '' )

Return an array containing variations for the basic page number alias.

protected array
# getAllInternalPageNumberAliases( )

Return an array containing all internal page aliases.

protected replaced
# replaceRightShiftPageNumAliases( $page, $aliases, $diff )

Replace right shift page number aliases with spaces to correct right alignment. This works perfectly only when using monospaced fonts.

protected
# setPageBoxTypes( $boxes )

Set page boxes to be included on page descriptions.

protected
# _putpages( )

Output pages (and replace page number aliases).

protected string
# _getannotsrefs( $n )

Get references to page annotations.

protected
# _putannotsobjs( )

Output annotations objects for all pages. !!! THIS METHOD IS NOT YET COMPLETED !!! See section 12.5 of PDF 32000_2008 reference.

protected integer
# _putAPXObject( $w = 0, $h = 0, $stream = '' )

Put appearance streams XObject used to define annotation's appearance states.

protected
# _putfonts( )

Output fonts.

protected
# _puttruetypeunicode( $font )

Adds unicode fonts.
Based on PDF Reference 1.3 (section 5)

protected
# _putcidfont0( $font )

Output CID-0 fonts. A Type 0 CIDFont contains glyph descriptions based on the Adobe Type 1 font format

protected
# _putimages( )

Output images.

protected
# _putxobjects( )

Output Form XObjects Templates.

protected
# _putspotcolors( )

Output Spot Colors Resources.

protected string
# _getxobjectdict( )

Return XObjects Dictionary.

protected
# _putresourcedict( )

Output Resources Dictionary.

protected
# _putresources( )

Output Resources.

protected integer
# _putinfo( )

Adds some Metadata information (Document Information Dictionary) (see Chapter 14.3.3 Document Information Dictionary of PDF32000_2008.pdf Reference)

public
# setExtraXMP( $xmp )

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!

protected (int)
# _putXMP( )

Put XMP data object and return ID.

protected integer
# _putcatalog( )

Output Catalog.

protected string
# _putviewerpreferences( )

Output viewer preferences.

protected
# _putheader( )

Output PDF File Header (7.5.2).

protected
# _enddoc( )

Output end of document (EOF).

protected
# _beginpage( $orientation = '', $format = '' )

Initialize a new page.

protected
# _endpage( )

Mark end of page.

protected integer
# _newobj( )

Begin a new object and return the object number.

protected string
# _getobj( $objid = '' )

Return the starting object string for the selected object ID.

protected
# _dounderline( $x, $y, $txt )

Underline text.

protected
# _dounderlinew( $x, $y, $w )

Underline for rectangular text area.

protected
# _dolinethrough( $x, $y, $txt )

Line through text.

protected
# _dolinethroughw( $x, $y, $w )

Line through for rectangular text area.

protected
# _dooverline( $x, $y, $txt )

Overline text.

protected
# _dooverlinew( $x, $y, $w )

Overline for rectangular text area.

protected string
# _datastring( $s, $n = 0 )

Format a data string for meta information

public
# setDocCreationTimestamp( $time )

Set the document creation timestamp

public
# setDocModificationTimestamp( $time )

Set the document modification timestamp

public (int)
# getDocCreationTimestamp( )

Returns document creation timestamp in seconds.

public (int)
# getDocModificationTimestamp( )

Returns document modification timestamp in seconds.

protected string
# _datestring( $n = 0, $timestamp = 0 )

Returns a formatted date for meta information

protected string
# _textstring( $s, $n = 0 )

Format a text string for meta information

protected
# _getrawstream( $s, $n = 0 )

get raw output stream.

protected
# _out( $s )

Output a string to the document.

public
# setHeaderFont( $font )

Set header font.

public array()
# getHeaderFont( )

Get header font.

public
# setFooterFont( $font )

Set footer font.

public array()
# getFooterFont( )

Get Footer font.

public
# setLanguageArray( $language )

Set language array.

public
# getPDFData( )

Returns the PDF data.

public float
# pixelsToUnits( $px )

Converts pixels to User's Units.

public string
# unhtmlentities( $text_to_convert )

Reverse function for htmlentities. Convert entities in UTF-8.

protected integer
# _objectkey( $n )

Compute encryption key depending on object number where the encrypted data is stored. This is used for all strings and streams without crypt filter specifier.

protected TCPDF::$encrypted
# _encrypt_data( $n, $s )

Encrypt the input string.

protected
# _putencryption( )

Put encryption on PDF document.

protected string
# _Uvalue( )

Compute U value (used for encryption)

protected string
# _UEvalue( )

Compute UE value (used for encryption)

protected string
# _Ovalue( )

Compute O value (used for encryption)

protected string
# _OEvalue( )

Compute OE value (used for encryption)

protected string
# _fixAES256Password( $password )

Convert password for AES-256 encryption mode

protected
# _generateencryptionkey( )

Compute encryption key

public
# SetProtection( $permissions = array('print', 'modify', 'copy', 'annot-forms', 'fill-forms', 'extract', 'assemble', 'print-high'), $user_pass = '', $owner_pass = null, $mode = 0, $pubkeys = null )

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.

public
# StartTransform( )

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.

public
# StopTransform( )

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.

public
# ScaleX( $s_x, $x = '', $y = '' )

Horizontal Scaling.

public
# ScaleY( $s_y, $x = '', $y = '' )

Vertical Scaling.

public
# ScaleXY( $s, $x = '', $y = '' )

Vertical and horizontal proportional Scaling.

public
# Scale( $s_x, $s_y, $x = '', $y = '' )

Vertical and horizontal non-proportional Scaling.

public
# MirrorH( $x = '' )

Horizontal Mirroring.

public
# MirrorV( $y = '' )

Verical Mirroring.

public
# MirrorP( $x = '', $y = '' )

Point reflection mirroring.

public
# MirrorL( $angle = 0, $x = '', $y = '' )

Reflection against a straight line through point (x, y) with the gradient angle (angle).

public
# TranslateX( $t_x )

Translate graphic object horizontally.

public
# TranslateY( $t_y )

Translate graphic object vertically.

public
# Translate( $t_x, $t_y )

Translate graphic object horizontally and vertically.

public
# Rotate( $angle, $x = '', $y = '' )

Rotate object.

public
# SkewX( $angle_x, $x = '', $y = '' )

Skew horizontally.

public
# SkewY( $angle_y, $x = '', $y = '' )

Skew vertically.

public
# Skew( $angle_x, $angle_y, $x = '', $y = '' )

Skew.

protected
# Transform( $tm )

Apply graphic transformations.

public
# SetLineWidth( $width )

Defines the line width. By default, the value equals 0.2 mm. The method can be called before the first page is created and the value is retained from page to page.

public integer
# GetLineWidth( )

Returns the current the line width.

public string
# SetLineStyle( $style, $ret = false )

Set line style.

protected
# _outPoint( $x, $y )

Begin a new subpath by moving the current point to coordinates (x, y), omitting any connecting line segment.

protected
# _outLine( $x, $y )

Append a straight line segment from the current point to the point (x, y). The new current point shall be (x, y).

protected
# _outRect( $x, $y, $w, $h, $op )

Append a rectangle to the current path as a complete subpath, with lower-left corner (x, y) and dimensions widthand height in user space.

protected
# _outCurve( $x1, $y1, $x2, $y2, $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).

protected
# _outCurveV( $x2, $y2, $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).

protected
# _outCurveY( $x1, $y1, $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
# Line( $x1, $y1, $x2, $y2, $style = array() )

Draws a line between two points.

public
# Rect( $x, $y, $w, $h, $style = '', $border_style = array(), $fill_color = array() )

Draws a rectangle.

public
# Curve( $x0, $y0, $x1, $y1, $x2, $y2, $x3, $y3, $style = '', $line_style = array(), $fill_color = array() )

Draws a Bezier curve. The Bezier curve is a tangent to the line between the control points at either end of the curve.

public
# Polycurve( $x0, $y0, $segments, $style = '', $line_style = array(), $fill_color = array() )

Draws a poly-Bezier curve. Each Bezier curve segment is a tangent to the line between the control points at either end of the curve.

public
# Ellipse( $x0, $y0, $rx, $ry = '', $angle = 0, $astart = 0, $afinish = 360, $style = '', $line_style = array(), $fill_color = array(), $nc = 2 )

Draws an ellipse. An ellipse is formed from n Bezier curves.

protected array
# _outellipticalarc( $xc, $yc, $rx, $ry, $xang = 0, $angs = 0, $angf = 360, $pie = false, $nc = 2, $startpoint = true, $ccw = true, $svg = false )

Append an elliptical arc to the current path. An ellipse is formed from n Bezier curves.

public
# Circle( $x0, $y0, $r, $angstr = 0, $angend = 360, $style = '', $line_style = array(), $fill_color = array(), $nc = 2 )

Draws a circle. A circle is formed from n Bezier curves.

public
# PolyLine( $p, $style = '', $line_style = array(), $fill_color = array() )

Draws a polygonal line

public
# Polygon( $p, $style = '', $line_style = array(), $fill_color = array(), $closed = true )

Draws a polygon.

public
# RegularPolygon( $x0, $y0, $r, $ns, $angle = 0, $draw_circle = false, $style = '', $line_style = array(), $fill_color = array(), $circle_style = '', $circle_outLine_style = array(), $circle_fill_color = array() )

Draws a regular polygon.

public
# StarPolygon( $x0, $y0, $r, $nv, $ng, $angle = 0, $draw_circle = false, $style = '', $line_style = array(), $fill_color = array(), $circle_style = '', $circle_outLine_style = array(), $circle_fill_color = array() )

Draws a star polygon

public
# RoundedRect( $x, $y, $w, $h, $r, $round_corner = '1111', $style = '', $border_style = array(), $fill_color = array() )

Draws a rounded rectangle.

public
# RoundedRectXY( $x, $y, $w, $h, $rx, $ry, $round_corner = '1111', $style = '', $border_style = array(), $fill_color = array() )

Draws a rounded rectangle.

public
# Arrow( $x0, $y0, $x1, $y1, $head_style = 0, $arm_size = 5, $arm_angle = 15 )

Draws a grahic arrow.

public (string)
# setDestination( $name, $y = -1, $page = '', $x = -1 )

Add a Named Destination. NOTE: destination names are unique, so only last entry will be saved.

public (array)
# getDestination( )

Return the Named Destination array.

protected
# _putdests( )

Insert Named Destinations.

public
# setBookmark( $txt, $level = 0, $y = -1, $page = '', $style = '', $color = array(0,0,0), $x = -1, $link = '' )

Adds a bookmark - alias for Bookmark().

public
# Bookmark( $txt, $level = 0, $y = -1, $page = '', $style = '', $color = array(0,0,0), $x = -1, $link = '' )

Adds a bookmark.

protected
# sortBookmarks( )

Sort bookmarks for page and key.

protected
# _putbookmarks( )

Create a bookmark PDF string.

public
# IncludeJS( $script )

Adds a javascript

public integer
# addJavascriptObject( $script, $onload = false )

Adds a javascript object and return object ID

protected
# _putjavascript( )

Create a javascript PDF string.

protected
# _addfield( $type, $name, $x, $y, $w, $h, $prop )

Adds a javascript form field.

public
# setFormDefaultProp( $prop = array() )

Set default properties for form fields.

public array
# getFormDefaultProp( )

Return the default properties for form fields.

public
# TextField( $name, $w, $h, $prop = array(), $opt = array(), $x = '', $y = '', $js = false )

Creates a text field

public
# RadioButton( $name, $w, $prop = array(), $opt = array(), $onvalue = 'On', $checked = false, $x = '', $y = '', $js = false )

Creates a RadioButton field.

public
# ListBox( $name, $w, $h, $values, $prop = array(), $opt = array(), $x = '', $y = '', $js = false )

Creates a List-box field

public
# ComboBox( $name, $w, $h, $values, $prop = array(), $opt = array(), $x = '', $y = '', $js = false )

Creates a Combo-box field

public
# CheckBox( $name, $w, $checked = false, $prop = array(), $opt = array(), $onvalue = 'Yes', $x = '', $y = '', $js = false )

Creates a CheckBox field

public
# Button( $name, $w, $h, $caption, $action, $prop = array(), $opt = array(), $x = '', $y = '', $js = false )

Creates a button field

protected
# _putsignature( )

Add certification signature (DocMDP or UR3) You can set only one signature type

public
# setUserRights( $enable = true, $document = '/FullSave', $annots = '/Create/Delete/Modify/Copy/Import/Export', $form = '/Add/Delete/FillIn/Import/Export/SubmitStandalone/SpawnTemplate', $signature = '/Modify', $ef = '/Create/Delete/Modify/Import', $formex = '' )

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

public
# setSignature( $signing_cert = '', $private_key = '', $private_key_password = '', $extracerts = '', $cert_type = 2, $info = array(), $approval = '' )

Enable document signature (requires the OpenSSL Library). The digital signature improve document authenticity and integrity and allows o enable extra features on Acrobat Reader. To create self-signed signature: openssl req -x509 -nodes -days 365000 -newkey rsa:1024 -keyout tcpdf.crt -out tcpdf.crt To export crt to p12: openssl pkcs12 -export -in tcpdf.crt -out tcpdf.p12 To convert pfx certificate to pem: openssl pkcs12 -in tcpdf.pfx -out tcpdf.crt -nodes

public
# setSignatureAppearance( $x = 0, $y = 0, $w = 0, $h = 0, $page = -1, $name = '' )

Set the digital signature appearance (a cliccable rectangle area to get signature properties)

public
# addEmptySignatureAppearance( $x = 0, $y = 0, $w = 0, $h = 0, $page = -1, $name = '' )

Add an empty digital signature appearance (a cliccable rectangle area to get signature properties)

protected (array)
# getSignatureAppearanceArray( $x = 0, $y = 0, $w = 0, $h = 0, $page = -1, $name = '' )

Get the array that defines the signature appearance (page and rectangle coordinates).

public
# setTimeStamp( $tsa_host = '', $tsa_username = '', $tsa_password = '', $tsa_cert = '' )

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!

protected (string)
# applyTSA( $signature )

NOT YET IMPLEMENTED Request TSA for a timestamp

public
# startPageGroup( $page = '' )

Create a new page group. NOTE: call this function before calling AddPage()

public
# setStartingPageNumber( $num = 1 )

Set the starting page number.

public string
# getAliasRightShift( )

Returns the string alias used right align page numbers. If the current font is unicode type, the returned string wil contain an additional open curly brace.

public string
# getAliasNbPages( )

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.

public string
# getAliasNumPage( )

Returns the string alias used for the page number. 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.

public alias
# getPageGroupAlias( )

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.

public alias
# getPageNumGroupAlias( )

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

public current
# getGroupPageNo( )

Return the current page in the group.

public
# getGroupPageNoFormatted( )

Returns the current group page number formatted as a string.

public
# PageNoFormatted( )

Returns the current page number formatted as a string.

protected
# _putocg( )

Put pdf layers.

public
# startLayer( $name = '', $print = true, $view = true, $lock = true )

Start a new pdf layer.

public
# endLayer( )

End the current PDF layer.

public
# setVisibility( $v )

Set the visibility of the successive elements. This can be useful, for instance, to put a background image or color that will show on screen but won't print.

protected the
# addExtGState( $parms )

Add transparency parameters to the current extgstate

protected
# setExtGState( $gs )

Add an extgstate

protected
# _putextgstates( )

Put extgstates for object transparency

public
# setOverprint( $stroking = true, $nonstroking = '', $mode = 0 )

Set overprint mode for stroking (OP) and non-stroking (op) painting operations. (Check the "Entries in a Graphics State Parameter Dictionary" on PDF 32000-1:2008).

public array.
# getOverprint( )

Get the overprint mode array (OP, op, OPM). (Check the "Entries in a Graphics State Parameter Dictionary" on PDF 32000-1:2008).

public
# setAlpha( $stroking = 1, $bm = 'Normal', $nonstroking = '', $ais = false )

Set alpha for stroking (CA) and non-stroking (ca) operations.

public array.
# getAlpha( )

Get the alpha mode array (CA, ca, BM, AIS). (Check the "Entries in a Graphics State Parameter Dictionary" on PDF 32000-1:2008).

public
# setJPEGQuality( $quality )

Set the default JPEG compression quality (1-100)

public
# setDefaultTableColumns( $cols = 4 )

Set the default number of columns in a row for HTML tables.

public
# setCellHeightRatio( $h )

Set the height of the cell (line height) respect the font height.

public
# getCellHeightRatio( )

return the height of cell repect font height.

public
# setPDFVersion( $version = '1.7' )

Set the PDF version (check PDF reference for valid values).

public
# setViewerPreferences( $preferences )

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").

  • HideToolbar boolean (Optional) A flag specifying whether to hide the viewer application's tool bars when the document is active. Default value: false.
  • HideMenubar boolean (Optional) A flag specifying whether to hide the viewer application's menu bar when the document is active. Default value: false.
  • HideWindowUI boolean (Optional) A flag specifying whether to hide user interface elements in the document's window (such as scroll bars and navigation controls), leaving only the document's contents displayed. Default value: false.
  • 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
public
# colorRegistrationBar( $x, $y, $w, $h, $transition = true, $vertical = false, $colors = 'A,R,G,B,C,M,Y,K' )

Paints color transition registration bars

public
# cropMark( $x, $y, $w, $h, $type = 'T,R,B,L', $color = array(100,100,100,100,'All') )

Paints crop marks.

public
# registrationMark( $x, $y, $r, $double = false, $cola = array(100,100,100,100,'All'), $colb = array(0,0,0,0,'None') )

Paints a registration mark

public
# registrationMarkCMYK( $x, $y, $r )

Paints a CMYK registration mark

public
# LinearGradient( $x, $y, $w, $h, $col1 = array(), $col2 = array(), $coords = array(0,0,1,0) )

Paints a linear colour gradient.

public
# RadialGradient( $x, $y, $w, $h, $col1 = array(), $col2 = array(), $coords = array(0.5,0.5,0.5,0.5,1) )

Paints a radial colour gradient.

public
# CoonsPatchMesh( $x, $y, $w, $h, $col1 = array(), $col2 = array(), $col3 = array(), $col4 = array(), $coords = array(0.00,0.0,0.33,0.00,0.67,0.00,1.00,0.00,1.00,0.33,1.00,0.67,1.00,1.00,0.67,1.00,0.33,1.00,0.00,1.00,0.00,0.67,0.00,0.33), $coords_min = 0, $coords_max = 1, $antialias = false )

Paints a coons patch mesh.

protected
# Clip( $x, $y, $w, $h )

Set a rectangular clipping area.

public
# Gradient( $type, $coords, $stops, $background = array(), $antialias = false )

Output gradient.

public
# _putshaders( )

Output gradient shaders.

public
# PieSector( $xc, $yc, $r, $a, $b, $style = 'FD', $cw = true, $o = 90 )

Draw the sector of a circle. It can be used for instance to render pie charts.

public
# PieSectorXY( $xc, $yc, $rx, $ry, $a, $b, $style = 'FD', $cw = false, $o = 0, $nc = 2 )

Draw the sector of an ellipse. It can be used for instance to render pie charts.

public
# ImageEps( $file, $x = '', $y = '', $w = 0, $h = 0, $link = '', $useBoundingBox = true, $align = '', $palign = '', $border = 0, $fitonpage = false, $fixoutvals = false )

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

public
# setBarcode( $bc = '' )

Set document barcode.

public string
# getBarcode( )

Get current barcode.

public
# write1DBarcode( $code, $type, $x = '', $y = '', $w = '', $h = '', $xres = '', $style = array(), $align = '' )

Print a Linear Barcode.

public
# write2DBarcode( $code, $type, $x = '', $y = '', $w = '', $h = '', $style = array(), $align = '', $distort = false )

Print 2D Barcode.

public array
# getMargins( )

Returns an array containing current margins:

  • $ret['left'] = left margin
  • $ret['right'] = right margin
  • $ret['top'] = top margin
  • $ret['bottom'] = bottom margin
  • $ret['header'] = header margin
  • $ret['footer'] = footer margin
  • $ret['cell'] = cell padding array
  • $ret['padding_left'] = cell left padding
  • $ret['padding_top'] = cell top padding
  • $ret['padding_right'] = cell right padding
  • $ret['padding_bottom'] = cell bottom padding
public array
# getOriginalMargins( )

Returns an array containing original margins:

  • $ret['left'] = left margin
  • $ret['right'] = right margin
public current
# getFontSize( )

Returns the current font size.

public current
# getFontSizePt( )

Returns the current font size in points unit.

public string
# getFontFamily( )

Returns the current font family name.

public string
# getFontStyle( )

Returns the current font style.

public string
# fixHTMLCode( $html, $default_css = '', $tagvs = '', $tidy_options = '' )

Cleanup HTML code (requires HTML Tidy library).

protected integer
# getCSSBorderWidth( $width )

Returns the border width from CSS property

protected integer
# getCSSBorderDashStyle( $style )

Returns the border dash style from CSS property

protected array
# getCSSBorderStyle( $cssborder )

Returns the border style array from CSS border properties

public array
# getCSSPadding( $csspadding, $width = 0 )

Get the internal Cell padding from CSS attribute.

public array
# getCSSMargin( $cssmargin, $width = 0 )

Get the internal Cell margin from CSS attribute.

public array
# getCSSBorderMargin( $cssbspace, $width = 0 )

Get the border-spacing from CSS attribute.

protected float
# getCSSFontSpacing( $spacing, $parent = 0 )

Returns the letter-spacing value from CSS value

protected float
# getCSSFontStretching( $stretch, $parent = 100 )

Returns the percentage of font stretching from CSS value

public float
# getHTMLFontUnits( $val, $refsize = 12, $parent_size = 12, $defaultunit = 'pt' )

Convert HTML string containing font size value to points

protected array
# getHtmlDomArray( $html )

Returns the HTML DOM array.

protected string
# getSpaceString( )

Returns the string used to find spaces

protected string
# getHashForTCPDFtagParams( $data )

Return an hash code used to ensure that the serialized data has been generated by this TCPDF instance.

public string
# serializeTCPDFtagParameters( $data )

Serialize an array of parameters to be used with TCPDF tag in HTML code.

protected array
# unserializeTCPDFtagParameters( $data )

Unserialize parameters to be used with TCPDF tag in HTML code.

public
# writeHTMLCell( $w, $h, $x, $y, $html = '', $border = 0, $ln = 0, $fill = false, $reseth = true, $align = '', $autopadding = true )

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.

public
# writeHTML( $html, $ln = true, $fill = false, $reseth = false, $cell = false, $align = '' )

Allows to preserve some HTML formatting (limited support).
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.

protected
# openHTMLTagHandler( $dom, $key, $cell )

Process opening tags.

protected
# closeHTMLTagHandler( $dom, $key, $cell, $maxbottomliney = 0 )

Process closing tags.

protected
# addHTMLVertSpace( $hbz = 0, $hb = 0, $cell = false, $firsttag = false, $lasttag = false )

Add vertical spaces if needed.

protected array
# getBorderStartPosition( )

Return the starting coordinates to draw an html border

protected
# drawHTMLTagBorder( $tag, $xmax )

Draw an HTML block border and fill

public
# setLIsymbol( $symbol = '!' )

Set the default bullet to be used as LI bullet symbol

public
# SetBooklet( $booklet = true, $inner = -1, $outer = -1 )

Set the booklet mode for double-sided pages.

protected
# swapMargins( $reverse = true )

Swap the left and right margins.

public
# setHtmlVSpace( $tagvs )

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.

public
# setListIndentWidth( $width )

Set custom width for list indentation.

public
# setOpenCell( $isopen )

Set the top/bottom cell sides to be open or closed when the cell cross the page.

public
# setHtmlLinksStyle( $color = array(0,0,255), $fontstyle = 'U' )

Set the color and font style for HTML links.

public float
# getHTMLUnitToUnits( $htmlval, $refsize = 1, $defaultunit = 'px', $points = false )

Convert HTML string containing value and unit of measure to user's units or points.

protected
# putHtmlListBullet( $listdepth, $listtype = '', $size = 10 )

Output an HTML list bullet or ordered item symbol

protected array
# getGraphicVars( )

Returns current graphic variables as array.

protected
# setGraphicVars( $gvars, $extended = false )

Set graphic variables.

protected
# _outSaveGraphicsState( )

Outputs the "save graphics state" operator 'q'

protected
# _outRestoreGraphicsState( )

Outputs the "restore graphics state" operator 'Q'

protected
# setBuffer( $data )

Set buffer content (always append data).

protected
# replaceBuffer( $data )

Replace the buffer content

protected string
# getBuffer( )

Get buffer content.

protected
# setPageBuffer( $page, $data, $append = false )

Set page buffer content.

protected string
# getPageBuffer( $page )

Get page buffer content.

protected integer
# setImageBuffer( $image, $data )

Set image buffer content.

protected
# setImageSubBuffer( $image, $key, $data )

Set image buffer content for a specified sub-key.

protected string
# getImageBuffer( $image )

Get image buffer content.

protected
# setFontBuffer( $font, $data )

Set font buffer content.

protected
# setFontSubBuffer( $font, $key, $data )

Set font buffer content.

protected string
# getFontBuffer( $font )

Get font buffer content.

public true
# movePage( $frompage, $topage )

Move a page to a previous position.

public true
# deletePage( $page )

Remove the specified page.

public true
# copyPage( $page = 0 )

Clone the specified page to a new page.

public
# addTOC( $page = '', $numbersfont = '', $filler = '.', $toc_name = 'TOC', $style = '', $color = array(0,0,0) )

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.

public
# addHTMLTOC( $page = '', $toc_name = 'TOC', $templates = array(), $correct_align = true, $style = '', $color = array(0,0,0) )

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.

public
# startTransaction( )

Stores a copy of the current TCPDF object used for undo operation.

public
# commitTransaction( )

Delete the copy of the current TCPDF object used for undo operation.

public TCPDF
# rollbackTransaction( $self = false )

This method allows to undo the latest transaction by returning the latest saved TCPDF object with startTransaction().

public
# setEqualColumns( $numcols = 0, $width = 0, $y = '' )

Set multiple columns of the same size

public
# resetColumns( )

Remove columns and reset page margins.

public
# setColumnsArray( $columns )

Set columns array. Each column is represented by an array of arrays with the following keys: (w = width, s = space between columns, y = column top position).

public
# selectColumn( $col = '' )

Set position at a given column

public integer
# getColumn( )

Return the current column number

public integer
# getNumberOfColumns( )

Return the current number of columns.

public
# setTextRenderingMode( $stroke = 0, $fill = true, $clip = false )

Set Text rendering mode.

public
# setTextShadow( $params = array('enabled'=>false, 'depth_w'=>0, 'depth_h'=>0, 'color'=>false, 'opacity'=>1, 'blend_mode'=>'Normal') )

Set parameters for drop shadow effect for text.

public Array
# getTextShadow( )

Return the text shadow parameters array.

protected array
# hyphenateWord( $word, $patterns, $dictionary = array(), $leftmin = 1, $rightmin = 2, $charmin = 1, $charmax = 8 )

Returns an array of chars containing soft hyphens.

public array
# hyphenateText( $text, $patterns, $dictionary = array(), $leftmin = 1, $rightmin = 2, $charmin = 1, $charmax = 8 )

Returns text with soft hyphens.

public
# setRasterizeVectorImages( $mode )

Enable/disable rasterization of vector images using ImageMagick library.

public
# setFontSubsetting( $enable = true )

Enable or disable default option for font subsetting.

public boolean
# getFontSubsetting( )

Return the default option for font subsetting.

public left
# stringLeftTrim( $str, $replace = '' )

Left trim the input string

public right
# stringRightTrim( $str, $replace = '' )

Right trim the input string

public trimmed
# stringTrim( $str, $replace = '' )

Trim the input string

public true
# isUnicodeFont( )

Return true if the current font is unicode type.

public string
# getFontFamilyName( $fontfamily )

Return normalized font name

public integer
# startTemplate( $w = 0, $h = 0, $group = false )

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.

public integer
# endTemplate( )

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.

public
# printTemplate( $id, $x = '', $y = '', $w = 0, $h = 0, $align = '', $palign = '', $fitonpage = false )

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.

public
# setFontStretching( $perc = 100 )

Set the percentage of character stretching.

public float
# getFontStretching( )

Get the percentage of character stretching.

public
# setFontSpacing( $spacing = 0 )

Set the amount to increase or decrease the space between characters in a text.

public integer
# getFontSpacing( )

Get the amount to increase or decrease the space between characters in a text.

public array
# getPageRegions( )

Return an array of no-write page regions

public
# setPageRegions( $regions = array() )

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.

public
# addPageRegion( $region )

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.

public
# removePageRegion( $key )

Remove a single no-write region.

protected array($x,
# checkPageRegions( $h, $x, $y )

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.

public
# ImageSVG( $file, $x = '', $y = '', $w = 0, $h = 0, $link = '', $align = '', $palign = '', $border = 0, $fitonpage = false )

Embedd a Scalable Vector Graphics (SVG) image. NOTE: SVG standard is not yet fully implemented, use the setRasterizeVectorImages() method to enable/disable rasterization of vector images using ImageMagick library.

protected array
# convertSVGtMatrix( $tm )

Convert SVG transformation matrix to PDF.

protected
# SVGTransform( $tm )

Apply SVG graphic transformation matrix.

protected object
# setSVGStyles( $svgstyle, $prevsvgstyle, $x = 0, $y = 0, $w = 1, $h = 1, $clip_function = '', $clip_params = array() )

Apply the requested SVG styles (*** TO BE COMPLETED ***)

protected array
# SVGPath( $d, $style = '' )

Draws an SVG path

protected
# removeTagNamespace( $name )

Return the tag name without the namespace

protected
# startSVGElementHandler( $parser, $name, $attribs, $ctm = array() )

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

protected
# endSVGElementHandler( $parser, $name )

Sets the closing SVG element handler function for the XML parser.

protected
# segSVGContentHandler( $parser, $data )

Sets the character data handler function for the XML parser.

Properties summary
protected $page

Current page number.

#
protected $n

Current object number.

#
protected array $offsets

Array of object offsets.

# array()
protected array $pageobjects

Array of object IDs for each page.

# array()
protected $buffer

Buffer holding in-memory PDF.

#
protected array $pages

Array containing pages.

# array()
protected $state

Current document state.

#
protected $compress

Compression flag.

#
protected $CurOrientation

Current page orientation (P = Portrait, L = Landscape).

#
protected array $pagedim

Page dimensions.

# array()
protected $k

Scale factor (number of points in user unit).

#
protected $fwPt

Width of page format in points.

#
protected $fhPt

Height of page format in points.

#
protected $wPt

Current width of page in points.

#
protected $hPt

Current height of page in points.

#
protected $w

Current width of page in user unit.

#
protected $h

Current height of page in user unit.

#
protected $lMargin

Left margin.

#
protected $rMargin

Right margin.

#
protected $clMargin

Cell left margin (used by regions).

#
protected $crMargin

Cell right margin (used by regions).

#
protected $tMargin

Top margin.

#
protected $bMargin

Page break margin.

#
protected array $cell_padding

Array of cell internal paddings ('T' => top, 'R' => right, 'B' => bottom, 'L' => left).

# array('T' => 0, 'R' => 0, 'B' => 0, 'L' => 0)
protected array $cell_margin

Array of cell margins ('T' => top, 'R' => right, 'B' => bottom, 'L' => left).

# array('T' => 0, 'R' => 0, 'B' => 0, 'L' => 0)
protected $x

Current horizontal position in user unit for cell positioning.

#
protected $y

Current vertical position in user unit for cell positioning.

#
protected $lasth

Height of last cell printed.

#
protected $LineWidth

Line width in user unit.

#
protected $CoreFonts

Array of standard font names.

#
protected array $fonts

Array of used fonts.

# array()
protected array $FontFiles

Array of font files.

# array()
protected array $diffs

Array of encoding differences.

# array()
protected array $images

Array of used images.

# array()
protected integer $svg_tag_depth

Depth of the svg tag, to keep track if the svg tag is a subtag or the root tag.

# 0
protected array $PageAnnots

Array of Annotations in pages.

# array()
protected $FontFamily

Current font family.

#
protected $FontStyle

Current font style.

#
protected $FontAscent

Current font ascent (distance between font top and baseline).

#
protected $FontDescent

Current font descent (distance between font bottom and baseline).

#
protected $underline

Underlining flag.

#
protected $overline

Overlining flag.

#
protected $CurrentFont

Current font info.

#
protected $FontSizePt

Current font size in points.

#
protected $FontSize

Current font size in user unit.

#
protected $DrawColor

Commands for drawing color.

#
protected $FillColor

Commands for filling color.

#
protected $TextColor

Commands for text color.

#
protected $ColorFlag

Indicates whether fill and text colors are different.

#
protected $AutoPageBreak

Automatic page breaking.

#
protected $PageBreakTrigger

Threshold used to trigger page breaks.

#
protected boolean $InHeader

Flag set when processing page header.

# false
protected boolean $InFooter

Flag set when processing page footer.

# false
protected $ZoomMode

Zoom display mode.

#
protected $LayoutMode

Layout display mode.

#
protected boolean $docinfounicode

If true set the document information dictionary in Unicode.

# true
protected string $title

Document title.

# ''
protected string $subject

Document subject.

# ''
protected string $author

Document author.

# ''
protected string $keywords

Document keywords.

# ''
protected string $creator

Document creator.

# ''
protected integer $starting_page_number

Starting page number.

# 1
protected $img_rb_x

The right-bottom (or left-bottom for RTL) corner X coordinate of last inserted image.

#
protected $img_rb_y

The right-bottom corner Y coordinate of last inserted image.

#
protected integer $imgscale

Adjusting factor to convert pixels to user units.

# 1
protected boolean $isunicode

Boolean flag set to true when the input text is unicode (require unicode fonts).

# false
protected string $PDFVersion

PDF version.

# '1.7'
protected boolean $header_xobjid

ID of the stored default header template (-1 = not set).

# false
protected boolean $header_xobj_autoreset

If true reset the Header Xobject template at each page

# false
protected $header_margin

Minimum distance between header and top page margin.

#
protected $footer_margin

Minimum distance between footer and bottom page margin.

#
protected $original_lMargin

Original left margin value.

#
protected $original_rMargin

Original right margin value.

#
protected $header_font

Default font used on page header.

#
protected $footer_font

Default font used on page footer.

#
protected $l

Language templates.

#
protected boolean $barcode

Barcode to print on page footer (only if set).

# false
protected boolean $print_header

Boolean flag to print/hide page header.

# true
protected integer $header_logo_width

Width of header image logo in user units.

# 30
protected string $header_title

Title to be printed on default page header.

# ''
protected string $header_string

String to pring on page header after title.

# ''
protected array $header_text_color

Color for header text (RGB array).

# array(0,0,0)
protected array $header_line_color

Color for header line (RGB array).

# array(0,0,0)
protected array $footer_text_color

Color for footer text (RGB array).

# array(0,0,0)
protected array $footer_line_color

Color for footer line (RGB array).

# array(0,0,0)
protected array $txtshadow

Text shadow data array.

# array('enabled'=>false, 'depth_w'=>0, 'depth_h'=>0, 'color'=>false, 'opacity'=>1, 'blend_mode'=>'Normal')
protected integer $default_table_columns

Default number of columns for html table.

# 4
protected array $HREF

HTML PARSER: array to store current link and rendering styles.

# array()
protected array $fontlist

List of available fonts on filesystem.

# array()
protected $fgcolor

Current foreground color.

#
protected array $listordered

HTML PARSER: array of boolean values, true in case of ordered list (OL), false otherwise.

# array()
protected array $listcount

HTML PARSER: array count list items on nested lists.

# array()
protected integer $listnum

HTML PARSER: current list nesting level.

# 0
protected integer $listindent

HTML PARSER: indent amount for lists.

# 0
protected integer $listindentlevel

HTML PARSER: current list indententation level.

# 0
protected $bgcolor

Current background color.

#
protected integer $tempfontsize

Temporary font size in points.

# 10
protected string $lispacer

Spacer string for LI tags.

# ''
protected string $encoding

Default encoding.

# 'UTF-8'
protected $internal_encoding

PHP internal encoding.

#
protected boolean $rtl

Boolean flag to indicate if the document language is Right-To-Left.

# false
protected boolean $tmprtl

Boolean flag used to force RTL or LTR string direction.

# false
protected $encrypted

IBoolean flag indicating whether document is protected.

#
protected array $encryptdata

Array containing encryption settings.

# array()
protected $last_enc_key

Last RC4 key encrypted (cached for optimisation).

#
protected $last_enc_key_c

Last RC4 computed key.

#
protected $file_id

File ID (used on document trailer).

#
protected array $outlines

Outlines for bookmark.

# array()
protected $OutlineRoot

Outline root for bookmark.

#
protected string $javascript

Javascript code.

# ''
protected $n_js

Javascript counter.

#
protected $linethrough

line through state

#
protected array $ur

Array with additional document-wide usage rights for the document.

# array()
protected integer $dpi

DPI (Dot Per Inch) Document Resolution (do not change).

# 72
protected array $newpagegroup

Array of page numbers were a new page group was started (the page numbers are the keys of the array).

# array()
protected array $pagegroups

Array that contains the number of pages in each page group.

# array()
protected integer $currpagegroup

Current page group number.

# 0
protected $extgstates

Array of transparency objects and parameters.

#
protected $jpeg_quality

Set the default JPEG compression quality (1-100).

#
protected $cell_height_ratio

Default cell height ratio.

# K_CELL_HEIGHT_RATIO
protected $viewer_preferences

PDF viewer preferences.

#
protected $PageMode

A name object specifying how the document should be displayed when opened.

#
protected array $gradients

Array for storing gradient information.

# array()
protected array $intmrk

Array used to store positions inside the pages buffer (keys are the page numbers).

# array()
protected array $bordermrk

Array used to store positions inside the pages buffer (keys are the page numbers).

# array()
protected array $emptypagemrk

Array used to store page positions to track empty pages (keys are the page numbers).

# array()
protected array $cntmrk

Array used to store content positions inside the pages buffer (keys are the page numbers).

# array()
protected array $footerpos

Array used to store footer positions of each page.

# array()
protected array $footerlen

Array used to store footer length of each page.

# array()
protected boolean $newline

Boolean flag to indicate if a new line is created.

# true
protected integer $endlinex

End position of the latest inserted line.

# 0
protected string $linestyleWidth

PDF string for width value of the last line.

# ''
protected string $linestyleCap

PDF string for CAP value of the last line.

# '0 J'
protected string $linestyleJoin

PDF string for join value of the last line.

# '0 j'
protected string $linestyleDash

PDF string for dash value of the last line.

# '[] 0 d'
protected boolean $openMarkedContent

Boolean flag to indicate if marked-content sequence is open.

# false
protected integer $htmlvspace

Count the latest inserted vertical spaces on HTML.

# 0
protected array $spot_colors

Array of Spot colors.

# array()
protected string $lisymbol

Symbol used for HTML unordered list items.

# ''
protected string $epsmarker

String used to mark the beginning and end of EPS image blocks.

# 'x#!#EPS#!#x'
protected array $transfmatrix

Array of transformation matrix.

# array()
protected integer $transfmatrix_key

Current key for transformation matrix.

# 0
protected boolean $booklet

Booklet mode for double-sided pages.

# false
protected float $feps

Epsilon value used for float calculations.

# 0.005
protected array $tagvspaces

Array used for custom vertical spaces for HTML tags.

# array()
protected integer $customlistindent

HTML PARSER: custom indent amount for lists. Negative value means disabled.

# -1
protected boolean $opencell

Boolean flag to indicate if the border of the cell sides that cross the page should be removed.

# true
protected array $embeddedfiles

Array of files to embedd.

# array()
protected boolean $premode

Boolean flag to indicate if we are inside a PRE tag.

# false
protected array $transfmrk

Array used to store positions of graphics transformation blocks inside the page buffer. keys are the page numbers

# array()
protected array $htmlLinkColorArray

Default color for html links.

# array(0, 0, 255)
protected string $htmlLinkFontStyle

Default font style to add to html links.

# 'U'
protected integer $numpages

Counts the number of pages.

# 0
protected array $pagelen

Array containing page lengths in bytes.

# array()
protected integer $numimages

Counts the number of pages.

# 0
protected array $imagekeys

Store the image keys.

# array()
protected integer $bufferlen

Length of the buffer in bytes.

# 0
protected integer $numfonts

Counts the number of fonts.

# 0
protected array $fontkeys

Store the font keys.

# array()
protected array $font_obj_ids

Store the font object IDs.

# array()
protected array $pageopen

Store the fage status (true when opened, false when closed).

# array()
protected string $default_monospaced_font

Default monospace font.

# 'courier'
protected $objcopy

Cloned copy of the current class object.

#
protected array $cache_file_length

Array used to store the lengths of cache files.

# array()
protected string $thead

Table header content to be repeated on each new page.

# ''
protected array $theadMargins

Margins used for table header.

# array()
protected boolean $sign

Boolean flag to enable document digital signature.

# false
protected array $signature_data

Digital signature data.

# array()
protected integer $signature_max_length

Digital signature max length.

# 11742
protected array $signature_appearance

Data for digital signature appearance.

# array('page' => 1, 'rect' => '0 0 0 0')
protected array $empty_signature_appearance

Array of empty digital signature appearances.

# array()
protected boolean $tsa_timestamp

Boolean flag to enable document timestamping with TSA.

# false
protected array $tsa_data

Timestamping data.

# array()
protected string $re_spaces

Regular expression used to find blank characters (required for word-wrapping).

# '/[^\S\xa0]/'
protected array $re_space

Array of $re_spaces parts.

# array('p' => '[^\S\xa0]', 'm' => '')
protected integer $sig_obj_id

Digital signature object ID.

# 0
protected array $page_obj_id

ID of page objects.

# array()
protected array $form_obj_id

List of form annotations IDs.

# array()
protected array $default_form_prop

Deafult Javascript field properties. Possible values are described on official Javascript for Acrobat API reference. Annotation options can be directly specified using the 'aopt' entry.

# array('lineWidth'=>1, 'borderStyle'=>'solid', 'fillColor'=>array(255, 255, 255), 'strokeColor'=>array(128, 128, 128))
protected array $js_objects

Javascript objects array.

# array()
protected string $form_action

Current form action (used during XHTML rendering).

# ''
protected string $form_enctype

Current form encryption type (used during XHTML rendering).

# 'application/x-www-form-urlencoded'
protected string $form_mode

Current method to submit forms.

# 'post'
protected array $annotation_fonts

List of fonts used on form fields (fontname => fontkey).

# array()
protected array $radiobutton_groups

List of radio buttons parent objects.

# array()
protected array $radio_groups

List of radio group objects IDs.

# array()
protected integer $textindent

Text indentation value (used for text-indent CSS attribute).

# 0
protected integer $start_transaction_page

Store page number when startTransaction() is called.

# 0
protected integer $start_transaction_y

Store Y position when startTransaction() is called.

# 0
protected boolean $inthead

True when we are printing the thead section on a new page.

# false
protected array $columns

Array of column measures (width, space, starting Y position).

# array()
protected integer $num_columns

Number of colums.

# 1
protected integer $current_column

Current column number.

# 0
protected integer $column_start_page

Starting page for columns.

# 0
protected array $maxselcol

Maximum page and column selected.

# array('page' => 0, 'column' => 0)
protected array $colxshift

Array of: X difference between table cell x start and starting page margin, cellspacing, cellpadding.

# array('x' => 0, 's' => array('H' => 0, 'V' => 0), 'p' => array('L' => 0, 'T' => 0, 'R' => 0, 'B' => 0))
protected integer $textrendermode

Text rendering mode: 0 = Fill text; 1 = Stroke text; 2 = Fill, then stroke text; 3 = Neither fill nor stroke text (invisible); 4 = Fill text and add to path for clipping; 5 = Stroke text and add to path for clipping; 6 = Fill, then stroke text and add to path for clipping; 7 = Add text to path for clipping.

# 0
protected integer $textstrokewidth

Text stroke width in doc units.

# 0
protected $strokecolor

Current stroke color.

#
protected string $pdfunit

Default unit of measure for document.

# 'mm'
protected boolean $tocpage

Boolean flag true when we are on TOC (Table Of Content) page.

# false
protected boolean $rasterize_vector_images

Boolean flag: if true convert vector images (SVG, EPS) to raster image using GD or ImageMagick library.

# false
protected boolean $font_subsetting

Boolean flag: if true enables font subsetting by default.

# true
protected array $default_graphic_vars

Array of default graphic settings.

# array()
protected array $xobjects

Array of XObjects.

# array()
protected boolean $inxobj

Boolean value true when we are inside an XObject.

# false
protected string $xobjid

Current XObject ID.

# ''
protected integer $font_stretching

Percentage of character stretching.

# 100
protected integer $font_spacing

Increases or decreases the space between characters in a text by the specified amount (tracking).

# 0
protected array $page_regions

Array of no-write regions. ('page' => page number or empy for current page, 'xt' => X top, 'yt' => Y top, 'xb' => X bottom, 'yb' => Y bottom, 'side' => page side 'L' = left or 'R' = right)

# array()
protected boolean $check_page_regions

Boolean value true when page region check is active.

# true
protected array $pdflayers

Array of PDF layers data.

# array()
protected array $dests

A dictionary of names and corresponding destinations (Dests key on document Catalog).

# array()
protected $n_dests

Object ID for Named Destinations

#
protected array $efnames

Embedded Files Names

# array()
protected string $svgdir

Directory used for the last SVG image.

# ''
protected string $svgunit

Deafult unit of measure for SVG.

# 'px'
protected array $svggradients

Array of SVG gradients.

# array()
protected integer $svggradientid

ID of last SVG gradient.

# 0
protected boolean $svgdefsmode

Boolean value true when in SVG defs group.

# false
protected array $svgdefs

Array of SVG defs.

# array()
protected boolean $svgclipmode

Boolean value true when in SVG clipPath tag.

# false
protected array $svgclippaths

Array of SVG clipPath commands.

# array()
protected array $svgcliptm

Array of SVG clipPath tranformation matrix.

# array()
protected integer $svgclipid

ID of last SVG clipPath.

# 0
protected string $svgtext

SVG text.

# ''
protected array $svgtextmode

SVG text properties.

# array()
protected array $svgstyles

Array of SVG properties.

# array(array( 'alignment-baseline' => 'auto', 'baseline-shift' => 'baseline', 'clip' => 'auto', 'clip-path' => 'none', 'clip-rule' => 'nonzero', 'color' => 'black', 'color-interpolation' => 'sRGB', 'color-interpolation-filters' => 'linearRGB', 'color-profile' => 'auto', 'color-rendering' => 'auto', 'cursor' => 'auto', 'direction' => 'ltr', 'display' => 'inline', 'dominant-baseline' => 'auto', 'enable-background' => 'accumulate', 'fill' => 'black', 'fill-opacity' => 1, 'fill-rule' => 'nonzero', 'filter' => 'none', 'flood-color' => 'black', 'flood-opacity' => 1, 'font' => '', 'font-family' => 'helvetica', 'font-size' => 'medium', 'font-size-adjust' => 'none', 'font-stretch' => 'normal', 'font-style' => 'normal', 'font-variant' => 'normal', 'font-weight' => 'normal', 'glyph-orientation-horizontal' => '0deg', 'glyph-orientation-vertical' => 'auto', 'image-rendering' => 'auto', 'kerning' => 'auto', 'letter-spacing' => 'normal', 'lighting-color' => 'white', 'marker' => '', 'marker-end' => 'none', 'marker-mid' => 'none', 'marker-start' => 'none', 'mask' => 'none', 'opacity' => 1, 'overflow' => 'auto', 'pointer-events' => 'visiblePainted', 'shape-rendering' => 'auto', 'stop-color' => 'black', 'stop-opacity' => 1, 'stroke' => 'none', 'stroke-dasharray' => 'none', 'stroke-dashoffset' => 0, 'stroke-linecap' => 'butt', 'stroke-linejoin' => 'miter', 'stroke-miterlimit' => 4, 'stroke-opacity' => 1, 'stroke-width' => 1, 'text-anchor' => 'start', 'text-decoration' => 'none', 'text-rendering' => 'auto', 'unicode-bidi' => 'normal', 'visibility' => 'visible', 'word-spacing' => 'normal', 'writing-mode' => 'lr-tb', 'text-color' => 'black', 'transfmatrix' => array(1, 0, 0, 1, 0, 0) ))
protected boolean $force_srgb

If true force sRGB color profile for all document.

# false
protected boolean $pdfa_mode

If true set the document to PDF/A mode.

# false
protected $doc_creation_timestamp

Document creation date-time

#
protected $doc_modification_timestamp

Document modification date-time

#
protected string $custom_xmp

Custom XMP data.

# ''
protected array $overprint

Overprint mode array. (Check the "Entries in a Graphics State Parameter Dictionary" on PDF 32000-1:2008).

# array('OP' => false, 'op' => false, 'OPM' => 0)
protected array $alpha

Alpha mode array. (Check the "Entries in a Graphics State Parameter Dictionary" on PDF 32000-1:2008).

# array('CA' => 1, 'ca' => 1, 'BM' => '/Normal', 'AIS' => false)
protected array $page_boxes

Define the page boundaries boxes to be set on document.

# array('MediaBox', 'CropBox', 'BleedBox', 'TrimBox', 'ArtBox')
protected array $gdgammacache

Cache array for computed GD gamma values.

# array()
 

© 2004-2018 – Nicola Asuni - Tecnick.com - All rights reserved.
about - disclaimer - privacy