classes-Com-Tecnick-Pdf-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.

Com\Tecnick\Pdf\Tcpdf

Tcpdf PDF class

Tags
since
2002-08-03
category

Library

author

Nicola Asuni info@tecnick.com

copyright

2002-2017 Nicola Asuni - Tecnick.com LTD

license

http://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE.TXT)

link
https://github.com/tecnickcom/tc-lib-pdf

Table of Contents

$barcode  : Barcode
Barcode object
$cache  : Cache
Cache object
$color  : Pdf
Color object
$encrypt  : Encrypt
Encrypt object
$file  : File
File object
$font  : Stack
Font object
$graph  : Draw
Graph object
$image  : Import
Image Import object
$page  : Page
Page object
$pon  : int
Current PDF object number.
$uniconv  : Convert
Unicode Convert object
$author  : string
The name of the person who created the document.
$byterange  : string
ByteRange placemark used during digital signature process.
$compress  : int
Enable stream compression.
$creator  : string
The name of the application that generates the PDF.
$custom_xmp  : string
Additional XMP data to be appended just before the end of "x:xmpmeta" tag.
$custom_xmp_rdf  : string
Additional XMP RDF data to be appended just before the end of "rdf:RDF" tag.
$display  : string
Defines the way the document is to be displayed by the viewer.
$docmodtime  : int
Time is seconds since EPOCH when the document was modified.
$doctime  : int
Time is seconds since EPOCH when the document was created.
$embeddedfiles  : array<string|int, mixed>
Embedded files data.
$encoding  : string
Document encoding.
$fileid  : string
Document ID.
$isunicode  : bool
True for Unicode font mode.
$keywords  : string
Space-separated list of keywords associated with the document.
$kunit  : float
Unit of measure conversion ratio.
$objid  : array<string|int, mixed>
Array containing the ID of some named PDF objects.
$pdfa  : int
Version of the PDF/A mode or 0 otherwise.
$pdfver  : string
PDF version.
$pdfx  : bool
True if we are in PDF/X mode.
$rtl  : mixed
Boolean flag to set the default document language direction.
$sigapp  : bool
True if the signature approval is enabled (for incremental updates).
$sigmaxlen  : int
Digital signature max length.
$sign  : bool
True if the document is signed.
$spaceregexp  : array<string|int, mixed>
Array containing the regular expression used to identify withespaces or word separators.
$sRGB  : bool
Set this to TRUE to add the default sRGB ICC color profile
$subject  : string
Subject of the document.
$subsetfont  : bool
True to subset the fonts.
$title  : string
Title of the document.
$unit  : string
Unit of measure.
$valid_zoom  : array<string|int, mixed>
Valid document zoom modes
$version  : string
TCPDF version.
$viewerpref  : array<string|int, mixed>
Viewer preferences dictionary controlling the way the document is to be presented on the screen or in print.
$xobject  : array<string|int, mixed>
Store XObject.
__construct()  : mixed
Initialize a new PDF object.
getBarcode()  : string
Get a barcode PDF code.
getOutPDFString()  : string
Returns the RAW PDF string.
getVersion()  : string
Return the program version.
setAuthor()  : mixed
Defines the author of the document.
setCreator()  : mixed
Defines the creator of the document.
setDisplayMode()  : mixed
Defines the way the document is to be displayed by the viewer.
setExtraXMP()  : mixed
Set additional XMP data to be appended just before the end of "x:xmpmeta" tag.
setExtraXMPRDF()  : mixed
Set additional XMP data to be appended just before the end of "rdf:RDF" tag.
setKeywords()  : mixed
Associates keywords with the document, generally in the form 'keyword1 keyword2 ...'.
setPDFVersion()  : mixed
Set the PDF version (check PDF reference for valid values).
setRTL()  : mixed
Set the default document language direction.
setSpaceRegexp()  : mixed
Set regular expression to detect withespaces or word separators.
setSRGB()  : mixed
Set the sRGB mode
setSubject()  : mixed
Defines the subject of the document.
setTitle()  : mixed
Defines the title of the document.
setViewerPreferences()  : mixed
Set the viewer preferences dictionary controlling the way the document is to be presented on the screen or in print.
applySignatureTimestamp()  : string
-- NOT YET IMPLEMENTED -- Add TSA timestamp to the signature.
enableSignatureApproval()  : mixed
Enable or disable the the Signature Approval
getAnnotationAppearanceStream()  : string
Returns the Annotation code for Appearance Stream.
getAnnotationBorder()  : string
Returns the Annotation code for Borders.
getAnnotationFlagsCode()  : int
Returns the Annotation Flags code.
getAnnotationRadiobuttonGroups()  : string
Returns the Annotation code for Radio buttons.
getBooleanMode()  : string
Returns the Viewer Preference boolean entry.
getColorStringFromArray()  : string
Convert a color array into a string representation for annotations.
getDuplexMode()  : string
Returns the Duplex mode for the Viewer Preferences
getEscapedXML()  : string
Escape some special characters (&lt; &gt; &amp;) for XML output.
getFormattedDate()  : string
Returns a formatted date for meta information
getLayerDic()  : string
Get the PDF output string for Layer resources dictionary.
getOnOff()  : string
Returns 'ON' if $val is true, 'OFF' otherwise.
getOutAnnotationFlags()  : string
Returns the Annotation code for Flags.
getOutAnnotationMarkups()  : string
Returns the Annotation code for Makups.
getOutAnnotationOptSubtype()  : string
Returns the output code associated with the annotation opt.subtype.
getOutAnnotationOptSubtype3D()  : string
Returns the output code associated with the annotation opt.subtype.3d.
getOutAnnotationOptSubtypeCaret()  : string
Returns the output code associated with the annotation opt.subtype.caret.
getOutAnnotationOptSubtypeCircle()  : string
Returns the output code associated with the annotation opt.subtype.circle.
getOutAnnotationOptSubtypeFileattachment()  : string
Returns the output code associated with the annotation opt.subtype.fileattachment.
getOutAnnotationOptSubtypeFreetext()  : string
Returns the output code associated with the annotation opt.subtype.freetext.
getOutAnnotationOptSubtypeHighlight()  : string
Returns the output code associated with the annotation opt.subtype.highlight.
getOutAnnotationOptSubtypeInk()  : string
Returns the output code associated with the annotation opt.subtype.ink.
getOutAnnotationOptSubtypeLine()  : string
Returns the output code associated with the annotation opt.subtype.line.
getOutAnnotationOptSubtypeLink()  : string
Returns the output code associated with the annotation opt.subtype.link.
getOutAnnotationOptSubtypeMovie()  : string
Returns the output code associated with the annotation opt.subtype.movie.
getOutAnnotationOptSubtypePolygon()  : string
Returns the output code associated with the annotation opt.subtype.polygon.
getOutAnnotationOptSubtypePolyline()  : string
Returns the output code associated with the annotation opt.subtype.polyline.
getOutAnnotationOptSubtypePopup()  : string
Returns the output code associated with the annotation opt.subtype.popup.
getOutAnnotationOptSubtypePrintermark()  : string
Returns the output code associated with the annotation opt.subtype.printermark.
getOutAnnotationOptSubtypeScreen()  : string
Returns the output code associated with the annotation opt.subtype.screen.
getOutAnnotationOptSubtypeSound()  : string
Returns the output code associated with the annotation opt.subtype.sound.
getOutAnnotationOptSubtypeSquare()  : string
Returns the output code associated with the annotation opt.subtype.square.
getOutAnnotationOptSubtypeSquiggly()  : string
Returns the output code associated with the annotation opt.subtype.squiggly.
getOutAnnotationOptSubtypeStamp()  : string
Returns the output code associated with the annotation opt.subtype.stamp.
getOutAnnotationOptSubtypeStrikeout()  : string
Returns the output code associated with the annotation opt.subtype.strikeout.
getOutAnnotationOptSubtypeText()  : string
Returns the output code associated with the annotation opt.subtype.text.
getOutAnnotationOptSubtypeTrapnet()  : string
Returns the output code associated with the annotation opt.subtype.trapnet.
getOutAnnotationOptSubtypeUnderline()  : string
Returns the output code associated with the annotation opt.subtype.
getOutAnnotationOptSubtypeWatermark()  : string
Returns the output code associated with the annotation opt.subtype.watermark.
getOutAnnotationOptSubtypeWidget()  : string
Returns the output code associated with the annotation opt.subtype.widget.
getOutAnnotations()  : string
Returns the PDF Annotations entry.
getOutAPXObjects()  : int
Returns the PDF Annotation code for Apearance Stream XObjects entry.
getOutBookmarks()  : string
Returns the PDF Bookmarks entry.
getOutCatalog()  : string
Returns the PDF Catalog entry.
getOutDateTimeString()  : string
Returns a formatted date for meta information
getOutDestinations()  : string
Returns the PDF Destinations entry.
getOutEmbeddedFiles()  : string
Returns the PDF Embedded Files entry.
getOutFontDic()  : string
Get the PDF output string for Font resources dictionary.
getOutICC()  : string
Returns the PDF object to include a standard sRGB_IEC61966-2.1 blackscaled ICC colour profile.
getOutJavascript()  : string
Returns the PDF Javascript entry.
getOutMetaInfo()  : string
Get the PDF output string for the Document Information Dictionary.
getOutOCG()  : string
Returns the PDF OCG entry.
getOutPDFBody()  : string
Returns the raw PDF Body section.
getOutPDFHeader()  : string
Returns the PDF document header.
getOutPDFTrailer()  : string
Returns the PDF Trailer section.
getOutPDFXref()  : string
Returns the PDF XREF section.
getOutputIntents()  : string
Set OutputIntents.
getOutputIntentsPdfX()  : string
Get OutputIntents for PDF-X if required.
getOutputIntentsSrgb()  : string
Get OutputIntents for sRGB IEC61966-2.1 if required.
getOutResourcesDict()  : string
Returns the PDF Resources Dictionary entry.
getOutSignature()  : string
Returns the PDF signarure entry.
getOutSignatureDocMDP()  : string
Returns the PDF signarure entry.
getOutSignatureFields()  : string
Returns the PDF Signature Fields entry.
getOutSignatureInfo()  : string
Returns the PDF signarure info section.
getOutSignatureUserRights()  : string
Returns the PDF signarure entry.
getOutTextString()  : string
Format a text string for output.
getOutViewerPref()  : string
Returns the PDF viewer preferences for the catalog section
getOutXMP()  : string
Get the PDF output string for the XMP data object
getOutXObjects()  : string
Returns the PDF XObjects entry.
getPageBoxName()  : string
Sanitize the page box name and return the default 'CropBox' in case of error.
getPagePrintScaling()  : string
Sanitize the page box name and return the default 'CropBox' in case of error.
getPDFLayers()  : string
Get the PDF layers.
getPDFObjectOffsets()  : array<string|int, mixed>
Returns the ordered offset array for each object.
getProducer()  : string
Returns the producer string
getXMPFormattedDate()  : string
Returns a formatted date for XMP meta information
getXObjectDic()  : string
Get the PDF output string for XObject resources dictionary.
initClassObjects()  : mixed
Initialize class objects
processPrevNextBookmarks()  : int
Process the bookmarks to get the previous and next one.
setCompressMode()  : mixed
Set the compression mode.
setDecimalSeparator()  : mixed
Set the decimal separator.
setPDFMode()  : mixed
Set the pdf mode.
setUnicodeMode()  : mixed
Set the decimal separator.
signDocument()  : string
Sign the document.
sortBookmarks()  : mixed
Sort bookmarks by page and original position.
unhtmlentities()  : string
Reverse function for htmlentities.
setNonEmptyFieldValue()  : mixed
Set a field value only if it is not empty.

Properties

$pon

Current PDF object number.

public int $pon = 0

$author

The name of the person who created the document.

protected string $author = 'TCPDF'

$byterange

ByteRange placemark used during digital signature process.

protected static string $byterange = '/ByteRange[0 ********** ********** **********]'

$compress

Enable stream compression.

protected int $compress = true

$creator

The name of the application that generates the PDF.

protected string $creator = 'TCPDF'

If the document was converted to PDF from another format, the name of the conforming product that created the original document from which it was converted.

$custom_xmp

Additional XMP data to be appended just before the end of "x:xmpmeta" tag.

protected string $custom_xmp = ''

$custom_xmp_rdf

Additional XMP RDF data to be appended just before the end of "rdf:RDF" tag.

protected string $custom_xmp_rdf = ''

$display

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

protected string $display = array('zoom' => 'default', 'layout' => 'SinglePage', 'mode' => 'UseNone')

$docmodtime

Time is seconds since EPOCH when the document was modified.

protected int $docmodtime = 0

$doctime

Time is seconds since EPOCH when the document was created.

protected int $doctime = 0

$embeddedfiles

Embedded files data.

protected array<string|int, mixed> $embeddedfiles = array()

$encoding

Document encoding.

protected string $encoding = 'UTF-8'

$fileid

Document ID.

protected string $fileid

$isunicode

True for Unicode font mode.

protected bool $isunicode = true

$keywords

Space-separated list of keywords associated with the document.

protected string $keywords = 'TCPDF'

$kunit

Unit of measure conversion ratio.

protected float $kunit = 1.0

$objid

Array containing the ID of some named PDF objects.

protected array<string|int, mixed> $objid = array()

$pdfa

Version of the PDF/A mode or 0 otherwise.

protected int $pdfa = 0

$pdfver

PDF version.

protected string $pdfver = '1.7'

$pdfx

True if we are in PDF/X mode.

protected bool $pdfx = false

$rtl

Boolean flag to set the default document language direction.

protected mixed $rtl = false

False = LTR = Left-To-Right. True = RTL = Right-To-Left.

Tags
val

bool

$sigapp

True if the signature approval is enabled (for incremental updates).

protected bool $sigapp = false

$sigmaxlen

Digital signature max length.

protected static int $sigmaxlen = 11742

$sign

True if the document is signed.

protected bool $sign = false

$spaceregexp

Array containing the regular expression used to identify withespaces or word separators.

protected array<string|int, mixed> $spaceregexp = array('r' => '/[^\\S\\xa0]/', 'p' => '[^\\S\\xa0]', 'm' => '')

$sRGB

Set this to TRUE to add the default sRGB ICC color profile

protected bool $sRGB = false

$subject

Subject of the document.

protected string $subject = '-'

$subsetfont

True to subset the fonts.

protected bool $subsetfont = false

$title

Title of the document.

protected string $title = 'PDF Document'

$unit

Unit of measure.

protected string $unit = 'mm'

$valid_zoom

Valid document zoom modes

protected static array<string|int, mixed> $valid_zoom = array('fullpage', 'fullwidth', 'real', 'default')

$version

TCPDF version.

protected string $version = '8.0.20'

$viewerpref

Viewer preferences dictionary controlling the way the document is to be presented on the screen or in print.

protected array<string|int, mixed> $viewerpref = array()

(Section 8.1 of PDF reference, "Viewer Preferences").

$xobject

Store XObject.

protected array<string|int, mixed> $xobject = array()

Methods

__construct()

Initialize a new PDF object.

public __construct([string $unit = 'mm' ][, bool $isunicode = true ][, bool $subsetfont = false ][, bool $compress = true ][, string $mode = '' ][, Encrypt $encobj = null ]) : mixed
Parameters
$unit : string = 'mm'

Unit of measure ('pt', 'mm', 'cm', 'in').

$isunicode : bool = true

True if the document is in Unicode mode.

$subsetfont : bool = false

If true subset the embedded fonts to remove the unused characters.

$compress : bool = true

Set to false to disable stream compression.

$mode : string = ''

PDF mode: "pdfa1", "pdfa2", "pdfa3", "pdfx" or empty.

$encobj : Encrypt = null

Encryption object.

Return values
mixed

getBarcode()

Get a barcode PDF code.

public getBarcode(string $type, string $code, float $posx, float $posy[, int $width = -1 ][, int $height = -1 ][, array<string|int, mixed> $padding = array(0, 0, 0, 0) ][, array<string|int, mixed> $style = array() ]) : string
Parameters
$type : string

Barcode type.

$code : string

Barcode content.

$posx : float

Abscissa of upper-left corner.

$posy : float

Ordinate of upper-left corner.

$width : int = -1

Barcode width in user units (excluding padding). A negative value indicates the multiplication factor for each column.

$height : int = -1

Barcode height in user units (excluding padding). A negative value indicates the multiplication factor for each row.

$padding : array<string|int, mixed> = array(0, 0, 0, 0)

Additional padding to add around the barcode (top, right, bottom, left) in user units. A negative value indicates the multiplication factor for each row or column.

$style : array<string|int, mixed> = array()
Tags
throws
BarcodeException

in case of error

Return values
string

getOutPDFString()

Returns the RAW PDF string.

public getOutPDFString() : string
Return values
string

getVersion()

Return the program version.

public getVersion() : string
Return values
string

setAuthor()

Defines the author of the document.

public setAuthor(string $author) : mixed
Parameters
$author : string

The name of the author.

Return values
mixed

setCreator()

Defines the creator of the document.

public setCreator(string $creator) : mixed

This is typically the name of the application that generates the PDF.

Parameters
$creator : string

The name of the creator.

Return values
mixed

setDisplayMode()

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

public setDisplayMode([mixed $zoom = 'default' ][, string $layout = 'SinglePage' ][, string $mode = 'UseNone' ]) : mixed
Parameters
$zoom : mixed = 'default'

The zoom to use. It can be one of the following string values or a number indicating the zooming factor to use.

  • fullpage: displays the entire page on screen
  • fullwidth: uses maximum width of window
  • real: uses real size (equivalent to 100% zoom)
  • default: uses viewer default mode
$layout : string = 'SinglePage'

The 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 Display the pages two at a time, with odd-numbered pages on the left
  • TwoPageRight Display the pages two at a time, with odd-numbered pages on the right
$mode : string = 'UseNone'

A 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, 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
mixed

setExtraXMP()

Set additional XMP data to be appended just before the end of "x:xmpmeta" tag.

public setExtraXMP(string $xmp) : mixed

IMPORTANT: This data is added as-is without controls, so you have to validate your data before using this method.

Parameters
$xmp : string

Custom XMP data.

Return values
mixed

setExtraXMPRDF()

Set additional XMP data to be appended just before the end of "rdf:RDF" tag.

public setExtraXMPRDF(string $xmp) : mixed

IMPORTANT: This data is added as-is without controls, so you have to validate your data before using this method.

Parameters
$xmp : string

Custom XMP data.

Return values
mixed

setKeywords()

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

public setKeywords(string $keywords) : mixed
Parameters
$keywords : string

Space-separated list of keywords.

Return values
mixed

setPDFVersion()

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

public setPDFVersion([string $version = '1.7' ]) : mixed
Parameters
$version : string = '1.7'

PDF document version.

Tags
throws
PdfException

in case of error.

Return values
mixed

setRTL()

Set the default document language direction.

public setRTL(bool $enabled) : mixed
Parameters
$enabled : bool

False = LTR = Left-To-Right; True = RTL = Right-To-Left.

Return values
mixed

setSpaceRegexp()

Set regular expression to detect withespaces or word separators.

public setSpaceRegexp([string $regexp = '/[^\S\xa0]/' ]) : mixed

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.
     \xa0   : Unicode Character 'NO-BREAK SPACE' (U+00A0)
Parameters
$regexp : string = '/[^\S\xa0]/'

regular expression (leave empty for default).

Return values
mixed

setSRGB()

Set the sRGB mode

public setSRGB(bool $enabled) : mixed
Parameters
$enabled : bool

Set to true to add the default sRGB ICC color profile

Return values
mixed

setSubject()

Defines the subject of the document.

public setSubject(string $subject) : mixed
Parameters
$subject : string

The subject.

Return values
mixed

setTitle()

Defines the title of the document.

public setTitle(string $title) : mixed
Parameters
$title : string

The title.

Return values
mixed

setViewerPreferences()

Set the viewer preferences dictionary controlling the way the document is to be presented on the screen or in print.

public setViewerPreferences(array<string|int, mixed> $pref) : mixed
Parameters
$pref : array<string|int, mixed>

Array of options (see Section 12.2 of PDF reference, "Viewer Preferences").

Return values
mixed

applySignatureTimestamp()

-- NOT YET IMPLEMENTED -- Add TSA timestamp to the signature.

protected applySignatureTimestamp(string $signature) : string
Parameters
$signature : string

Digital signature as binary string

Return values
string

enableSignatureApproval()

Enable or disable the the Signature Approval

protected enableSignatureApproval([bool $enabled = true ]) : mixed
Parameters
$enabled : bool = true

It true enable the Signature Approval

Return values
mixed

getAnnotationAppearanceStream()

Returns the Annotation code for Appearance Stream.

protected getAnnotationAppearanceStream(mixed $annot, int $width, int $height) : string
Parameters
$annot : mixed
$width : int

Annotation width.

$height : int

Annotation height.

Tags
params

array $annot Array containing page annotations.

Return values
string

getAnnotationBorder()

Returns the Annotation code for Borders.

protected getAnnotationBorder(mixed $annot) : string
Parameters
$annot : mixed
Tags
params

array $annot Array containing page annotations.

Return values
string

getAnnotationFlagsCode()

Returns the Annotation Flags code.

protected getAnnotationFlagsCode(mixed $flags) : int
Parameters
$flags : mixed
Tags
params

array|int $flags Annotation flags.

Return values
int

getAnnotationRadiobuttonGroups()

Returns the Annotation code for Radio buttons.

protected getAnnotationRadiobuttonGroups(mixed $annot) : string
Parameters
$annot : mixed
Tags
params

array $annot Array containing page annotations.

Return values
string

getBooleanMode()

Returns the Viewer Preference boolean entry.

protected getBooleanMode(string $name) : string
Parameters
$name : string

Entry name.

Return values
string

getColorStringFromArray()

Convert a color array into a string representation for annotations.

protected static getColorStringFromArray(array<string|int, mixed> $colors) : string

The number of array elements determines the colour space in which the colour shall be defined: 0 No colour; transparent 1 DeviceGray 3 DeviceRGB 4 DeviceCMYK

Parameters
$colors : array<string|int, mixed>

Array of colors.

Return values
string

getDuplexMode()

Returns the Duplex mode for the Viewer Preferences

protected getDuplexMode() : string
Return values
string

getEscapedXML()

Escape some special characters (&lt; &gt; &amp;) for XML output.

protected getEscapedXML(string $str) : string
Parameters
$str : string

Input string to escape.

Return values
string

getFormattedDate()

Returns a formatted date for meta information

protected getFormattedDate(int $time) : string
Parameters
$time : int

Time in seconds.

Return values
string

date-time string.

getLayerDic()

Get the PDF output string for Layer resources dictionary.

protected getLayerDic() : string
Return values
string

getOnOff()

Returns 'ON' if $val is true, 'OFF' otherwise.

protected getOnOff(mixed $val) : string
Parameters
$val : mixed

Item to parse for boolean value.

Return values
string

getOutAnnotationFlags()

Returns the Annotation code for Flags.

protected getOutAnnotationFlags(mixed $annot) : string
Parameters
$annot : mixed
Tags
params

array $annot Array containing page annotations.

Return values
string

getOutAnnotationMarkups()

Returns the Annotation code for Makups.

protected getOutAnnotationMarkups(mixed $annot, mixed $oid) : string
Parameters
$annot : mixed
$oid : mixed
Tags
params

array $annot Array containing page annotations.

params

int $oid Annotation Object ID.

Return values
string

getOutAnnotationOptSubtype()

Returns the output code associated with the annotation opt.subtype.

protected getOutAnnotationOptSubtype(mixed $annot, mixed $pagenum, mixed $oid, mixed $key) : string
Parameters
$annot : mixed
$pagenum : mixed
$oid : mixed
$key : mixed
Tags
params

array $annot Array containing page annotations.

params

int $pagenum Page number.

params

int $oid Annotation Object ID.

params

int $key Annotation index in the current page.

Return values
string

getOutAnnotationOptSubtype3D()

Returns the output code associated with the annotation opt.subtype.3d.

protected getOutAnnotationOptSubtype3D(mixed $annot) : string
Parameters
$annot : mixed
Tags
params

array $annot Array containing page annotations.

Return values
string

getOutAnnotationOptSubtypeCaret()

Returns the output code associated with the annotation opt.subtype.caret.

protected getOutAnnotationOptSubtypeCaret(mixed $annot) : string
Parameters
$annot : mixed
Tags
params

array $annot Array containing page annotations.

Return values
string

getOutAnnotationOptSubtypeCircle()

Returns the output code associated with the annotation opt.subtype.circle.

protected getOutAnnotationOptSubtypeCircle(mixed $annot) : string
Parameters
$annot : mixed
Tags
params

array $annot Array containing page annotations.

Return values
string

getOutAnnotationOptSubtypeFileattachment()

Returns the output code associated with the annotation opt.subtype.fileattachment.

protected getOutAnnotationOptSubtypeFileattachment(mixed $annot, mixed $key) : string
Parameters
$annot : mixed
$key : mixed
Tags
params

array $annot Array containing page annotations.

params

int $key Annotation index in the current page.

Return values
string

getOutAnnotationOptSubtypeFreetext()

Returns the output code associated with the annotation opt.subtype.freetext.

protected getOutAnnotationOptSubtypeFreetext(mixed $annot) : string
Parameters
$annot : mixed
Tags
params

array $annot Array containing page annotations.

Return values
string

getOutAnnotationOptSubtypeHighlight()

Returns the output code associated with the annotation opt.subtype.highlight.

protected getOutAnnotationOptSubtypeHighlight(mixed $annot) : string
Parameters
$annot : mixed
Tags
params

array $annot Array containing page annotations.

Return values
string

getOutAnnotationOptSubtypeInk()

Returns the output code associated with the annotation opt.subtype.ink.

protected getOutAnnotationOptSubtypeInk(mixed $annot) : string
Parameters
$annot : mixed
Tags
params

array $annot Array containing page annotations.

Return values
string

getOutAnnotationOptSubtypeLine()

Returns the output code associated with the annotation opt.subtype.line.

protected getOutAnnotationOptSubtypeLine(mixed $annot) : string
Parameters
$annot : mixed
Tags
params

array $annot Array containing page annotations.

Return values
string

Returns the output code associated with the annotation opt.subtype.link.

protected getOutAnnotationOptSubtypeLink(mixed $annot, mixed $pagenum, mixed $oid) : string
Parameters
$annot : mixed
$pagenum : mixed
$oid : mixed
Tags
params

array $annot Array containing page annotations.

params

int $pagenum Page number.

params

int $oid Annotation Object ID.

Return values
string

getOutAnnotationOptSubtypeMovie()

Returns the output code associated with the annotation opt.subtype.movie.

protected getOutAnnotationOptSubtypeMovie(mixed $annot) : string
Parameters
$annot : mixed
Tags
params

array $annot Array containing page annotations.

Return values
string

getOutAnnotationOptSubtypePolygon()

Returns the output code associated with the annotation opt.subtype.polygon.

protected getOutAnnotationOptSubtypePolygon(mixed $annot) : string
Parameters
$annot : mixed
Tags
params

array $annot Array containing page annotations.

Return values
string

getOutAnnotationOptSubtypePolyline()

Returns the output code associated with the annotation opt.subtype.polyline.

protected getOutAnnotationOptSubtypePolyline(mixed $annot) : string
Parameters
$annot : mixed
Tags
params

array $annot Array containing page annotations.

Return values
string

getOutAnnotationOptSubtypePopup()

Returns the output code associated with the annotation opt.subtype.popup.

protected getOutAnnotationOptSubtypePopup(mixed $annot) : string
Parameters
$annot : mixed
Tags
params

array $annot Array containing page annotations.

Return values
string

getOutAnnotationOptSubtypePrintermark()

Returns the output code associated with the annotation opt.subtype.printermark.

protected getOutAnnotationOptSubtypePrintermark(mixed $annot) : string
Parameters
$annot : mixed
Tags
params

array $annot Array containing page annotations.

Return values
string

getOutAnnotationOptSubtypeScreen()

Returns the output code associated with the annotation opt.subtype.screen.

protected getOutAnnotationOptSubtypeScreen(mixed $annot) : string
Parameters
$annot : mixed
Tags
params

array $annot Array containing page annotations.

Return values
string

getOutAnnotationOptSubtypeSound()

Returns the output code associated with the annotation opt.subtype.sound.

protected getOutAnnotationOptSubtypeSound(mixed $annot) : string
Parameters
$annot : mixed
Tags
params

array $annot Array containing page annotations.

Return values
string

getOutAnnotationOptSubtypeSquare()

Returns the output code associated with the annotation opt.subtype.square.

protected getOutAnnotationOptSubtypeSquare(mixed $annot) : string
Parameters
$annot : mixed
Tags
params

array $annot Array containing page annotations.

Return values
string

getOutAnnotationOptSubtypeSquiggly()

Returns the output code associated with the annotation opt.subtype.squiggly.

protected getOutAnnotationOptSubtypeSquiggly(mixed $annot) : string
Parameters
$annot : mixed
Tags
params

array $annot Array containing page annotations.

Return values
string

getOutAnnotationOptSubtypeStamp()

Returns the output code associated with the annotation opt.subtype.stamp.

protected getOutAnnotationOptSubtypeStamp(mixed $annot) : string
Parameters
$annot : mixed
Tags
params

array $annot Array containing page annotations.

Return values
string

getOutAnnotationOptSubtypeStrikeout()

Returns the output code associated with the annotation opt.subtype.strikeout.

protected getOutAnnotationOptSubtypeStrikeout(mixed $annot) : string
Parameters
$annot : mixed
Tags
params

array $annot Array containing page annotations.

Return values
string

getOutAnnotationOptSubtypeText()

Returns the output code associated with the annotation opt.subtype.text.

protected getOutAnnotationOptSubtypeText(mixed $annot) : string
Parameters
$annot : mixed
Tags
params

array $annot Array containing page annotations.

Return values
string

getOutAnnotationOptSubtypeTrapnet()

Returns the output code associated with the annotation opt.subtype.trapnet.

protected getOutAnnotationOptSubtypeTrapnet(mixed $annot) : string
Parameters
$annot : mixed
Tags
params

array $annot Array containing page annotations.

Return values
string

getOutAnnotationOptSubtypeUnderline()

Returns the output code associated with the annotation opt.subtype.

protected getOutAnnotationOptSubtypeUnderline(mixed $annot) : string
Parameters
$annot : mixed
Tags
params

array $annot Array containing page annotations.

Return values
string

getOutAnnotationOptSubtypeWatermark()

Returns the output code associated with the annotation opt.subtype.watermark.

protected getOutAnnotationOptSubtypeWatermark(mixed $annot) : string
Parameters
$annot : mixed
Tags
params

array $annot Array containing page annotations.

Return values
string

getOutAnnotationOptSubtypeWidget()

Returns the output code associated with the annotation opt.subtype.widget.

protected getOutAnnotationOptSubtypeWidget(mixed $annot, mixed $oid) : string
Parameters
$annot : mixed
$oid : mixed
Tags
params

array $annot Array containing page annotations.

params

int $oid Annotation Object ID.

Return values
string

getOutAnnotations()

Returns the PDF Annotations entry.

protected getOutAnnotations() : string
Return values
string

getOutAPXObjects()

Returns the PDF Annotation code for Apearance Stream XObjects entry.

protected getOutAPXObjects(int $width, int $height[, string $stream = '' ]) : int
Parameters
$width : int

annotation width

$height : int

annotation height

$stream : string = ''

appearance stream

Return values
int

getOutBookmarks()

Returns the PDF Bookmarks entry.

protected getOutBookmarks() : string
Return values
string

getOutCatalog()

Returns the PDF Catalog entry.

protected getOutCatalog() : string
Return values
string

getOutDateTimeString()

Returns a formatted date for meta information

protected getOutDateTimeString(int $time, int $oid) : string
Parameters
$time : int

Time in seconds.

$oid : int

Current PDF object number.

Return values
string

escaped date-time string.

getOutDestinations()

Returns the PDF Destinations entry.

protected getOutDestinations() : string
Return values
string

getOutEmbeddedFiles()

Returns the PDF Embedded Files entry.

protected getOutEmbeddedFiles() : string
Return values
string

getOutFontDic()

Get the PDF output string for Font resources dictionary.

protected getOutFontDic() : string
Return values
string

getOutICC()

Returns the PDF object to include a standard sRGB_IEC61966-2.1 blackscaled ICC colour profile.

protected getOutICC() : string
Return values
string

getOutJavascript()

Returns the PDF Javascript entry.

protected getOutJavascript() : string
Return values
string

getOutMetaInfo()

Get the PDF output string for the Document Information Dictionary.

protected getOutMetaInfo() : string

(ref. Chapter 14.3.3 Document Information Dictionary of PDF32000_2008.pdf)

Return values
string

getOutOCG()

Returns the PDF OCG entry.

protected getOutOCG() : string
Return values
string

getOutPDFBody()

Returns the raw PDF Body section.

protected getOutPDFBody() : string
Return values
string

getOutPDFHeader()

Returns the PDF document header.

protected getOutPDFHeader() : string
Return values
string

getOutPDFTrailer()

Returns the PDF Trailer section.

protected getOutPDFTrailer() : string
Return values
string

getOutPDFXref()

Returns the PDF XREF section.

protected getOutPDFXref(array<string|int, mixed> $offset) : string
Parameters
$offset : array<string|int, mixed>

Ordered offset array for each PDF object

Return values
string

getOutputIntents()

Set OutputIntents.

protected getOutputIntents() : string
Return values
string

getOutputIntentsPdfX()

Get OutputIntents for PDF-X if required.

protected getOutputIntentsPdfX() : string
Return values
string

getOutputIntentsSrgb()

Get OutputIntents for sRGB IEC61966-2.1 if required.

protected getOutputIntentsSrgb() : string
Return values
string

getOutResourcesDict()

Returns the PDF Resources Dictionary entry.

protected getOutResourcesDict() : string
Return values
string

getOutSignature()

Returns the PDF signarure entry.

protected getOutSignature() : string
Return values
string

getOutSignatureDocMDP()

Returns the PDF signarure entry.

protected getOutSignatureDocMDP() : string
Return values
string

getOutSignatureFields()

Returns the PDF Signature Fields entry.

protected getOutSignatureFields() : string
Return values
string

getOutSignatureInfo()

Returns the PDF signarure info section.

protected getOutSignatureInfo() : string
Return values
string

getOutSignatureUserRights()

Returns the PDF signarure entry.

protected getOutSignatureUserRights() : string
Return values
string

getOutTextString()

Format a text string for output.

protected getOutTextString(string $str, int $oid[, bool $bom = false ]) : string
Parameters
$str : string

String to escape.

$oid : int

Current PDF object number.

$bom : bool = false

If true set the Byte Order Mark (BOM).

Return values
string

escaped string.

getOutViewerPref()

Returns the PDF viewer preferences for the catalog section

protected getOutViewerPref() : string
Return values
string

getOutXMP()

Get the PDF output string for the XMP data object

protected getOutXMP() : string
Tags
SuppressWarnings

(PHPMD.ExcessiveMethodLength)

Return values
string

getOutXObjects()

Returns the PDF XObjects entry.

protected getOutXObjects() : string
Return values
string

getPageBoxName()

Sanitize the page box name and return the default 'CropBox' in case of error.

protected getPageBoxName(string $name) : string
Parameters
$name : string

Entry name.

Return values
string

getPagePrintScaling()

Sanitize the page box name and return the default 'CropBox' in case of error.

protected getPagePrintScaling() : string
Return values
string

getPDFLayers()

Get the PDF layers.

protected getPDFLayers() : string
Return values
string

getPDFObjectOffsets()

Returns the ordered offset array for each object.

protected getPDFObjectOffsets(string $data) : array<string|int, mixed>
Parameters
$data : string

Raw PDF data

Return values
array<string|int, mixed>

getProducer()

Returns the producer string

protected getProducer() : string
Return values
string

getXMPFormattedDate()

Returns a formatted date for XMP meta information

protected getXMPFormattedDate(int $time) : string
Parameters
$time : int

Time in seconds.

Return values
string

date-time string.

getXObjectDic()

Get the PDF output string for XObject resources dictionary.

protected getXObjectDic() : string
Return values
string

initClassObjects()

Initialize class objects

protected initClassObjects() : mixed
Return values
mixed

processPrevNextBookmarks()

Process the bookmarks to get the previous and next one.

protected processPrevNextBookmarks() : int
Return values
int

first bookmark object ID

setCompressMode()

Set the compression mode.

protected setCompressMode(bool $compress) : mixed
Parameters
$compress : bool

Set to false to disable stream compression.

Return values
mixed

setDecimalSeparator()

Set the decimal separator.

protected setDecimalSeparator() : mixed
Tags
throws
Exception

in case of error.

Return values
mixed

setPDFMode()

Set the pdf mode.

protected setPDFMode(string $mode) : mixed
Parameters
$mode : string

Input PDFA mode.

Return values
mixed

setUnicodeMode()

Set the decimal separator.

protected setUnicodeMode(mixed $isunicode) : mixed
Parameters
$isunicode : mixed
Return values
mixed

signDocument()

Sign the document.

protected signDocument(string $pdfdoc) : string
Parameters
$pdfdoc : string

string containing the PDF document

Return values
string

sortBookmarks()

Sort bookmarks by page and original position.

protected sortBookmarks() : mixed
Return values
mixed

unhtmlentities()

Reverse function for htmlentities.

protected unhtmlentities(string $text_to_convert) : string
Parameters
$text_to_convert : string

Text to convert.

Return values
string

converted text string

setNonEmptyFieldValue()

Set a field value only if it is not empty.

private setNonEmptyFieldValue(string $field, srting $value) : mixed
Parameters
$field : string

Field name

$value : srting

Value to set

Return values
mixed
 

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