Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
TCPDF_STATIC Class Reference

Static methods used by the TCPDF class. More...

Static Public Member Functions

static _AES ($key, $text)
 Returns the input text encrypted using AES algorithm and the specified key.
 
static _AESnopad ($key, $text)
 Returns the input text encrypted using AES algorithm and the specified key.
 
static _escape ($s)
 Add "::" before "\", "(" and ")".
 
static _escapeXML ($str)
 Escape some special characters (< > &) for XML output.
 
static _freadint ($f)
 Read a 4-byte (32 bit) integer from file.
 
static _getBYTE ($str, $offset)
 Get BYTE from string (8-bit unsigned integer).
 
static _getFIXED ($str, $offset)
 Get FIXED from string (32-bit signed fixed-point number (16.16).
 
static _getFWORD ($str, $offset)
 Get FWORD from string (Big Endian 16-bit signed integer).
 
static _getSHORT ($str, $offset)
 Get SHORT from string (Big Endian 16-bit signed integer).
 
static _getUFWORD ($str, $offset)
 Get UFWORD from string (Big Endian 16-bit unsigned integer).
 
static _getULONG ($str, $offset)
 Get ULONG from string (Big Endian 32-bit unsigned integer).
 
static _getUSHORT ($str, $offset)
 Get USHORT from string (Big Endian 16-bit unsigned integer).
 
static _md5_16 ($str)
 Encrypts a string using MD5 and returns it's value as a binary string.
 
static _RC4 ($key, $text, &$last_enc_key, &$last_enc_key_c)
 Returns the input text encrypted using RC4 algorithm and the specified key.
 
static convertHexStringToString ($bs)
 Convert hexadecimal string to string.
 
static convertStringToHexString ($s)
 Convert string to hexadecimal string (byte string)
 
static empty_string ($str)
 Determine whether a string is empty.
 
static encodeNameObject ($name)
 Encode a name object.
 
static encodeUrlQuery ($url)
 Encode query params in URL.
 
static extractCSSproperties ($cssdata)
 Extracts the CSS properties from a CSS string.
 
static file_exists ($filename)
 Wrapper for file_exists.
 
static fileGetContents ($file)
 Reads entire file into a string.
 
static fixHTMLCode ($html, $default_css, $tagvs, $tidy_options, &$tagvspaces)
 Cleanup HTML code (requires HTML Tidy library).
 
static fopenLocal ($filename, $mode)
 Wrapper to use fopen only with local files.
 
static formatPageNumber ($num)
 Format the page numbers.
 
static formatTOCPageNumber ($num)
 Format the page numbers on the Table Of Content.
 
static getAnnotOptFromJSProp ($prop, &$spot_colors, $rtl=false)
 Convert JavaScript form fields properties array to Annotation Properties array.
 
static getBorderMode ($brd, $position='start', $opencell=true)
 Get the border mode accounting for multicell position (opens bottom side of multicell crossing pages)
 
static getCSSdataArray ($dom, $key, $css)
 Returns the styles array that apply for the selected HTML tag.
 
static getEncPermissionsString ($protection)
 Convert encryption P value to a string of bytes, low-order byte first.
 
static getFormattedDate ($time)
 Returns a formatted date-time.
 
static getHyphenPatternsFromTEX ($file)
 Returns an array of hyphenation patterns.
 
static getObjFilename ($type='tmp', $file_id='')
 Returns a temporary filename for caching object on filesystem.
 
static getPageLayoutMode ($layout='SinglePage')
 Get the canonical page layout mode.
 
static getPageMode ($mode='UseNone')
 Get the canonical page layout mode.
 
static getPageSizeFromFormat ($format)
 Get page dimensions from format name.
 
static getPathPaintOperator ($style, $default='S')
 Get the Path-Painting Operators.
 
static getRandomSeed ($seed='')
 Returns a string containing random data to be used as a seed for encryption methods.
 
static getSVGTransformMatrix ($attribute)
 Get the tranformation matrix from SVG transform attribute.
 
static getTagStyleFromCSSarray ($css)
 Compact CSS data array into single string.
 
static getTCPDFProducer ()
 Return the current TCPDF producer.
 
static getTCPDFVersion ()
 Return the current TCPDF version.
 
static getTimestamp ($date)
 Returns timestamp in seconds from formatted date-time.
 
static getTransformationMatrixProduct ($ta, $tb)
 Get the product of two SVG tranformation matrices.
 
static getUserPermissionCode ($permissions, $mode=0)
 Return the permission code used on encryption (P value).
 
static getVectorsAngle ($x1, $y1, $x2, $y2)
 Returns the angle in radiants between two vectors.
 
static intToRoman ($number)
 Returns the Roman representation of an integer number.
 
static isValidCSSSelectorForTag ($dom, $key, $selector)
 Returns true if the CSS selector is valid for the selected HTML tag.
 
static isValidURL ($url)
 Check if the URL exist.
 
static objclone ($object)
 Creates a copy of a class object.
 
static pregSplit ($pattern, $modifiers, $subject, $limit=NULL, $flags=NULL)
 Split string by a regular expression.
 
static removeSHY ($txt='', $unicode=true)
 Removes SHY characters from text.
 
static replacePageNumAliases ($page, $replace, $diff=0)
 Replace page number aliases with number.
 
static revstrpos ($haystack, $needle, $offset=0)
 Find position of last occurrence of a substring in a string.
 
static rfread ($handle, $length)
 Binary-safe and URL-safe file read.
 
static sendOutputData ($data, $length)
 Output input data and compress it if possible.
 
static setPageBoxes ($page, $type, $llx, $lly, $urx, $ury, $points, $k, $pagedim=array())
 Set page boundaries.
 
static swapPageBoxCoordinates ($page, $pagedim)
 Swap X and Y coordinates of page boxes (change page boxes orientation).
 
static url_exists ($url)
 Check if the URL exist.
 

Static Public Attributes

static $alias_group_num_page = '{:png:}'
 String alias for group page number.
 
static $alias_group_tot_pages = '{:ptg:}'
 String alias for total number of pages in a single group.
 
static $alias_num_page = '{:pnp:}'
 String alias for page number.
 
static $alias_right_shift = '{rsc:'
 String alias for right shift compensation used to correctly align page numbers on the right.
 
static $alias_tot_pages = '{:ptp:}'
 String alias for total number of pages.
 
static $byterange_string = '/ByteRange[0 ********** ********** **********]'
 ByteRange placemark used during digital signature process.
 
static $enc_padding = "\x28\xBF\x4E\x5E\x4E\x75\x8A\x41\x64\x00\x4E\x56\xFF\xFA\x01\x08\x2E\x2E\x00\xB6\xD0\x68\x3E\x80\x2F\x0C\xA9\xFE\x64\x53\x69\x7A"
 Encryption padding string.
 
static array< string, float[]> $page_formats
 Array of page formats measures are calculated in this way: (inches * 72) or (millimeters * 72 / 25.4) static.
 
static $pageboxes = array('MediaBox', 'CropBox', 'BleedBox', 'TrimBox', 'ArtBox')
 Array page boxes names static.
 

Detailed Description

Static methods used by the TCPDF class.

..

PHP class for generating PDF documents without requiring external extensions.

Version
1.1.1
Author
Nicola Asuni - info@.nosp@m.tecn.nosp@m.ick.c.nosp@m.om

Member Function Documentation

◆ _AES()

static TCPDF_STATIC::_AES ( $key,
$text )
static

Returns the input text encrypted using AES algorithm and the specified key.

This method requires openssl or mcrypt. Text is padded to 16bytes blocks

Parameters
string$keyencryption key
string$textinput text to be encrypted
Return values
stringencrypted text
Author
Nicola Asuni
Since
5.0.005 (2010-05-11) static

◆ _AESnopad()

static TCPDF_STATIC::_AESnopad ( $key,
$text )
static

Returns the input text encrypted using AES algorithm and the specified key.

This method requires openssl or mcrypt. Text is not padded

Parameters
string$keyencryption key
string$textinput text to be encrypted
Return values
stringencrypted text
Author
Nicola Asuni
Since
TODO static

◆ _escape()

static TCPDF_STATIC::_escape ( $s)
static

Add "::" before "\", "(" and ")".

Parameters
string$sstring to escape.
Return values
stringescaped string. static

◆ _escapeXML()

static TCPDF_STATIC::_escapeXML ( $str)
static

Escape some special characters (< > &) for XML output.

Parameters
string$strInput string to convert.
Return values
stringconverted string
Since
5.9.121 (2011-09-28) static

◆ _freadint()

static TCPDF_STATIC::_freadint ( $f)
static

Read a 4-byte (32 bit) integer from file.

Parameters
resource$ffile resource.
Return values
int4-byte integer static

◆ _getBYTE()

static TCPDF_STATIC::_getBYTE ( $str,
$offset )
static

Get BYTE from string (8-bit unsigned integer).

Parameters
string$strString from where to extract value.
int$offsetPoint from where to read the data.
Return values
int8 bit value
Author
Nicola Asuni
Since
5.2.000 (2010-06-02) static

◆ _getFIXED()

static TCPDF_STATIC::_getFIXED ( $str,
$offset )
static

Get FIXED from string (32-bit signed fixed-point number (16.16).

Parameters
string$strstring from where to extract value
int$offsetpoint from where to read the data
Return values
int16 bit value
Author
Nicola Asuni
Since
5.9.123 (2011-09-30) static

◆ _getFWORD()

static TCPDF_STATIC::_getFWORD ( $str,
$offset )
static

Get FWORD from string (Big Endian 16-bit signed integer).

Parameters
string$strString from where to extract value.
int$offsetPoint from where to read the data.
Return values
int16 bit value
Author
Nicola Asuni
Since
5.9.123 (2011-09-30) static

◆ _getSHORT()

static TCPDF_STATIC::_getSHORT ( $str,
$offset )
static

Get SHORT from string (Big Endian 16-bit signed integer).

Parameters
string$strString from where to extract value.
int$offsetPoint from where to read the data.
Return values
int16 bit value
Author
Nicola Asuni
Since
5.2.000 (2010-06-02) static

◆ _getUFWORD()

static TCPDF_STATIC::_getUFWORD ( $str,
$offset )
static

Get UFWORD from string (Big Endian 16-bit unsigned integer).

Parameters
string$strstring from where to extract value
int$offsetpoint from where to read the data
Return values
int16 bit value
Author
Nicola Asuni
Since
5.9.123 (2011-09-30) static

◆ _getULONG()

static TCPDF_STATIC::_getULONG ( $str,
$offset )
static

Get ULONG from string (Big Endian 32-bit unsigned integer).

Parameters
string$strstring from where to extract value
int$offsetpoint from where to read the data
Return values
int32 bit value
Author
Nicola Asuni
Since
5.2.000 (2010-06-02) static

◆ _getUSHORT()

static TCPDF_STATIC::_getUSHORT ( $str,
$offset )
static

Get USHORT from string (Big Endian 16-bit unsigned integer).

Parameters
string$strstring from where to extract value
int$offsetpoint from where to read the data
Return values
int16 bit value
Author
Nicola Asuni
Since
5.2.000 (2010-06-02) static

◆ _md5_16()

static TCPDF_STATIC::_md5_16 ( $str)
static

Encrypts a string using MD5 and returns it's value as a binary string.

Parameters
string$strinput string
Return values
stringMD5 encrypted binary string
Since
2.0.000 (2008-01-02) static

◆ _RC4()

static TCPDF_STATIC::_RC4 ( $key,
$text,
& $last_enc_key,
& $last_enc_key_c )
static

Returns the input text encrypted using RC4 algorithm and the specified key.

RC4 is the standard encryption algorithm used in PDF format

Parameters
string$keyEncryption key.
string$textInput text to be encrypted.
string$last_enc_keyReference to last RC4 key encrypted.
string$last_enc_key_cReference to last RC4 computed key.
Return values
stringencrypted text
Since
2.0.000 (2008-01-02)
Author
Klemen Vodopivec, Nicola Asuni static

◆ convertHexStringToString()

static TCPDF_STATIC::convertHexStringToString ( $bs)
static

Convert hexadecimal string to string.

Parameters
string$bsbyte-string to convert
Return values
string
Since
5.0.005 (2010-05-12)
Author
Nicola Asuni static

◆ convertStringToHexString()

static TCPDF_STATIC::convertStringToHexString ( $s)
static

Convert string to hexadecimal string (byte string)

Parameters
string$sstring to convert
Return values
stringbyte string
Since
5.0.010 (2010-05-17)
Author
Nicola Asuni static

◆ empty_string()

static TCPDF_STATIC::empty_string ( $str)
static

Determine whether a string is empty.

Parameters
string$strstring to be checked
Return values
booltrue if string is empty
Since
4.5.044 (2009-04-16) static

◆ encodeNameObject()

static TCPDF_STATIC::encodeNameObject ( $name)
static

Encode a name object.

Parameters
string$nameName object to encode.
Return values
stringEncoded name object.
Author
Nicola Asuni
Since
5.9.097 (2011-06-23) static

◆ encodeUrlQuery()

static TCPDF_STATIC::encodeUrlQuery ( $url)
static

Encode query params in URL.

Parameters
string$url
Return values
string
Since
6.3.3 (2019-11-01) static

◆ extractCSSproperties()

static TCPDF_STATIC::extractCSSproperties ( $cssdata)
static

Extracts the CSS properties from a CSS string.

Parameters
string$cssdatastring containing CSS definitions.
Return values
arrayAn array where the keys are the CSS selectors and the values are the CSS properties.
Author
Nicola Asuni
Since
5.1.000 (2010-05-25) static

◆ file_exists()

static TCPDF_STATIC::file_exists ( $filename)
static

Wrapper for file_exists.

Checks whether a file or directory exists. Only allows some protocols and local files.

Parameters
string$filenamePath to the file or directory.
Return values
boolReturns TRUE if the file or directory specified by filename exists; FALSE otherwise. static

◆ fileGetContents()

static TCPDF_STATIC::fileGetContents ( $file)
static

Reads entire file into a string.

The file can be also an URL.

Parameters
string$fileName of the file or URL to read.
Return values
string|falseThe function returns the read data or FALSE on failure.
Author
Nicola Asuni
Since
6.0.025 static

◆ fixHTMLCode()

static TCPDF_STATIC::fixHTMLCode ( $html,
$default_css,
$tagvs,
$tidy_options,
& $tagvspaces )
static

Cleanup HTML code (requires HTML Tidy library).

Parameters
string$htmlhtmlcode to fix
string$default_cssCSS commands to add
array | null$tagvsparameters for setHtmlVSpace method
array | null$tidy_optionsoptions for tidy_parse_string function
array$tagvspacesArray of vertical spaces for tags.
Return values
stringXHTML code cleaned up
Author
Nicola Asuni
Since
5.9.017 (2010-11-16)
See also
setHtmlVSpace() static

◆ fopenLocal()

static TCPDF_STATIC::fopenLocal ( $filename,
$mode )
static

Wrapper to use fopen only with local files.

Parameters
string$filenameName of the file to open
string$mode
Return values
resource|falseReturns a file pointer resource on success, or FALSE on error. static

◆ formatPageNumber()

static TCPDF_STATIC::formatPageNumber ( $num)
static

Format the page numbers.

This method can be overridden for custom formats.

Parameters
int$numpage number
Return values
string
Since
4.2.005 (2008-11-06) static

◆ formatTOCPageNumber()

static TCPDF_STATIC::formatTOCPageNumber ( $num)
static

Format the page numbers on the Table Of Content.

This method can be overridden for custom formats.

Parameters
int$numpage number
Return values
string
Since
4.5.001 (2009-01-04)
See also
addTOC(), addHTMLTOC() static

◆ getAnnotOptFromJSProp()

static TCPDF_STATIC::getAnnotOptFromJSProp ( $prop,
& $spot_colors,
$rtl = false )
static

Convert JavaScript form fields properties array to Annotation Properties array.

Parameters
array$propjavascript field properties. Possible values are described on official Javascript for Acrobat API reference.
array$spot_colorsReference to spot colors array.
boolean$rtlTrue if in Right-To-Left text direction mode, false otherwise.
Return values
arrayof annotation properties
Author
Nicola Asuni
Since
4.8.000 (2009-09-06) static

◆ getBorderMode()

static TCPDF_STATIC::getBorderMode ( $brd,
$position = 'start',
$opencell = true )
static

Get the border mode accounting for multicell position (opens bottom side of multicell crossing pages)

Parameters
string | array | int$brdIndicates if borders must be drawn around the cell block. The value can be a number:
  • 0: no border (default)
  • 1: frame
or a string containing some or all of the following characters (in any order):
  • L: left
  • T: top
  • R: right
  • B: bottom
or an array of line styles for each border group: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
string$positionmulticell position: 'start', 'middle', 'end'
boolean$opencellTrue when the cell is left open at the page bottom, false otherwise.
Return values
arrayborder mode array
Since
4.4.002 (2008-12-09) static

◆ getCSSdataArray()

static TCPDF_STATIC::getCSSdataArray ( $dom,
$key,
$css )
static

Returns the styles array that apply for the selected HTML tag.

Parameters
array$domarray of HTML tags and properties
int$keykey of the current HTML tag
array$cssarray of CSS properties
Return values
arraycontaining CSS properties
Since
5.1.000 (2010-05-25) static

◆ getEncPermissionsString()

static TCPDF_STATIC::getEncPermissionsString ( $protection)
static

Convert encryption P value to a string of bytes, low-order byte first.

Parameters
string$protection32bit encryption permission value (P value)
Return values
string
Since
5.0.005 (2010-05-12)
Author
Nicola Asuni static

◆ getFormattedDate()

static TCPDF_STATIC::getFormattedDate ( $time)
static

Returns a formatted date-time.

Parameters
int$timeTime in seconds.
Return values
stringescaped date string.
Since
5.9.152 (2012-03-23) static

◆ getHyphenPatternsFromTEX()

static TCPDF_STATIC::getHyphenPatternsFromTEX ( $file)
static

Returns an array of hyphenation patterns.

Parameters
string$fileTEX file containing hypenation patterns. TEX patterns can be downloaded from http://www.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/
Return values
arrayof hyphenation patterns
Author
Nicola Asuni
Since
4.9.012 (2010-04-12) static

◆ getObjFilename()

static TCPDF_STATIC::getObjFilename ( $type = 'tmp',
$file_id = '' )
static

Returns a temporary filename for caching object on filesystem.

Parameters
string$typeType of file (name of the subdir on the tcpdf cache folder).
string$file_idTCPDF file_id.
Return values
stringfilename.
Since
4.5.000 (2008-12-31) static

◆ getPageLayoutMode()

static TCPDF_STATIC::getPageLayoutMode ( $layout = 'SinglePage')
static

Get the canonical page layout mode.

Parameters
string$layoutThe page layout. Possible values are:
  • SinglePage Display one page at a time
  • OneColumn Display the pages in one column
  • TwoColumnLeft Display the pages in two columns, with odd-numbered pages on the left
  • TwoColumnRight Display the pages in two columns, with odd-numbered pages on the right
  • TwoPageLeft (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the left
  • TwoPageRight (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the right
Return values
stringCanonical page layout name. static

◆ getPageMode()

static TCPDF_STATIC::getPageMode ( $mode = 'UseNone')
static

Get the canonical page layout mode.

Parameters
string$modeA name object specifying how the document should be displayed when opened:
  • UseNone Neither document outline nor thumbnail images visible
  • UseOutlines Document outline visible
  • UseThumbs Thumbnail images visible
  • FullScreen Full-screen mode, with no menu bar, window controls, or any other window visible
  • UseOC (PDF 1.5) Optional content group panel visible
  • UseAttachments (PDF 1.6) Attachments panel visible
Return values
stringCanonical page mode name. static

◆ getPageSizeFromFormat()

static TCPDF_STATIC::getPageSizeFromFormat ( $format)
static

Get page dimensions from format name.

Parameters
mixed$formatThe format name
See also
self\$page_format<ul>
Return values
arraycontaining page width and height in points
Since
5.0.010 (2010-05-17) static

◆ getPathPaintOperator()

static TCPDF_STATIC::getPathPaintOperator ( $style,
$default = 'S' )
static

Get the Path-Painting Operators.

Parameters
string$styleStyle of rendering. Possible values are:
  • S or D: Stroke the path.
  • s or d: Close and stroke the path.
  • f or F: Fill the path, using the nonzero winding number rule to determine the region to fill.
  • f* or F*: Fill the path, using the even-odd rule to determine the region to fill.
  • B or FD or DF: Fill and then stroke the path, using the nonzero winding number rule to determine the region to fill.
  • B* or F*D or DF*: Fill and then stroke the path, using the even-odd rule to determine the region to fill.
  • b or fd or df: Close, fill, and then stroke the path, using the nonzero winding number rule to determine the region to fill.
  • b or f*d or df*: Close, fill, and then stroke the path, using the even-odd rule to determine the region to fill.
  • CNZ: Clipping mode using the even-odd rule to determine which regions lie inside the clipping path.
  • CEO: Clipping mode using the nonzero winding number rule to determine which regions lie inside the clipping path
  • n: End the path object without filling or stroking it.
string$defaultdefault style
Return values
string
Author
Nicola Asuni
Since
5.0.000 (2010-04-30) static

◆ getRandomSeed()

static TCPDF_STATIC::getRandomSeed ( $seed = '')
static

Returns a string containing random data to be used as a seed for encryption methods.

Parameters
string$seedstarting seed value
Return values
stringcontaining random data
Author
Nicola Asuni
Since
5.9.006 (2010-10-19) static

◆ getSVGTransformMatrix()

static TCPDF_STATIC::getSVGTransformMatrix ( $attribute)
static

Get the tranformation matrix from SVG transform attribute.

Parameters
string$attributetransformation
Return values
arrayof transformations
Author
Nicola Asuni
Since
5.0.000 (2010-05-02) static

◆ getTagStyleFromCSSarray()

static TCPDF_STATIC::getTagStyleFromCSSarray ( $css)
static

Compact CSS data array into single string.

Parameters
array$cssarray of CSS properties
Return values
stringcontaining merged CSS properties
Since
5.9.070 (2011-04-19) static

◆ getTCPDFProducer()

static TCPDF_STATIC::getTCPDFProducer ( )
static

Return the current TCPDF producer.

Return values
stringTCPDF producer string
Since
6.0.000 (2013-03-16) static

◆ getTCPDFVersion()

static TCPDF_STATIC::getTCPDFVersion ( )
static

Return the current TCPDF version.

Return values
stringTCPDF version string
Since
5.9.012 (2010-11-10) static

◆ getTimestamp()

static TCPDF_STATIC::getTimestamp ( $date)
static

Returns timestamp in seconds from formatted date-time.

Parameters
string$dateFormatted date-time.
Return values
intseconds.
Since
5.9.152 (2012-03-23) static

◆ getTransformationMatrixProduct()

static TCPDF_STATIC::getTransformationMatrixProduct ( $ta,
$tb )
static

Get the product of two SVG tranformation matrices.

Parameters
array$tafirst SVG tranformation matrix
array$tbsecond SVG tranformation matrix
Return values
arraytransformation array
Author
Nicola Asuni
Since
5.0.000 (2010-05-02) static

◆ getUserPermissionCode()

static TCPDF_STATIC::getUserPermissionCode ( $permissions,
$mode = 0 )
static

Return the permission code used on encryption (P value).

Parameters
array$permissionsthe set of permissions (specify the ones you want to block).
int$modeencryption strength: 0 = RC4 40 bit; 1 = RC4 128 bit; 2 = AES 128 bit; 3 = AES 256 bit.
Since
5.0.005 (2010-05-12)
Author
Nicola Asuni static

◆ getVectorsAngle()

static TCPDF_STATIC::getVectorsAngle ( $x1,
$y1,
$x2,
$y2 )
static

Returns the angle in radiants between two vectors.

Parameters
int$x1X coordinate of first vector point
int$y1Y coordinate of first vector point
int$x2X coordinate of second vector point
int$y2Y coordinate of second vector point
Author
Nicola Asuni
Since
5.0.000 (2010-05-04) static

◆ intToRoman()

static TCPDF_STATIC::intToRoman ( $number)
static

Returns the Roman representation of an integer number.

Parameters
int$numbernumber to convert
Return values
stringroman representation of the specified number
Since
4.4.004 (2008-12-10) static

◆ isValidCSSSelectorForTag()

static TCPDF_STATIC::isValidCSSSelectorForTag ( $dom,
$key,
$selector )
static

Returns true if the CSS selector is valid for the selected HTML tag.

Parameters
array$domarray of HTML tags and properties
int$keykey of the current HTML tag
string$selectorCSS selector string
Return values
trueif the selector is valid, false otherwise
Since
5.1.000 (2010-05-25) static

◆ isValidURL()

static TCPDF_STATIC::isValidURL ( $url)
static

Check if the URL exist.

Parameters
string$urlURL to check.
Return values
booleantrue if the URl exist, false otherwise.
Since
5.9.204 (2013-01-28) static

◆ objclone()

static TCPDF_STATIC::objclone ( $object)
static

Creates a copy of a class object.

Parameters
object$objectclass object to be cloned
Return values
objectcloned object
Since
4.5.029 (2009-03-19) static

◆ pregSplit()

static TCPDF_STATIC::pregSplit ( $pattern,
$modifiers,
$subject,
$limit = NULL,
$flags = NULL )
static

Split string by a regular expression.

This is a wrapper for the preg_split function to avoid the bug: https://bugs.php.net/bug.php?id=45850

Parameters
string$patternThe regular expression pattern to search for without the modifiers, as a string.
string$modifiersThe modifiers part of the pattern,
string$subjectThe input string.
int$limitIf specified, then only substrings up to limit are returned with the rest of the string being placed in the last substring. A limit of -1, 0 or NULL means "no limit" and, as is standard across PHP, you can use NULL to skip to the flags parameter.
int$flagsThe flags as specified on the preg_split PHP function.
Return values
arrayReturns an array containing substrings of subject split along boundaries matched by pattern.modifier
Author
Nicola Asuni
Since
6.0.023 static

◆ removeSHY()

static TCPDF_STATIC::removeSHY ( $txt = '',
$unicode = true )
static

Removes SHY characters from text.

Unicode Data:

  • Name : SOFT HYPHEN, commonly abbreviated as SHY
  • HTML Entity (decimal): "&amp;#173;"
  • HTML Entity (hex): "&amp;#xad;"
  • HTML Entity (named): "&amp;shy;"
  • How to type in Microsoft Windows: [Alt +00AD] or [Alt 0173]
  • UTF-8 (hex): 0xC2 0xAD (c2ad)
  • UTF-8 character: chr(194).chr(173)
Parameters
string$txtinput string
boolean$unicodeTrue if we are in unicode mode, false otherwise.
Return values
stringwithout SHY characters.
Since
(4.5.019) 2009-02-28 static

◆ replacePageNumAliases()

static TCPDF_STATIC::replacePageNumAliases ( $page,
$replace,
$diff = 0 )
static

Replace page number aliases with number.

Parameters
string$pagePage content.
array$replaceArray of replacements (array keys are replacement strings, values are alias arrays).
int$diffIf passed, this will be set to the total char number difference between alias and replacements.
Return values
arrayreplaced page content and updated $diff parameter as array. static

◆ revstrpos()

static TCPDF_STATIC::revstrpos ( $haystack,
$needle,
$offset = 0 )
static

Find position of last occurrence of a substring in a string.

Parameters
string$haystackThe string to search in.
string$needlesubstring to search.
int$offsetMay be specified to begin searching an arbitrary number of characters into the string.
Return values
int|falseReturns the position where the needle exists. Returns FALSE if the needle was not found.
Since
4.8.038 (2010-03-13) static

◆ rfread()

static TCPDF_STATIC::rfread ( $handle,
$length )
static

Binary-safe and URL-safe file read.

Reads up to length bytes from the file pointer referenced by handle. Reading stops as soon as one of the following conditions is met: length bytes have been read; EOF (end of file) is reached.

Parameters
resource$handle
int$length
Return values
string|falseReturns the read string or FALSE in case of error.
Author
Nicola Asuni
Since
4.5.027 (2009-03-16) static

◆ sendOutputData()

static TCPDF_STATIC::sendOutputData ( $data,
$length )
static

Output input data and compress it if possible.

Parameters
string$dataData to output.
int$lengthData length in bytes.
Since
5.9.086 static

◆ setPageBoxes()

static TCPDF_STATIC::setPageBoxes ( $page,
$type,
$llx,
$lly,
$urx,
$ury,
$points,
$k,
$pagedim = array() )
static

Set page boundaries.

Parameters
int$pagepage number
string$typevalid values are:
  • 'MediaBox' : the boundaries of the physical medium on which the page shall be displayed or printed;
  • 'CropBox' : the visible region of default user space;
  • 'BleedBox' : the region to which the contents of the page shall be clipped when output in a production environment;
  • 'TrimBox' : the intended dimensions of the finished page after trimming;
  • 'ArtBox' : the page's meaningful content (including potential white space).
float$llxlower-left x coordinate in user units.
float$llylower-left y coordinate in user units.
float$urxupper-right x coordinate in user units.
float$uryupper-right y coordinate in user units.
boolean$pointsIf true uses user units as unit of measure, otherwise uses PDF points.
float$kScale factor (number of points in user unit).
array$pagedimArray of page dimensions.
Return values
arraypagedim array of page dimensions.
Since
5.0.010 (2010-05-17) static

◆ swapPageBoxCoordinates()

static TCPDF_STATIC::swapPageBoxCoordinates ( $page,
$pagedim )
static

Swap X and Y coordinates of page boxes (change page boxes orientation).

Parameters
int$pagepage number
array$pagedimArray of page dimensions.
Return values
arraypagedim array of page dimensions.
Since
5.0.010 (2010-05-17) static

◆ url_exists()

static TCPDF_STATIC::url_exists ( $url)
static

Check if the URL exist.

Parameters
string$urlURL to check.
Return values
boolReturns TRUE if the URL exists; FALSE otherwise. static
Since
6.2.25

Member Data Documentation

◆ $alias_group_num_page

TCPDF_STATIC::$alias_group_num_page = '{:png:}'
static

String alias for group page number.

static

◆ $alias_group_tot_pages

TCPDF_STATIC::$alias_group_tot_pages = '{:ptg:}'
static

String alias for total number of pages in a single group.

static

◆ $alias_num_page

TCPDF_STATIC::$alias_num_page = '{:pnp:}'
static

String alias for page number.

static

◆ $alias_right_shift

TCPDF_STATIC::$alias_right_shift = '{rsc:'
static

String alias for right shift compensation used to correctly align page numbers on the right.

static

◆ $alias_tot_pages

TCPDF_STATIC::$alias_tot_pages = '{:ptp:}'
static

String alias for total number of pages.

static

◆ $byterange_string

TCPDF_STATIC::$byterange_string = '/ByteRange[0 ********** ********** **********]'
static

ByteRange placemark used during digital signature process.

Since
4.6.028 (2009-08-25) static

◆ $enc_padding

TCPDF_STATIC::$enc_padding = "\x28\xBF\x4E\x5E\x4E\x75\x8A\x41\x64\x00\x4E\x56\xFF\xFA\x01\x08\x2E\x2E\x00\xB6\xD0\x68\x3E\x80\x2F\x0C\xA9\xFE\x64\x53\x69\x7A"
static

Encryption padding string.

static


The documentation for this class was generated from the following file: