TCPDF_STATIC
class TCPDF_STATIC (View source)
Properties
static | $alias_tot_pages | String alias for total number of pages. |
|
static | $alias_num_page | String alias for page number. |
|
static | $alias_group_tot_pages | String alias for total number of pages in a single group. |
|
static | $alias_group_num_page | String alias for group page number. |
|
static | $alias_right_shift | String alias for right shift compensation used to correctly align page numbers on the right. |
|
static | $enc_padding | Encryption padding string. |
|
static
Since: 4.6.028 (2009-08-25)
|
$byterange_string | ByteRange placemark used during digital signature process. |
|
static | $pageboxes | Array page boxes names |
|
static array<string,float[]> | $page_formats | Array of page formats measures are calculated in this way: (inches 72) or (millimeters 72 / 25.4) |
Methods
Return the current TCPDF version.
Return the current TCPDF producer.
Check if the URL exist.
Removes SHY characters from text.
Get the border mode accounting for multicell position (opens bottom side of multicell crossing pages)
Determine whether a string is empty.
Returns a temporary filename for caching object on filesystem.
Add "\" before "\", "(" and ")"
Escape some special characters (< > &) for XML output.
Creates a copy of a class object
Output input data and compress it if possible.
Replace page number aliases with number.
Returns timestamp in seconds from formatted date-time.
Returns a formatted date-time.
Returns a string containing random data to be used as a seed for encryption methods.
Encrypts a string using MD5 and returns it's value as a binary string.
Returns the input text encrypted using AES algorithm and the specified key.
Returns the input text encrypted using AES algorithm and the specified key.
Returns the input text encrypted using RC4 algorithm and the specified key.
Return the permission code used on encryption (P value).
Convert hexadecimal string to string
Convert string to hexadecimal string (byte string)
Convert encryption P value to a string of bytes, low-order byte first.
Encode a name object.
Convert JavaScript form fields properties array to Annotation Properties array.
Format the page numbers.
Format the page numbers on the Table Of Content.
Extracts the CSS properties from a CSS string.
Cleanup HTML code (requires HTML Tidy library).
Returns true if the CSS selector is valid for the selected HTML tag
Returns the styles array that apply for the selected HTML tag.
Compact CSS data array into single string.
Returns the Roman representation of an integer number
Find position of last occurrence of a substring in a string
Returns an array of hyphenation patterns.
Get the Path-Painting Operators.
Get the product of two SVG tranformation matrices
Get the tranformation matrix from SVG transform attribute
Returns the angle in radiants between two vectors
Split string by a regular expression.
Wrapper to use fopen only with local files
Check if the URL exist.
Encode query params in URL
Wrapper for file_exists.
Reads entire file into a string.
Get ULONG from string (Big Endian 32-bit unsigned integer).
Get USHORT from string (Big Endian 16-bit unsigned integer).
Get SHORT from string (Big Endian 16-bit signed integer).
Get FWORD from string (Big Endian 16-bit signed integer).
Get UFWORD from string (Big Endian 16-bit unsigned integer).
Get FIXED from string (32-bit signed fixed-point number (16.16).
Get BYTE from string (8-bit unsigned integer).
Binary-safe and URL-safe file read.
Read a 4-byte (32 bit) integer from file.
Get page dimensions from format name.
Set page boundaries.
Swap X and Y coordinates of page boxes (change page boxes orientation).
Get the canonical page layout mode.
Get the canonical page layout mode.
Details
static string
getTCPDFVersion()
Return the current TCPDF version.
static string
getTCPDFProducer()
Return the current TCPDF producer.
static bool
isValidURL(string $url)
Check if the URL exist.
static string
removeSHY(string $txt = '', bool $unicode = true)
Removes SHY characters from text.
Unicode Data:
- Name : SOFT HYPHEN, commonly abbreviated as SHY
- HTML Entity (decimal): "­"
- HTML Entity (hex): "­"
- HTML Entity (named): "­"
- How to type in Microsoft Windows: [Alt +00AD] or [Alt 0173]
- UTF-8 (hex): 0xC2 0xAD (c2ad)
- UTF-8 character: chr(194).chr(173)
static array
getBorderMode(string|array|int $brd, string $position = 'start', bool $opencell = true)
Get the border mode accounting for multicell position (opens bottom side of multicell crossing pages)
static bool
empty_string(string $str)
Determine whether a string is empty.
static string
getObjFilename(string $type = 'tmp', string $file_id = '')
Returns a temporary filename for caching object on filesystem.
static string
_escape(string $s)
Add "\" before "\", "(" and ")"
static string
_escapeXML(string $str)
Escape some special characters (< > &) for XML output.
static object
objclone(object $object)
Creates a copy of a class object
static
sendOutputData(string $data, int $length)
Output input data and compress it if possible.
static array
replacePageNumAliases(string $page, array $replace, int $diff = 0)
Replace page number aliases with number.
static int
getTimestamp(string $date)
Returns timestamp in seconds from formatted date-time.
static string
getFormattedDate(int $time)
Returns a formatted date-time.
static string
getRandomSeed(string $seed = '')
Returns a string containing random data to be used as a seed for encryption methods.
static string
_md5_16(string $str)
Encrypts a string using MD5 and returns it's value as a binary string.
static string
_AES(string $key, string $text)
Returns the input text encrypted using AES algorithm and the specified key.
This method requires openssl or mcrypt. Text is padded to 16bytes blocks
static string
_AESnopad(string $key, string $text)
Returns the input text encrypted using AES algorithm and the specified key.
This method requires openssl or mcrypt. Text is not padded
static string
_RC4(string $key, string $text, string $last_enc_key, string $last_enc_key_c)
Returns the input text encrypted using RC4 algorithm and the specified key.
RC4 is the standard encryption algorithm used in PDF format
static
getUserPermissionCode(array $permissions, int $mode = 0)
Return the permission code used on encryption (P value).
static string
convertHexStringToString(string $bs)
Convert hexadecimal string to string
static string
convertStringToHexString(string $s)
Convert string to hexadecimal string (byte string)
static string
getEncPermissionsString(string $protection)
Convert encryption P value to a string of bytes, low-order byte first.
static string
encodeNameObject(string $name)
Encode a name object.
static array
getAnnotOptFromJSProp(array $prop, array $spot_colors, bool $rtl = false)
Convert JavaScript form fields properties array to Annotation Properties array.
static string
formatPageNumber(int $num)
Format the page numbers.
This method can be overridden for custom formats.
static string
formatTOCPageNumber(int $num)
Format the page numbers on the Table Of Content.
This method can be overridden for custom formats.
static array
extractCSSproperties(string $cssdata)
Extracts the CSS properties from a CSS string.
static string
fixHTMLCode(string $html, string $default_css, array|null $tagvs, array|null $tidy_options, array $tagvspaces)
Cleanup HTML code (requires HTML Tidy library).
static true
isValidCSSSelectorForTag(array $dom, int $key, string $selector)
Returns true if the CSS selector is valid for the selected HTML tag
static array
getCSSdataArray(array $dom, int $key, array $css)
Returns the styles array that apply for the selected HTML tag.
static string
getTagStyleFromCSSarray(array $css)
Compact CSS data array into single string.
static string
intToRoman(int $number)
Returns the Roman representation of an integer number
static int|false
revstrpos(string $haystack, string $needle, int $offset = 0)
Find position of last occurrence of a substring in a string
static array
getHyphenPatternsFromTEX(string $file)
Returns an array of hyphenation patterns.
static string
getPathPaintOperator(string $style, string $default = 'S')
Get the Path-Painting Operators.
static array
getTransformationMatrixProduct(array $ta, array $tb)
Get the product of two SVG tranformation matrices
static array
getSVGTransformMatrix(string $attribute)
Get the tranformation matrix from SVG transform attribute
static
getVectorsAngle(int $x1, int $y1, int $x2, int $y2)
Returns the angle in radiants between two vectors
static array
pregSplit(string $pattern, string $modifiers, string $subject, int $limit = NULL, int $flags = NULL)
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
static resource|false
fopenLocal(string $filename, string $mode)
Wrapper to use fopen only with local files
static bool
url_exists(string $url)
Check if the URL exist.
static string
encodeUrlQuery(string $url)
Encode query params in URL
static bool
file_exists(string $filename)
Wrapper for file_exists.
Checks whether a file or directory exists. Only allows some protocols and local files.
static string|false
fileGetContents(string $file)
Reads entire file into a string.
The file can be also an URL.
static int
_getULONG(string $str, int $offset)
Get ULONG from string (Big Endian 32-bit unsigned integer).
static int
_getUSHORT(string $str, int $offset)
Get USHORT from string (Big Endian 16-bit unsigned integer).
static int
_getSHORT(string $str, int $offset)
Get SHORT from string (Big Endian 16-bit signed integer).
static int
_getFWORD(string $str, int $offset)
Get FWORD from string (Big Endian 16-bit signed integer).
static int
_getUFWORD(string $str, int $offset)
Get UFWORD from string (Big Endian 16-bit unsigned integer).
static int
_getFIXED(string $str, int $offset)
Get FIXED from string (32-bit signed fixed-point number (16.16).
static int
_getBYTE(string $str, int $offset)
Get BYTE from string (8-bit unsigned integer).
static string|false
rfread(resource $handle, int $length)
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.
static int
_freadint(resource $f)
Read a 4-byte (32 bit) integer from file.
static array
getPageSizeFromFormat(mixed $format)
Get page dimensions from format name.
static array
setPageBoxes(int $page, string $type, float $llx, float $lly, float $urx, float $ury, bool $points, float $k, array $pagedim = array())
Set page boundaries.
static array
swapPageBoxCoordinates(int $page, array $pagedim)
Swap X and Y coordinates of page boxes (change page boxes orientation).
static string
getPageLayoutMode(string $layout = 'SinglePage')
Get the canonical page layout mode.
static string
getPageMode(string $mode = 'UseNone')
Get the canonical page layout mode.