class TCPDF (View source)

Properties

protected Tcpdf|null $eng

The tc-lib-pdf engine that renders the actual document.

protected string $docunit

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

protected float $kratio

Scale factor: number of points per user unit.

protected bool $unicode

Unicode mode flag.

protected string $charencoding

Document encoding (only 'UTF-8' is supported by the engine).

protected string $pdfamode

PDF/A mode passed to the engine ('' = disabled).

protected string $deforientation

Default page orientation ('P' or 'L').

protected mixed $defformat

Default page format (format name string or [width, height] in user units).

protected string $curorientation

Current page orientation.

protected mixed $curformat

Current page format.

protected int $docstate

Document state: 0 = not started, 1 = open, 2 = has pages, 3 = closed.

protected string $pdfraw

Cached raw PDF output (built once at close time).

protected float $lmargin

Left margin in user units.

protected float $tmargin

Top margin in user units.

protected float $rmargin

Right margin in user units.

protected float $bmargin

Page-break bottom margin in user units.

protected float $orig_lmargin

Original margins (used by header/footer rendering).

protected float $orig_rmargin

Original right margin in user units.

protected bool $autopagebreak

Automatic page break flag.

protected float $posx

Current abscissa (user units, from left page edge).

protected float $posy

Current ordinate (user units, from top page edge).

protected float $lasth

Height of the last printed cell (user units).

protected float $cellheightratio

Cell height ratio (line height = font size * ratio).

protected array{L: float, T: float, R: float, B: float} $cellpadding
protected array{L: float, T: float, R: float, B: float} $cellmargin
protected string $fontfamily

Current font family (normalized lowercase).

protected string $fontstyle

Current font style letters (subset of 'B', 'I').

protected array{U: bool, D: bool, O: bool} $fontdecor
protected float $fontsizept

Current font size in points.

protected array<string, mixed> $fontmetric
protected bool $fontsubsetting

Default font subsetting mode for setFont (legacy default: true).

protected float $fontspacing

Extra font spacing (user units) applied via the engine font stack.

protected float $fontstretching

Font stretching percentage (100 = none).

protected string $monospacedfont

Default monospaced font family.

protected string $textcolorspec

Text color: engine color specification string.

protected string $drawcolorspec

Draw (stroke) color: engine color specification string.

protected string $fillcolorspec

Fill color: engine color specification string.

protected array<int|float> $textcolorlegacy
protected array<int|float> $drawcolorlegacy
protected array<int|float> $fillcolorlegacy
protected float $linewidth

Current line width in user units.

protected StyleDataOpt $linestyle
protected bool $rtlmode

RTL direction flag.

protected mixed $tmprtl

Temporary RTL mode ('R', 'L' or false).

protected bool $printheader

Print header flag.

protected bool $printfooter

Print footer flag.

protected array{logo: string, logo_width: float, title: string, string: string, text_color: array<int, float|int|string>, line_color: array<int, float|int|string>} $headerdata
protected array{text_color: array<int, float|int|string>, line_color: array<int, float|int|string>} $footerdata
protected float $headermargin

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

protected float $footermargin

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

protected array{0: string, 1: string, 2: float} $headerfont
protected array{0: string, 1: string, 2: float} $footerfont
protected bool $inheaderfooter

True while rendering the page header or footer.

protected array<int|string, mixed> $langdata

Language dependent strings (legacy $l array): built-in English defaults, overridable via the K_TCPDF_DEFAULT_LANGUAGE constant or setLanguageArray().

protected float $imgscale

Image scale ratio (used when width/height are not specified).

protected int $jpegquality

JPEG quality used when re-encoding images.

protected float $imagerbx

Bottom-right X coordinate of the last inserted image.

protected float $imagerby

Bottom-right Y coordinate of the last inserted image.

protected array<int, string> $imagemasks
protected int $imagemaskseq

Sequence for image mask handles.

protected array{stroke: float, fill: bool, clip: bool} $textrendermode
protected array{enabled: bool, depth_w: int|float, depth_h: int|float, color: mixed, opacity: int|float, blend_mode: string} $textshadow
protected int $startingpagenumber

Starting page number (used by PageNoFormatted).

protected int $decortotalpages

Total number of pages, available while rendering deferred decorations.

protected string $docbarcode

Document barcode string (printed in the footer when set).

protected bool $bookletmode

Booklet mode flag.

protected $tocpage

True when the current page is a TOC page.

protected array{CA: float, ca: float, BM: string, AIS: bool} $alpha
protected array{OP: bool, op: bool, OPM: int} $overprint
protected int $openlayers

Number of currently open optional-content layers.

protected TCPDF|null $transactionsnapshot

Snapshot of the facade object used by the transaction API.

$internallinks
protected array<string, mixed> $nameddests
protected string $xobjtid

Identifier of the currently open XObject template ('' = none).

protected float $xobjheight

Height of the currently open XObject template in user units.

protected int $nextpagegroup

Page group number for the next added page (0 = default group).

protected bool $pagegroupsused

True when page groups are in use.

protected int $pagecolumns

Columns requested via setEqualColumns() for subsequently added pages.

protected float $pagecolumnwidth

Column width requested via setEqualColumns() (0 = divide the content width evenly).

protected array<int, array{RX: float, RY: float, RW: float, RH: float}> $pageregions
protected array<int, array{page: int, xt: float, yt: float, xb: float, yb: float, side: string}> $nowriteareas

Legacy no-write page regions (setPageRegions()): rectangular/trapezoidal exclusion zones that flowing text and HTML must avoid. Stored verbatim in the legacy form and converted to engine banded writable regions at flow time (see applyNoWriteRegionsForFlow()).

protected array<string, mixed> $formdefaultprop
protected array<int, float|int|string> $htmllinkcolor
protected string $htmllinkstyle

HTML link font style letters.

protected bool $htmlnopadding

True while rendering HTML that must ignore the current cell padding (legacy writeHTML without $cell).

protected array{create: int, modify: int} $doctimestamps
protected array<int, array{header: bool, footer: bool}> $pagedecor
protected array{zoom: int|string, layout: string, mode: string} $displaymode

Methods

__construct($_orientation = 'P', $_unit = 'mm', $_format = 'A4', $_unicode = true, $_encoding = 'UTF-8', $_diskcache = false, $_pdfa = false)

No description

__destruct()

No description

__get($name)

Legacy protected properties historically read by TCPDF subclasses (e.g. $this->AutoPageBreak, $this->lMargin), mapped to facade state.

__isset($name)

No description

void
engineInit(string $unit)

Create (or re-create) the tc-lib-pdf engine for the given unit.

string
ambientPageContent()

Raw PDF operators for the ambient text state that must open every page content stream: the engine re-emits the current font (carrying its spacing/stretching) when it adds a page, so the facade only needs to carry the legacy text color across page breaks.

array
fileAllowedPaths()

Local paths the engine may read files from. The legacy API loaded images and fonts from application-relative locations, so in addition to the engine defaults this allows the configured TCPDF paths, the current working directory and the running script directory.

array
fileOptions()

Assemble the file-access options handed to the engine's shared file helper (tc-lib-file). These drive the upstream security sandbox that governs which local paths and remote hosts external resources (images, fonts, SVG, ...) may be loaded from.

Tcpdf
engine()

Return the engine instance.

void
emitToPage(string $content)

Append raw PDF content to the current page (no-op when no page exists).

string
normalizeOrientation(mixed $orientation)

Normalize a legacy orientation value to 'P' or 'L'.

string
normalizePdfaMode(mixed $pdfa)

Map the legacy $pdfa constructor flag onto an engine conformance mode.

array
buildPageData(mixed $orientation, mixed $format)

Build the engine page data array for a new page.

string
colorSpecFromLegacy(mixed $color)

Convert a legacy color definition (component list or array) to an engine color specification string.

string
colorSpecFromComponents(mixed $col1, mixed $col2, mixed $col3, mixed $col4, string $name)

Convert legacy color components (setColor-style) to a spec string.

array
legacyColorComponents(mixed $color, array $default)

Sanitize a legacy color component array (numbers, optional spot name).

array
currentLineStyle()

Current line style as an engine style array (lineWidth, lineColor, ...).

array
stylesFromLegacyBorder(mixed $border, bool $fill)

Build the engine per-side styles array from a legacy border argument.

array
legacyBorderCellMetrics(mixed $border)

Mirror legacy adjustCellPadding(): a cell border reserves a minimum cell padding so the stroke does not overlap the text, and the optional position mode decides how much of the stroke falls inside the cell box:

  • ext : the whole stroke is painted outside -> 0 padding, the border rectangle grows outward;
  • int : the whole stroke is painted inside -> a full line-width padding, the border rectangle shrinks inward;
  • normal : the stroke straddles the edge -> half line-width.

array
styleFromLegacyLineStyle(array $style)

Convert a legacy line style array (width, cap, join, dash, phase, color) to an engine style array.

string
shapeModeFromLegacy(mixed $style, bool $hasfill, bool $close = false)

Map a legacy shape style letter combination to an engine paint mode.

array
shapeStyleFromLegacy(mixed $linestyle, mixed $fillcolor)

Build the engine style for a legacy (line_style, fill_color) pair.

array
segmentStylesFromLegacy(mixed $linestyle, mixed $fillcolor)

Convert a legacy per-segment/per-side style list to engine styles.

float
coordOrCursor(mixed $value, bool $vertical)

Resolve a legacy optional coordinate ('' or null means current position).

array
completeSideStyles(array $styles)

Complete partial per-side styles with the current graph style defaults (the engine HTML renderer requires fully-populated style arrays).

void
breakIfNeeded(float $height)

Trigger an automatic page break when the given height does not fit.

void
advanceToNextPage()

Move to the top of the next page for an automatic break, reusing an already-created page when one exists.

string
valignToEngine(mixed $valign)

Map a legacy text vertical alignment letter to the engine convention.

float
cellCalignShift(string $calign, string $valign, float $height)

Legacy $calign cell vertical alignment: the amount (user units) by which the cell box top is shifted UP relative to the current text line. The font-relative modes (A/L/D) depend on $valign, mirroring getCellCode().

string
halignToEngine(mixed $align)

Map a legacy horizontal alignment letter to the engine convention.

array
engineOutlines()

Bookmark outline entries collected by the engine.

void
setEngineOutlines(array $outlines)

Replace the engine bookmark outline entries (used to remap page targets after the TOC pages are relocated).

void
applyHtmlTextShadow(int $pid, int $start)

Emulate the legacy text shadow for engine-rendered HTML content.

float
pageContentImageBottom(int $pid, int $start, float $fallback)

Lowest bottom edge (user units from the page top) of the images placed in the content chunks appended after the given index.

int
pageContentCount(int $pid)

Number of raw content chunks of the given engine page.

void
movePageContentToFront(int $pid, int $start)

Move the content chunks appended after the given index to the front of the page stream, so they paint behind the page body. Used for deferred header rendering: the legacy engine painted headers at page-start time, i.e. under the body content.

int
cellBBoxCount()

Number of entries currently on the engine cell bounding-box stack.

float
cellBBoxBottomSince(int $start, float $fallback)

Lowest bottom edge (user units) among the cell bounding boxes pushed on the engine stack after the given index.

string
cellBoxOutput(float $posx, float $posy, float $width, float $height, array $styles, bool $fill)

PDF code for a cell background fill and the requested border sides.

void
drawHtmlCellSegments(float $posx, float $width, float $starty, float $bottom, int $startpage, int $contentstart, array $styles, bool $fill, int|null $endpage = null)

Draw the per-page border/fill segments of an auto-height HTML cell that flowed across pages (the engine skips the cell box in that case).

void
insertPageContent(int $pid, int $start, string $content)

Insert a PDF content chunk at the given position of an engine page content stream, so it paints behind the chunks that follow it.

string
stretchedCellText(int $mode, string $txt, float $width, float $height, float $textw, string $valign, array|null $shadow)

PDF code for a stretched cell text run (legacy Cell stretch modes).

void
refreshFontState()

Re-apply the current font to the engine font stack so it carries the up-to-date spacing/stretching.

float
naturalOrdWidth(string $txt)

Raw PDF code that renders the current font's natural (unstretched, unspaced) measurement of the given text width in user units.

array|null
engineShadow()

Current engine text shadow array (or null when disabled).

string
forcedTextDir()

Forced text direction for the engine ('' = inherit document direction).

string
resolveLocalFile(string $file)

Canonicalize a local file path before handing it to the engine.

void
attachLink(mixed $link, float $posx, float $posy, float $width, float $height)

Register an external link annotation for the given rectangle.

void
decorateAllPages()

Render the deferred page decorations (headers and footers) on every page. Called once when the document is closed: at that time the total page count is known, so the default footer can print real numbers.

setPageUnit($_unit)

No description

setPageOrientation($_orientation, $_autopagebreak = null, $_bottommargin = null)

No description

setSpacesRE($_re = '/[^\S\xa0]/')

No description

setRTL($_enable, $_resetx = true)

No description

bool
getRTL()

No description

setTempRTL($_mode)

No description

bool
isRTLTextDir()

No description

setLastH($_h)

No description

float
getCellHeight(int|float $_fontsize, bool $_padding = true)

Return the cell height for the given font size.

resetLastH()

No description

float
getLastH()

No description

setImageScale($_scale)

No description

float
getImageScale()

No description

getPageDimensions($_pagenum = null)

No description

float
getPageWidth(int|null $_pagenum = null)

Return the page width in user units.

float
getPageHeight(int|null $_pagenum = null)

Return the page height in user units.

float
getBreakMargin(int|null $_pagenum = null)

Return the automatic page-break bottom margin.

float
getScaleFactor()

No description

setMargins($_left, $_top, $_right = null, $_keepmargins = false)

No description

setLeftMargin($_margin)

No description

setTopMargin($_margin)

No description

setRightMargin($_margin)

No description

setCellPadding($_pad)

No description

setCellPaddings($_left = null, $_top = null, $_right = null, $_bottom = null)

No description

array{L: float, T: float, R: float, B: float}
getCellPaddings()

No description

setCellMargins($_left = null, $_top = null, $_right = null, $_bottom = null)

No description

array{L: float, T: float, R: float, B: float}
getCellMargins()

No description

setAutoPageBreak($_auto, $_margin = 0)

No description

bool
getAutoPageBreak()

No description

setDisplayMode($_zoom, $_layout = 'SinglePage', $_mode = 'UseNone')

No description

setCompression($_compress = true)

No description

setSRGBmode($_mode = false)

No description

setDocInfoUnicode($_unicode = true)

No description

setTitle($_title)

No description

setSubject($_subject)

No description

setAuthor($_author)

No description

setKeywords($_keywords)

No description

setCreator($_creator)

No description

setAllowLocalFiles($_allowLocalFiles)

No description

Error($_msg)

No description

Open()

No description

Close()

No description

void
applyBookmarkDisplayMode()

Match legacy TCPDF: when bookmark outlines are present the document opens with the outline (bookmark) panel visible (/PageMode /UseOutlines).

setPage($_pnum, $_resetmargins = false)

No description

lastPage($_resetmargins = false)

No description

int
getPage()

No description

int
getNumPages()

No description

addTOCPage($_orientation = '', $_format = '', $_keepmargins = false)

No description

endTOCPage()

No description

AddPage($_orientation = '', $_format = '', $_keepmargins = false, $_tocpage = false)

No description

endPage($_tocpage = false)

No description

startPage($_orientation = '', $_format = '', $_tocpage = false)

No description

setPageMark()

No description

setHeaderData($_ln = '', $_lw = 0, $_ht = '', $_hs = '', $_tc = [0, 0, 0], $_lc = [0, 0, 0])

No description

setFooterData($_tc = [0, 0, 0], $_lc = [0, 0, 0])

No description

array{logo: string, logo_width: float, title: string, string: string, text_color: array<int, float|int|string>, line_color: array<int, float|int|string>}
getHeaderData()

No description

setHeaderMargin($_hm = 10)

No description

float
getHeaderMargin()

No description

setFooterMargin($_fm = 10)

No description

float
getFooterMargin()

No description

setPrintHeader($_val = true)

No description

setPrintFooter($_val = true)

No description

float
getImageRBX()

No description

float
getImageRBY()

No description

resetHeaderTemplate()

No description

setHeaderTemplateAutoreset($_val = true)

No description

Header()

No description

Footer()

No description

int
PageNo()

No description

getAllSpotColors()

No description

AddSpotColor($_name, $_c, $_m, $_y, $_k)

No description

setSpotColor($_type, $_name, $_tint = 100)

No description

setDrawSpotColor($_name, $_tint = 100)

No description

setFillSpotColor($_name, $_tint = 100)

No description

setTextSpotColor($_name, $_tint = 100)

No description

setColorArray($_type, $_color, $_ret = false)

No description

setDrawColorArray($_color, $_ret = false)

No description

setFillColorArray($_color, $_ret = false)

No description

setTextColorArray($_color, $_ret = false)

No description

setColor($_type, $_col1 = 0, $_col2 = -1, $_col3 = -1, $_col4 = -1, $_ret = false, $_name = '')

No description

setDrawColor($_col1 = 0, $_col2 = -1, $_col3 = -1, $_col4 = -1, $_ret = false, $_name = '')

No description

setFillColor($_col1 = 0, $_col2 = -1, $_col3 = -1, $_col4 = -1, $_ret = false, $_name = '')

No description

setTextColor($_col1 = 0, $_col2 = -1, $_col3 = -1, $_col4 = -1, $_ret = false, $_name = '')

No description

float|array<int, float>
GetStringWidth(string $_s, string $_fontname = '', string $_fontstyle = '', int|float $_fontsize = 0, bool $_getarray = false)

Return the length of a string in user units.

float|array<int, float>
GetArrStringWidth(array<int, int|string> $_sa, string $_fontname = '', string $_fontstyle = '', int|float $_fontsize = 0, bool $_getarray = false)

Return the width of a character array in user units.

GetCharWidth($_char, $_notlast = true)

No description

float
getRawCharWidth(int|string $_char)

No description

GetNumChars($_s)

No description

AddFont($_family, $_style = '', $_fontfile = '', $_subset = 'default')

No description

setFont($_family, $_style = '', $_size = null, $_fontfile = '', $_subset = 'default', $_out = true)

No description

setFontSize($_size, $_out = true)

No description

getFontBBox()

No description

getAbsFontMeasure($_s)

No description

getCharBBox($_char)

No description

getFontDescent($_font, $_style = '', $_size = 0)

No description

getFontAscent($_font, $_style = '', $_size = 0)

No description

isCharDefined($_char, $_font = '', $_style = '')

No description

replaceMissingChars($_text, $_font = '', $_style = '', $_subs = [])

No description

setDefaultMonospacedFont($_font)

No description

AddLink()

No description

setLink($_link, $_y = 0, $_page = -1)

No description

Link($_x, $_y, $_w, $_h, $_link, $_spaces = 0)

No description

Annotation($_x, $_y, $_w, $_h, $_text, $_opt = ['Subtype' => 'Text'], $_spaces = 0)

No description

EmbedFile($_opt)

No description

EmbedFileFromString($_filename, $_content)

No description

Text($_x, $_y, $_txt, $_fstroke = 0, $_fclip = false, $_ffill = true, $_border = 0, $_ln = 0, $_align = '', $_fill = false, $_link = '', $_stretch = 0, $_ignore_min_height = false, $_calign = 'T', $_valign = 'M', $_rtloff = false)

No description

bool
AcceptPageBreak()

No description

Cell($_w, $_h = 0, $_txt = '', $_border = 0, $_ln = 0, $_align = '', $_fill = false, $_link = '', $_stretch = 0, $_ignore_min_height = false, $_calign = 'T', $_valign = 'M')

No description

MultiCell($_w, $_h, $_txt, $_border = 0, $_align = 'J', $_fill = false, $_ln = 1, $_x = null, $_y = null, $_reseth = true, $_stretch = 0, $_ishtml = false, $_autopadding = true, $_maxh = 0, $_valign = 'T', $_fitcell = false)

No description

int
getNumLines($_txt, $_w = 0, $_reseth = false, $_autopadding = true, $_cellpadding = null, $_border = 0)

Estimate the number of lines needed to print the given text.

getStringHeight($_w, $_txt, $_reseth = false, $_autopadding = true, $_cellpadding = null, $_border = 0)

No description

string
preserveBlankLines(string $txt)

Fill the empty lines of a multi-line text with a single space.

array
legacyRowPitch(float $pitch, bool $withpadding = false)

Map the legacy text row pitch onto the engine text-cell inputs.

Write($_h, $_txt, $_link = '', $_fill = false, $_align = '', $_ln = false, $_stretch = 0, $_firstline = false, $_firstblock = false, $_maxh = 0, $_wadj = 0, $_margin = null)

No description

array
currentFontMetric()

Return the current font metric array (inserting the default when missing).

Image($_file, $_x = null, $_y = null, $_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 = [])

No description

string|null
mergeImageAlphaMask(string $basefile, string $maskfile)

Apply a legacy 8-bit soft mask to an image by writing it into the image's alpha channel, then return the merged PNG content. The engine's import path then splits that alpha back out into a /SMask (the only soft-mask mechanism tc-lib-pdf-image exposes), reproducing legacy's separate-mask Image() call. Returns null when the images cannot be read (caller falls back to the unmasked file).

array
imagePixelSize(string $file)

Return the pixel size of an image file or '@'-prefixed data stream.

Ln($_h = null, $_cell = false)

No description

float
GetX()

No description

float
GetAbsX()

No description

float
GetY()

No description

setX($_x, $_rtloff = false)

No description

setY($_y, $_resetx = true, $_rtloff = false)

No description

setXY($_x, $_y, $_rtloff = false)

No description

setAbsX($_x)

No description

setAbsY($_y)

No description

setAbsXY($_x, $_y)

No description

Output($_name = 'doc.pdf', $_dest = 'I')

No description

getPDFData()

No description

setExtraXMP($_xmp)

No description

setExtraXMPRDF($_xmp)

No description

setExtraXMPPdfaextension($_xmp)

No description

setDocCreationTimestamp($_time)

No description

setDocModificationTimestamp($_time)

No description

getDocCreationTimestamp()

No description

getDocModificationTimestamp()

No description

setHeaderFont($_font)

No description

array{0: string, 1: string, 2: float}
getHeaderFont()

No description

setFooterFont($_font)

No description

array{0: string, 1: string, 2: float}
getFooterFont()

No description

setLanguageArray($_language)

No description

addHtmlLink($_url, $_name, $_fill = false, $_firstline = false, $_color = null, $_style = -1, $_firstblock = false)

No description

pixelsToUnits($_px)

No description

unhtmlentities($_text_to_convert)

No description

setProtection($_permissions = ['print', 'modify', 'copy', 'annot-forms', 'fill-forms', 'extract', 'assemble', 'print-high'], $_user_pass = '', $_owner_pass = null, $_mode = 0, $_pubkeys = null)

No description

StartTransform()

No description

StopTransform()

No description

ScaleX($_s_x, $_x = '', $_y = '')

No description

ScaleY($_s_y, $_x = '', $_y = '')

No description

ScaleXY($_s, $_x = '', $_y = '')

No description

Scale($_s_x, $_s_y, $_x = null, $_y = null)

No description

MirrorH($_x = null)

No description

MirrorV($_y = null)

No description

MirrorP($_x = null, $_y = null)

No description

MirrorL($_angle = 0, $_x = null, $_y = null)

No description

TranslateX($_t_x)

No description

TranslateY($_t_y)

No description

Translate($_t_x, $_t_y)

No description

Rotate($_angle, $_x = null, $_y = null)

No description

SkewX($_angle_x, $_x = null, $_y = null)

No description

SkewY($_angle_y, $_x = null, $_y = null)

No description

Skew($_angle_x, $_angle_y, $_x = null, $_y = null)

No description

setLineWidth($_width)

No description

float
GetLineWidth()

No description

setLineStyle($_style, $_ret = false)

No description

Line($_x1, $_y1, $_x2, $_y2, $_style = [])

No description

Rect($_x, $_y, $_w, $_h, $_style = '', $_border_style = [], $_fill_color = [])

No description

Curve($_x0, $_y0, $_x1, $_y1, $_x2, $_y2, $_x3, $_y3, $_style = '', $_line_style = [], $_fill_color = [])

No description

Polycurve($_x0, $_y0, $_segments, $_style = '', $_line_style = [], $_fill_color = [])

No description

Ellipse($_x0, $_y0, $_rx, $_ry = 0, $_angle = 0, $_astart = 0, $_afinish = 360, $_style = '', $_line_style = [], $_fill_color = [], $_nc = 2)

No description

Circle($_x0, $_y0, $_r, $_angstr = 0, $_angend = 360, $_style = '', $_line_style = [], $_fill_color = [], $_nc = 2)

No description

PolyLine($_p, $_style = '', $_line_style = [], $_fill_color = [])

No description

Polygon($_p, $_style = '', $_line_style = [], $_fill_color = [], $_closed = true)

No description

RegularPolygon($_x0, $_y0, $_r, $_ns, $_angle = 0, $_draw_circle = false, $_style = '', $_line_style = [], $_fill_color = [], $_circle_style = '', $_circle_outLine_style = [], $_circle_fill_color = [])

No description

StarPolygon($_x0, $_y0, $_r, $_nv, $_ng, $_angle = 0, $_draw_circle = false, $_style = '', $_line_style = [], $_fill_color = [], $_circle_style = '', $_circle_outLine_style = [], $_circle_fill_color = [])

No description

RoundedRect($_x, $_y, $_w, $_h, $_r, $_round_corner = '1111', $_style = '', $_border_style = [], $_fill_color = [])

No description

RoundedRectXY($_x, $_y, $_w, $_h, $_rx, $_ry, $_round_corner = '1111', $_style = '', $_border_style = [], $_fill_color = [])

No description

Arrow($_x0, $_y0, $_x1, $_y1, $_head_style = 0, $_arm_size = 5, $_arm_angle = 15)

No description

setDestination($_name, $_y = -1, $_page = '', $_x = -1)

No description

getDestination()

No description

setBookmark($_txt, $_level = 0, $_y = -1, $_page = '', $_style = '', $_color = [0, 0, 0], $_x = -1, $_link = '')

No description

Bookmark($_txt, $_level = 0, $_y = -1, $_page = '', $_style = '', $_color = [0, 0, 0], $_x = -1, $_link = '')

No description

IncludeJS($_script)

No description

addJavascriptObject($_script, $_onload = false)

No description

setFormDefaultProp($_prop = [])

No description

getFormDefaultProp()

No description

array
formFieldValues(mixed $values)

Normalize legacy list/combo values: either a list of strings or a list of [export, display] pairs (the engine requires a homogeneous list).

array
formFieldOptions(mixed $prop, mixed $opt)

Normalize legacy form-field (prop, opt) pairs for the engine.

void
attachAnnotRef(int $oid)

Attach a freshly created annotation/form-field widget to the current page so the engine emits it in the page's /Annots array.

void
advanceFormFieldX(float $width)

Advance the horizontal cursor after placing a form field, matching the legacy behaviour where each field method shifts the current X position by the field width (RTL-aware). The shift is applied to the live cursor regardless of any explicit x/y override, exactly as legacy TCPDF does.

TextField($_name, $_w, $_h, $_prop = [], $_opt = [], $_x = null, $_y = null, $_js = false)

No description

RadioButton($_name, $_w, $_prop = [], $_opt = [], $_onvalue = 'On', $_checked = false, $_x = null, $_y = null, $_js = false)

No description

ListBox($_name, $_w, $_h, $_values, $_prop = [], $_opt = [], $_x = null, $_y = null, $_js = false)

No description

ComboBox($_name, $_w, $_h, $_values, $_prop = [], $_opt = [], $_x = null, $_y = null, $_js = false)

No description

CheckBox($_name, $_w, $_checked = false, $_prop = [], $_opt = [], $_onvalue = 'Yes', $_x = null, $_y = null, $_js = false)

No description

Button($_name, $_w, $_h, $_caption, $_action, $_prop = [], $_opt = [], $_x = null, $_y = null, $_js = false)

No description

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 = '')

No description

setSignature($_signing_cert = '', $_private_key = '', $_private_key_password = '', $_extracerts = '', $_cert_type = 2, $_info = [], $_approval = '')

No description

setSignatureAppearance($_x = 0, $_y = 0, $_w = 0, $_h = 0, $_page = -1, $_name = '')

No description

addEmptySignatureAppearance($_x = 0, $_y = 0, $_w = 0, $_h = 0, $_page = -1, $_name = '')

No description

setTimeStamp($_tsa_host = '', $_tsa_username = '', $_tsa_password = '', $_tsa_cert = '')

No description

startPageGroup($_page = null)

No description

setStartingPageNumber($_num = 1)

No description

string
getAliasRightShift()

No description

string
getAliasNbPages()

No description

string
getAliasNumPage()

No description

string
getPageGroupAlias()

No description

string
getPageNumGroupAlias()

No description

int
getGroupPageNo()

No description

getGroupPageNoFormatted()

No description

PageNoFormatted()

No description

startLayer($_name = '', $_print = true, $_view = true, $_lock = true)

No description

endLayer()

No description

setVisibility($_v)

No description

setOverprint($_stroking = true, $_nonstroking = null, $_mode = 0)

No description

getOverprint()

No description

setAlpha($_stroking = 1, $_bm = 'Normal', $_nonstroking = null, $_ais = false)

No description

void
registerTemplateExtGState(string $cmd)

Register the ExtGState referenced by the given command with the open XObject template resource dictionary.

getAlpha()

No description

setJPEGQuality($_quality)

No description

setDefaultTableColumns($_cols = 4)

No description

setCellHeightRatio($_h)

No description

float
getCellHeightRatio()

No description

setPDFVersion($_version = '1.7')

No description

setViewerPreferences($_preferences)

No description

colorRegistrationBar($_x, $_y, $_w, $_h, $_transition = true, $_vertical = false, $_colors = 'A,R,G,B,C,M,Y,K')

No description

cropMark($_x, $_y, $_w, $_h, $_type = 'T,R,B,L', $_color = [100, 100, 100, 100, 'All'])

No description

registrationMark($_x, $_y, $_r, $_double = false, $_cola = [100, 100, 100, 100, 'All'], $_colb = [0, 0, 0, 0, 'None'])

No description

registrationMarkCMYK($_x, $_y, $_r)

No description

LinearGradient($_x, $_y, $_w, $_h, $_col1 = [], $_col2 = [], $_coords = [0, 0, 1, 0])

No description

RadialGradient($_x, $_y, $_w, $_h, $_col1 = [], $_col2 = [], $_coords = [0.5, 0.5, 0.5, 0.5, 1])

No description

CoonsPatchMesh($_x, $_y, $_w, $_h, $_col1 = [], $_col2 = [], $_col3 = [], $_col4 = [], $_coords = [0.0, 0.0, 0.33, 0.0, 0.67, 0.0, 1.0, 0.0, 1.0, 0.33, 1.0, 0.67, 1.0, 1.0, 0.67, 1.0, 0.33, 1.0, 0.0, 1.0, 0.0, 0.67, 0.0, 0.33], $_coords_min = 0, $_coords_max = 1, $_antialias = false)

No description

array
coonsPatchArray(array $patches)

Convert a legacy Coons patch-mesh array (per-patch 'f', 'points', and 'colors' with 0-255 r/g/b keys) to the engine shape (normalized red/green/blue floats).

Gradient($_type, $_coords, $_stops, $_background = [], $_antialias = false)

No description

PieSector($_xc, $_yc, $_r, $_a, $_b, $_style = 'FD', $_cw = true, $_o = 90)

No description

PieSectorXY($_xc, $_yc, $_rx, $_ry, $_a, $_b, $_style = 'FD', $_cw = false, $_o = 0, $_nc = 2)

No description

ImageEps($_file, $_x = null, $_y = null, $_w = 0, $_h = 0, $_link = '', $_useBoundingBox = true, $_align = '', $_palign = '', $_border = 0, $_fitonpage = false, $_fixoutvals = false)

[BREAKING CHANGE] EPS/AI vector import is not supported.

setBarcode($_bc = '')

No description

string
getBarcode()

No description

write1DBarcode($_code, $_type, $_x = null, $_y = null, $_w = null, $_h = null, $_xres = null, $_style = [], $_align = '')

No description

write2DBarcode($_code, $_type, $_x = null, $_y = null, $_w = null, $_h = null, $_style = [], $_align = '', $_distort = false)

No description

void
emitBarcode(string $code, string $type, mixed $posx, mixed $posy, mixed $width, mixed $height, float $xres, mixed $style, string $align, bool $is2d, bool $distort = false)

Render a barcode at the given position via the engine.

void
drawBarcode1D(string $type, string $code, float $posx, float $posy, mixed $width, mixed $height, float $xres, array $style, string $align, int $maxw, string $fgspec)

Render a 1D barcode with the legacy geometry: bars, the optional human-readable label and the vertical padding all fit inside the requested height (barh = height - text_height - 2*vpadding) instead of the label being appended below it. Bar drawing is delegated to the engine; the box, label and cursor advance mirror write1DBarcode().

void
drawBarcode2D(string $type, string $code, float $posx, float $posy, mixed $width, mixed $height, array $style, string $align, int $cols, int $rows, string $fgspec, bool $distort)

Render a 2D barcode with the legacy geometry: the barcode cells are inset inside the requested box by the (auto) padding quiet-zone and the aspect ratio is preserved unless $distort is set. Mirrors write2DBarcode().

float
fitBarcodeBlock(float $posx, float $posy, float $boxh)

Move to the next page when a barcode of the given height would not fit below the current Y, preserving the abscissa. Returns the Y to draw at.

float
barcodeBoxX(string $position, float $posx, float $boxw)

Left edge of a barcode box for the legacy position keyword (L/C/R or the current abscissa for the empty/default case).

string
barcodeBox(float $x, float $y, float $w, float $h, array $style)

Background fill and/or border around a barcode box.

void
advanceAfterBarcode(string $align, string $position, float $posx, float $drawy, float $boxw, float $boxh)

Advance the cursor next to a drawn barcode for the legacy $align value.

getMargins()

No description

getOriginalMargins()

No description

float
getFontSize()

No description

float
getFontSizePt()

No description

string
getFontFamily()

No description

string
getFontStyle()

No description

fixHTMLCode($_html, $_default_css = '', $_tagvs = null, $_tidy_options = null)

No description

getCSSPadding($_csspadding, $_width = 0)

No description

getCSSMargin($_cssmargin, $_width = 0)

No description

getCSSBorderMargin($_cssbspace, $_width = 0)

No description

array
cssBoxValues(string $css, float $width)

Parse a CSS shorthand box value (top right bottom left) into user units.

getHTMLFontUnits($_val, $_refsize = 12, $_parent_size = 12, $_defaultunit = 'pt')

No description

serializeTCPDFtag($_method, $_params = [])

No description

writeHTMLCell($_w, $_h, $_x, $_y, $_html = '', $_border = 0, $_ln = 0, $_fill = false, $_reseth = true, $_align = '', $_autopadding = true)

No description

string
absolutizeMarkupPath(string $source)

Make a relative local markup resource path absolute.

string
cssSafeMarkupPath(string $source)

Return a markup resource path that survives CSS lowercasing.

string
inheritHtmlBackgrounds(string $html)

Flatten styled inline elements that contain nested inline children.

string
normalizeHtmlMarkup(string $html)

Adapt legacy-tolerant HTML markup for the stricter engine renderer.

void
writeHtmlWithTcpdfTags(string $html, mixed $w, mixed $h, mixed $x, mixed $y, mixed $border, mixed $_ln, mixed $fill, mixed $reseth, mixed $align, mixed $autopadding)

Render HTML containing embedded method calls (K_TCPDF_CALLS_IN_HTML feature): the markup is split at the tags, each chunk is rendered normally and each tag invokes the serialized facade method when listed in K_ALLOWED_TCPDF_TAGS.

writeHTML($_html, $_ln = true, $_fill = false, $_reseth = false, $_cell = false, $_align = '')

No description

setLIsymbol($_symbol = '!')

No description

setBooklet($_booklet = true, $_inner = -1, $_outer = -1)

No description

setHtmlVSpace($_tagvs)

No description

setListIndentWidth($_width)

No description

setOpenCell($_isopen)

No description

setHtmlLinksStyle($_color = [0, 0, 255], $_fontstyle = 'U')

No description

getHTMLUnitToUnits($_htmlval, $_refsize = 1, $_defaultunit = 'px', $_points = false)

No description

movePage($_frompage, $_topage)

No description

deletePage($_page)

No description

copyPage($_page = 0)

No description

addTOC($_page = null, $_numbersfont = '', $_filler = '.', $_toc_name = 'TOC', $_style = '', $_color = [0, 0, 0])

No description

addHTMLTOC($_page = null, $_toc_name = 'TOC', $_templates = [], $_correct_align = true, $_style = '', $_color = [0, 0, 0])

No description

startTransaction()

No description

commitTransaction()

No description

rollbackTransaction($_self = false)

No description

array
equalColumnRegions(int $numcols, float $width, float $ypos)

Legacy equal-column geometry: the requested width is capped to an even share of the content width and the remainder becomes the inter-column gutters.

void
setEnginePageRegions(array $regions)

Replace the region (column) layout of the current engine page.

bool
inColumnMode()

True when the current page is split into multiple column regions.

setEqualColumns($_numcols = 0, $_width = 0, $_y = null)

No description

resetColumns()

No description

setColumnsArray($_columns)

No description

selectColumn($_col = null)

No description

getColumn()

No description

getNumberOfColumns()

No description

setTextRenderingMode($_stroke = 0, $_fill = true, $_clip = false)

No description

setTextShadow($_params = ['enabled' => false, 'depth_w' => 0, 'depth_h' => 0, 'color' => false, 'opacity' => 1, 'blend_mode' => 'Normal'])

No description

array{enabled: bool, depth_w: int|float, depth_h: int|float, color: mixed, opacity: int|float, blend_mode: string}
getTextShadow()

No description

hyphenateText($_text, $_patterns, $_dictionary = [], $_leftmin = 1, $_rightmin = 2, $_charmin = 1, $_charmax = 8)

No description

setRasterizeVectorImages($_mode)

No description

setFontSubsetting($_enable = true)

No description

bool
getFontSubsetting()

No description

stringLeftTrim($_str, $_replace = '')

No description

stringRightTrim($_str, $_replace = '')

No description

stringTrim($_str, $_replace = '')

No description

isUnicodeFont()

No description

getFontFamilyName($_fontfamily)

No description

startTemplate($_w = 0, $_h = 0, $_group = false)

No description

endTemplate()

No description

printTemplate($_id, $_x = null, $_y = null, $_w = 0, $_h = 0, $_align = '', $_palign = '', $_fitonpage = false)

No description

setFontStretching($_perc = 100)

No description

float
getFontStretching()

No description

setFontSpacing($_spacing = 0)

No description

float
getFontSpacing()

No description

getPageRegions()

No description

setPageRegions($_regions = [])

No description

addPageRegion($_region)

No description

removePageRegion($_key)

No description

array
currentPageNoWriteAreas()

The legacy no-write areas registered for the current page, in the engine setNoWriteRegions() input format (xt/yt/xb/yb/side).

bool
applyNoWriteRegionsForFlow(float $bandheight, float $cursory)

(Re)build the engine banded writable regions for the current page from its legacy no-write areas, using $bandheight as the height of each horizontal slice, then select the region that contains the current Y so the flow starts at the cursor and hugs the obstacles band by band. The text/HTML engine then advances region -> region -> fresh full-width page on its own.

void
selectRegionAtY(float $y)

Select the (top-to-bottom ordered) writable region of the current page whose vertical span contains $y, so a flow that starts at the cursor begins in the right band. Falls back to the first region when $y sits above them all.

float
noWriteBandFromHtml(string $html)

Band height (one writable slice) for a no-write region flow of HTML: the cell height of the body (outermost) font size declared in the fragment, falling back to the current font. A slice should be about one body line tall so the bands hug the obstacle without wasting vertical space (which would push too much text onto the continuation page); larger inline runs sit in the tall merged region at the top rather than at a band boundary.

ImageSVG($_file, $_x = null, $_y = null, $_w = 0, $_h = 0, $_link = '', $_align = '', $_palign = '', $_border = 0, $_fitonpage = false)

No description

Details

__construct($_orientation = 'P', $_unit = 'mm', $_format = 'A4', $_unicode = true, $_encoding = 'UTF-8', $_diskcache = false, $_pdfa = false)

No description

Parameters

$_orientation
$_unit
$_format
$_unicode
$_encoding
$_diskcache
$_pdfa

__destruct()

No description

__get($name)

Legacy protected properties historically read by TCPDF subclasses (e.g. $this->AutoPageBreak, $this->lMargin), mapped to facade state.

Parameters

$name

__isset($name)

No description

Parameters

$name

See also

__get()

protected void engineInit(string $unit)

Create (or re-create) the tc-lib-pdf engine for the given unit.

Parameters

string $unit

Return Value

void

protected string ambientPageContent()

Raw PDF operators for the ambient text state that must open every page content stream: the engine re-emits the current font (carrying its spacing/stretching) when it adds a page, so the facade only needs to carry the legacy text color across page breaks.

Return Value

string

protected array fileAllowedPaths()

Local paths the engine may read files from. The legacy API loaded images and fonts from application-relative locations, so in addition to the engine defaults this allows the configured TCPDF paths, the current working directory and the running script directory.

Applications may extend this allowlist with the K_ALLOWED_PATHS configuration constant (array of path prefixes): its entries are merged on top of the built-in defaults, never replacing them.

Return Value

array

protected array fileOptions()

Assemble the file-access options handed to the engine's shared file helper (tc-lib-file). These drive the upstream security sandbox that governs which local paths and remote hosts external resources (images, fonts, SVG, ...) may be loaded from.

The mapping is configuration-driven:

  • allowedPaths <- built-in defaults + K_ALLOWED_PATHS (local reads)
  • allowedHosts <- K_ALLOWED_HOSTS (remote HTTP/HTTPS reads; empty disables remote loading entirely — the safe default)
  • maxRemoteSize <- K_MAX_REMOTE_SIZE (byte cap on remote downloads)
  • curlopts <- K_CURLOPTS (per-request cURL overrides)

Only explicitly configured keys are forwarded; anything omitted keeps the upstream library's secure defaults.

Return Value

array

protected Tcpdf engine()

Return the engine instance.

Return Value

Tcpdf

protected void emitToPage(string $content)

Append raw PDF content to the current page (no-op when no page exists).

Parameters

string $content

Return Value

void

protected string normalizeOrientation(mixed $orientation)

Normalize a legacy orientation value to 'P' or 'L'.

Parameters

mixed $orientation

Return Value

string

protected string normalizePdfaMode(mixed $pdfa)

Map the legacy $pdfa constructor flag onto an engine conformance mode.

Parameters

mixed $pdfa

Return Value

string

protected array buildPageData(mixed $orientation, mixed $format)

Build the engine page data array for a new page.

Parameters

mixed $orientation
mixed $format

Return Value

array

protected string colorSpecFromLegacy(mixed $color)

Convert a legacy color definition (component list or array) to an engine color specification string.

Legacy conventions: 1 component = grayscale 0-255; 3 components = RGB 0-255; 4 components = CMYK 0-100; 5th component = spot color name.

Parameters

mixed $color

Return Value

string

protected string colorSpecFromComponents(mixed $col1, mixed $col2, mixed $col3, mixed $col4, string $name)

Convert legacy color components (setColor-style) to a spec string.

Parameters

mixed $col1
mixed $col2
mixed $col3
mixed $col4
string $name

Return Value

string

protected array legacyColorComponents(mixed $color, array $default)

Sanitize a legacy color component array (numbers, optional spot name).

Parameters

mixed $color
array $default

Fallback components.

Return Value

array

protected array currentLineStyle()

Current line style as an engine style array (lineWidth, lineColor, ...).

Return Value

array

protected array stylesFromLegacyBorder(mixed $border, bool $fill)

Build the engine per-side styles array from a legacy border argument.

Parameters

mixed $border

0/false = none, 1/true = full frame, string with letters L,T,R,B = specific sides, array of side => style = per-side styles.

bool $fill

Return Value

array

protected array legacyBorderCellMetrics(mixed $border)

Mirror legacy adjustCellPadding(): a cell border reserves a minimum cell padding so the stroke does not overlap the text, and the optional position mode decides how much of the stroke falls inside the cell box:

  • ext : the whole stroke is painted outside -> 0 padding, the border rectangle grows outward;
  • int : the whole stroke is painted inside -> a full line-width padding, the border rectangle shrinks inward;
  • normal : the stroke straddles the edge -> half line-width.

The derived padding only ever increases the current cell padding (it never shrinks it) and grows the auto cell height exactly like legacy.

Parameters

mixed $border

Return Value

array

protected array styleFromLegacyLineStyle(array $style)

Convert a legacy line style array (width, cap, join, dash, phase, color) to an engine style array.

Parameters

array $style

Legacy style array.

Return Value

array

protected string shapeModeFromLegacy(mixed $style, bool $hasfill, bool $close = false)

Map a legacy shape style letter combination to an engine paint mode.

Parameters

mixed $style
bool $hasfill
bool $close

Return Value

string

protected array shapeStyleFromLegacy(mixed $linestyle, mixed $fillcolor)

Build the engine style for a legacy (line_style, fill_color) pair.

The legacy drawing methods PERSIST these parameters: a style array updates the current line style and a fill color array updates the current fill color (subsequent shapes inherit them).

Parameters

mixed $linestyle
mixed $fillcolor

Return Value

array

protected array segmentStylesFromLegacy(mixed $linestyle, mixed $fillcolor)

Convert a legacy per-segment/per-side style list to engine styles.

Integer 0 entries mean "do not draw this segment".

Parameters

mixed $linestyle
mixed $fillcolor

Return Value

array

protected float coordOrCursor(mixed $value, bool $vertical)

Resolve a legacy optional coordinate ('' or null means current position).

Parameters

mixed $value
bool $vertical

Return Value

float

protected array completeSideStyles(array $styles)

Complete partial per-side styles with the current graph style defaults (the engine HTML renderer requires fully-populated style arrays).

Parameters

array $styles

Return Value

array

protected void breakIfNeeded(float $height)

Trigger an automatic page break when the given height does not fit.

Parameters

float $height

Return Value

void

protected void advanceToNextPage()

Move to the top of the next page for an automatic break, reusing an already-created page when one exists.

Legacy startPage() reuses the next page (if numpages > page: page++) instead of always appending, so a cell the caller placed back on an earlier page (e.g. the MultiRow pattern of example_020, which writes the two columns at the same Y on the start page) still breaks onto the single shared continuation page rather than spawning a fresh one. The current abscissa is preserved across the break, like breakIfNeeded().

Return Value

void

protected string valignToEngine(mixed $valign)

Map a legacy text vertical alignment letter to the engine convention.

Parameters

mixed $valign

Return Value

string

protected float cellCalignShift(string $calign, string $valign, float $height)

Legacy $calign cell vertical alignment: the amount (user units) by which the cell box top is shifted UP relative to the current text line. The font-relative modes (A/L/D) depend on $valign, mirroring getCellCode().

Parameters

string $calign
string $valign
float $height

Return Value

float

protected string halignToEngine(mixed $align)

Map a legacy horizontal alignment letter to the engine convention.

Parameters

mixed $align

Return Value

string

protected array engineOutlines()

Bookmark outline entries collected by the engine.

Return Value

array

protected void setEngineOutlines(array $outlines)

Replace the engine bookmark outline entries (used to remap page targets after the TOC pages are relocated).

Parameters

array $outlines

Return Value

void

protected void applyHtmlTextShadow(int $pid, int $start)

Emulate the legacy text shadow for engine-rendered HTML content.

The engine HTML renderer has no shadow support, so the text objects (BT..ET blocks) of the freshly rendered chunks are duplicated into an offset, shadow-colored, alpha-blended layer painted underneath.

Parameters

int $pid
int $start

Return Value

void

protected float pageContentImageBottom(int $pid, int $start, float $fallback)

Lowest bottom edge (user units from the page top) of the images placed in the content chunks appended after the given index.

Image placements carry their position in the CTM: "w 0 0 h x y cm /IMGn Do" with y = bottom edge in PDF coordinates.

Parameters

int $pid
int $start
float $fallback

Return Value

float

protected int pageContentCount(int $pid)

Number of raw content chunks of the given engine page.

Parameters

int $pid

Return Value

int

protected void movePageContentToFront(int $pid, int $start)

Move the content chunks appended after the given index to the front of the page stream, so they paint behind the page body. Used for deferred header rendering: the legacy engine painted headers at page-start time, i.e. under the body content.

Parameters

int $pid
int $start

Return Value

void

protected int cellBBoxCount()

Number of entries currently on the engine cell bounding-box stack.

Return Value

int

protected float cellBBoxBottomSince(int $start, float $fallback)

Lowest bottom edge (user units) among the cell bounding boxes pushed on the engine stack after the given index.

Parameters

int $start
float $fallback

Return Value

float

protected string cellBoxOutput(float $posx, float $posy, float $width, float $height, array $styles, bool $fill)

PDF code for a cell background fill and the requested border sides.

Parameters

float $posx
float $posy
float $width
float $height
array $styles
bool $fill

Return Value

string

protected void drawHtmlCellSegments(float $posx, float $width, float $starty, float $bottom, int $startpage, int $contentstart, array $styles, bool $fill, int|null $endpage = null)

Draw the per-page border/fill segments of an auto-height HTML cell that flowed across pages (the engine skips the cell box in that case).

Legacy MultiCell splits the frame at each break in open-cell mode: the segment before a page break has no bottom edge and runs to the break trigger, the segment after it has no top edge and restarts from the top margin. Each segment is inserted behind its page content.

Parameters

float $posx
float $width
float $starty
float $bottom
int $startpage
int $contentstart
array $styles
bool $fill
int|null $endpage

Last page the cell content actually reached. Defaults to the current page; callers pass an explicit value when the engine advanced the page pointer past the cell's real end (see MultiCell).

Return Value

void

protected void insertPageContent(int $pid, int $start, string $content)

Insert a PDF content chunk at the given position of an engine page content stream, so it paints behind the chunks that follow it.

Parameters

int $pid
int $start
string $content

Return Value

void

protected string stretchedCellText(int $mode, string $txt, float $width, float $height, float $textw, string $valign, array|null $shadow)

PDF code for a stretched cell text run (legacy Cell stretch modes).

Modes 1/2 scale the glyphs horizontally (via a CTM transform around the text anchor); modes 3/4 adjust the character spacing (via a Tc operator). The engine renders the text at its NATURAL width (the font stack is neutralised for this run), so its line splitting never triggers, and the ambient spacing/stretching plus the fit transform are emitted here as self-contained text-state operators.

Parameters

int $mode
string $txt
float $width
float $height
float $textw
string $valign
array|null $shadow

Return Value

string

protected void refreshFontState()

Re-apply the current font to the engine font stack so it carries the up-to-date spacing/stretching.

The engine reads spacing (points) and stretching (ratio) from the current font and emits the matching Tc/Tz operators (with their resets) per text run, so changing them only needs to refresh the stacked font; the font selection (Tf) is unchanged and need not be re-emitted.

Return Value

void

protected float naturalOrdWidth(string $txt)

Raw PDF code that renders the current font's natural (unstretched, unspaced) measurement of the given text width in user units.

Used by the legacy Cell stretch modes, whose fit math is expressed against the natural glyph widths while the engine font stack already carries the ambient spacing/stretching.

Parameters

string $txt

Return Value

float

protected array|null engineShadow()

Current engine text shadow array (or null when disabled).

Return Value

array|null

protected string forcedTextDir()

Forced text direction for the engine ('' = inherit document direction).

Return Value

string

protected string resolveLocalFile(string $file)

Canonicalize a local file path before handing it to the engine.

The engine file helper rejects paths containing '..' components for security; the legacy API accepted them, so resolve local paths first.

Parameters

string $file

Return Value

string

Register an external link annotation for the given rectangle.

Parameters

mixed $link
float $posx
float $posy
float $width
float $height

Return Value

void

protected void decorateAllPages()

Render the deferred page decorations (headers and footers) on every page. Called once when the document is closed: at that time the total page count is known, so the default footer can print real numbers.

Return Value

void

setPageUnit($_unit)

No description

Parameters

$_unit

setPageOrientation($_orientation, $_autopagebreak = null, $_bottommargin = null)

No description

Parameters

$_orientation
$_autopagebreak
$_bottommargin

setSpacesRE($_re = '/[^\S\xa0]/')

No description

Parameters

$_re

setRTL($_enable, $_resetx = true)

No description

Parameters

$_enable
$_resetx

bool getRTL()

No description

Return Value

bool

Current RTL document direction.

setTempRTL($_mode)

No description

Parameters

$_mode

bool isRTLTextDir()

No description

Return Value

bool

True when the current text direction is right-to-left.

setLastH($_h)

No description

Parameters

$_h

float getCellHeight(int|float $_fontsize, bool $_padding = true)

Return the cell height for the given font size.

Parameters

int|float $_fontsize

Font size in user units.

bool $_padding

When true include the top and bottom cell padding.

Return Value

float

Cell height in user units.

resetLastH()

No description

float getLastH()

No description

Return Value

float

Height of the last printed cell in user units.

setImageScale($_scale)

No description

Parameters

$_scale

float getImageScale()

No description

Return Value

float

Image scale ratio.

getPageDimensions($_pagenum = null)

No description

Parameters

$_pagenum

float getPageWidth(int|null $_pagenum = null)

Return the page width in user units.

Parameters

int|null $_pagenum

Page number (1-based) or null for the current page.

Return Value

float

Page width in user units.

float getPageHeight(int|null $_pagenum = null)

Return the page height in user units.

Parameters

int|null $_pagenum

Page number (1-based) or null for the current page.

Return Value

float

Page height in user units.

float getBreakMargin(int|null $_pagenum = null)

Return the automatic page-break bottom margin.

Parameters

int|null $_pagenum

Page number (1-based) or null for the current page.

Return Value

float

Break margin in user units.

float getScaleFactor()

No description

Return Value

float

Document scale factor (number of points in user unit).

setMargins($_left, $_top, $_right = null, $_keepmargins = false)

No description

Parameters

$_left
$_top
$_right
$_keepmargins

setLeftMargin($_margin)

No description

Parameters

$_margin

setTopMargin($_margin)

No description

Parameters

$_margin

setRightMargin($_margin)

No description

Parameters

$_margin

setCellPadding($_pad)

No description

Parameters

$_pad

setCellPaddings($_left = null, $_top = null, $_right = null, $_bottom = null)

No description

Parameters

$_left
$_top
$_right
$_bottom

array{L: float, T: float, R: float, B: float} getCellPaddings()

No description

Return Value

array{L: float, T: float, R: float, B: float}

Cell padding in user units.

setCellMargins($_left = null, $_top = null, $_right = null, $_bottom = null)

No description

Parameters

$_left
$_top
$_right
$_bottom

array{L: float, T: float, R: float, B: float} getCellMargins()

No description

Return Value

array{L: float, T: float, R: float, B: float}

Cell margins in user units.

setAutoPageBreak($_auto, $_margin = 0)

No description

Parameters

$_auto
$_margin

bool getAutoPageBreak()

No description

Return Value

bool

Automatic page break state.

setDisplayMode($_zoom, $_layout = 'SinglePage', $_mode = 'UseNone')

No description

Parameters

$_zoom
$_layout
$_mode

setCompression($_compress = true)

No description

Parameters

$_compress

setSRGBmode($_mode = false)

No description

Parameters

$_mode

setDocInfoUnicode($_unicode = true)

No description

Parameters

$_unicode

setTitle($_title)

No description

Parameters

$_title

setSubject($_subject)

No description

Parameters

$_subject

setAuthor($_author)

No description

Parameters

$_author

setKeywords($_keywords)

No description

Parameters

$_keywords

setCreator($_creator)

No description

Parameters

$_creator

setAllowLocalFiles($_allowLocalFiles)

No description

Parameters

$_allowLocalFiles

Error($_msg)

No description

Parameters

$_msg

Open()

No description

Close()

No description

protected void applyBookmarkDisplayMode()

Match legacy TCPDF: when bookmark outlines are present the document opens with the outline (bookmark) panel visible (/PageMode /UseOutlines).

The engine only promotes the page mode to UseOutlines when it is the empty string, but the default mode is UseNone, so that promotion never fires on its own. Apply it here from the facade, preserving the tracked zoom and layout, unless the user explicitly selected a non-default display mode.

Return Value

void

setPage($_pnum, $_resetmargins = false)

No description

Parameters

$_pnum
$_resetmargins

lastPage($_resetmargins = false)

No description

Parameters

$_resetmargins

int getPage()

No description

Return Value

int

Current page number (1-based, 0 when no page exists).

int getNumPages()

No description

Return Value

int

Total number of pages.

addTOCPage($_orientation = '', $_format = '', $_keepmargins = false)

No description

Parameters

$_orientation
$_format
$_keepmargins

endTOCPage()

No description

AddPage($_orientation = '', $_format = '', $_keepmargins = false, $_tocpage = false)

No description

Parameters

$_orientation
$_format
$_keepmargins
$_tocpage

endPage($_tocpage = false)

No description

Parameters

$_tocpage

startPage($_orientation = '', $_format = '', $_tocpage = false)

No description

Parameters

$_orientation
$_format
$_tocpage

setPageMark()

No description

setHeaderData($_ln = '', $_lw = 0, $_ht = '', $_hs = '', $_tc = [0, 0, 0], $_lc = [0, 0, 0])

No description

Parameters

$_ln
$_lw
$_ht
$_hs
$_tc
$_lc

setFooterData($_tc = [0, 0, 0], $_lc = [0, 0, 0])

No description

Parameters

$_tc
$_lc

array{logo: string, logo_width: float, title: string, string: string, text_color: array<int, float|int|string>, line_color: array<int, float|int|string>} getHeaderData()

No description

Return Value

array{logo: string, logo_width: float, title: string, string: string, text_color: array<int, float|int|string>, line_color: array<int, float|int|string>}

Header data.

setHeaderMargin($_hm = 10)

No description

Parameters

$_hm

float getHeaderMargin()

No description

Return Value

float

Header margin in user units.

setFooterMargin($_fm = 10)

No description

Parameters

$_fm

float getFooterMargin()

No description

Return Value

float

Footer margin in user units.

setPrintHeader($_val = true)

No description

Parameters

$_val

setPrintFooter($_val = true)

No description

Parameters

$_val

float getImageRBX()

No description

Return Value

float

Right-bottom X coordinate of the last inserted image.

float getImageRBY()

No description

Return Value

float

Right-bottom Y coordinate of the last inserted image.

resetHeaderTemplate()

No description

setHeaderTemplateAutoreset($_val = true)

No description

Parameters

$_val

Header()

No description

No description

int PageNo()

No description

Return Value

int

Current page number.

getAllSpotColors()

No description

AddSpotColor($_name, $_c, $_m, $_y, $_k)

No description

Parameters

$_name
$_c
$_m
$_y
$_k

setSpotColor($_type, $_name, $_tint = 100)

No description

Parameters

$_type
$_name
$_tint

setDrawSpotColor($_name, $_tint = 100)

No description

Parameters

$_name
$_tint

setFillSpotColor($_name, $_tint = 100)

No description

Parameters

$_name
$_tint

setTextSpotColor($_name, $_tint = 100)

No description

Parameters

$_name
$_tint

setColorArray($_type, $_color, $_ret = false)

No description

Parameters

$_type
$_color
$_ret

setDrawColorArray($_color, $_ret = false)

No description

Parameters

$_color
$_ret

setFillColorArray($_color, $_ret = false)

No description

Parameters

$_color
$_ret

setTextColorArray($_color, $_ret = false)

No description

Parameters

$_color
$_ret

setColor($_type, $_col1 = 0, $_col2 = -1, $_col3 = -1, $_col4 = -1, $_ret = false, $_name = '')

No description

Parameters

$_type
$_col1
$_col2
$_col3
$_col4
$_ret
$_name

setDrawColor($_col1 = 0, $_col2 = -1, $_col3 = -1, $_col4 = -1, $_ret = false, $_name = '')

No description

Parameters

$_col1
$_col2
$_col3
$_col4
$_ret
$_name

setFillColor($_col1 = 0, $_col2 = -1, $_col3 = -1, $_col4 = -1, $_ret = false, $_name = '')

No description

Parameters

$_col1
$_col2
$_col3
$_col4
$_ret
$_name

setTextColor($_col1 = 0, $_col2 = -1, $_col3 = -1, $_col4 = -1, $_ret = false, $_name = '')

No description

Parameters

$_col1
$_col2
$_col3
$_col4
$_ret
$_name

float|array<int, float> GetStringWidth(string $_s, string $_fontname = '', string $_fontstyle = '', int|float $_fontsize = 0, bool $_getarray = false)

Return the length of a string in user units.

Parameters

string $_s

Input string.

string $_fontname

Optional family to measure with (default: current font).

string $_fontstyle

Optional font style.

int|float $_fontsize

Optional font size in points.

bool $_getarray

When true return an array of per-character widths.

Return Value

float|array<int, float>

Total width, or per-character widths.

float|array<int, float> GetArrStringWidth(array<int, int|string> $_sa, string $_fontname = '', string $_fontstyle = '', int|float $_fontsize = 0, bool $_getarray = false)

Return the width of a character array in user units.

Parameters

array<int, int|string> $_sa

Characters (codepoints or strings).

string $_fontname

Optional family to measure with (default: current font).

string $_fontstyle

Optional font style.

int|float $_fontsize

Optional font size in points.

bool $_getarray

When true return an array of per-character widths.

Return Value

float|array<int, float>

Total width, or per-character widths.

GetCharWidth($_char, $_notlast = true)

No description

Parameters

$_char
$_notlast

float getRawCharWidth(int|string $_char)

No description

Parameters

int|string $_char

Character codepoint or string.

Return Value

float

Character width in user units.

GetNumChars($_s)

No description

Parameters

$_s

AddFont($_family, $_style = '', $_fontfile = '', $_subset = 'default')

No description

Parameters

$_family
$_style
$_fontfile
$_subset

setFont($_family, $_style = '', $_size = null, $_fontfile = '', $_subset = 'default', $_out = true)

No description

Parameters

$_family
$_style
$_size
$_fontfile
$_subset
$_out

setFontSize($_size, $_out = true)

No description

Parameters

$_size
$_out

getFontBBox()

No description

getAbsFontMeasure($_s)

No description

Parameters

$_s

getCharBBox($_char)

No description

Parameters

$_char

getFontDescent($_font, $_style = '', $_size = 0)

No description

Parameters

$_font
$_style
$_size

getFontAscent($_font, $_style = '', $_size = 0)

No description

Parameters

$_font
$_style
$_size

isCharDefined($_char, $_font = '', $_style = '')

No description

Parameters

$_char
$_font
$_style

replaceMissingChars($_text, $_font = '', $_style = '', $_subs = [])

No description

Parameters

$_text
$_font
$_style
$_subs

setDefaultMonospacedFont($_font)

No description

Parameters

$_font

No description

No description

Parameters

$_link
$_y
$_page

No description

Parameters

$_x
$_y
$_w
$_h
$_link
$_spaces

Annotation($_x, $_y, $_w, $_h, $_text, $_opt = ['Subtype' => 'Text'], $_spaces = 0)

No description

Parameters

$_x
$_y
$_w
$_h
$_text
$_opt
$_spaces

EmbedFile($_opt)

No description

Parameters

$_opt

EmbedFileFromString($_filename, $_content)

No description

Parameters

$_filename
$_content

Text($_x, $_y, $_txt, $_fstroke = 0, $_fclip = false, $_ffill = true, $_border = 0, $_ln = 0, $_align = '', $_fill = false, $_link = '', $_stretch = 0, $_ignore_min_height = false, $_calign = 'T', $_valign = 'M', $_rtloff = false)

No description

Parameters

$_x
$_y
$_txt
$_fstroke
$_fclip
$_ffill
$_border
$_ln
$_align
$_fill
$_link
$_stretch
$_ignore_min_height
$_calign
$_valign
$_rtloff

bool AcceptPageBreak()

No description

Return Value

bool

True when an automatic page break is allowed.

Cell($_w, $_h = 0, $_txt = '', $_border = 0, $_ln = 0, $_align = '', $_fill = false, $_link = '', $_stretch = 0, $_ignore_min_height = false, $_calign = 'T', $_valign = 'M')

No description

Parameters

$_w
$_h
$_txt
$_border
$_ln
$_align
$_fill
$_link
$_stretch
$_ignore_min_height
$_calign
$_valign

MultiCell($_w, $_h, $_txt, $_border = 0, $_align = 'J', $_fill = false, $_ln = 1, $_x = null, $_y = null, $_reseth = true, $_stretch = 0, $_ishtml = false, $_autopadding = true, $_maxh = 0, $_valign = 'T', $_fitcell = false)

No description

Parameters

$_w
$_h
$_txt
$_border
$_align
$_fill
$_ln
$_x
$_y
$_reseth
$_stretch
$_ishtml
$_autopadding
$_maxh
$_valign
$_fitcell

int getNumLines($_txt, $_w = 0, $_reseth = false, $_autopadding = true, $_cellpadding = null, $_border = 0)

Estimate the number of lines needed to print the given text.

Parameters

$_txt
$_w
$_reseth
$_autopadding
$_cellpadding
$_border

Return Value

int

Estimated number of lines.

getStringHeight($_w, $_txt, $_reseth = false, $_autopadding = true, $_cellpadding = null, $_border = 0)

No description

Parameters

$_w
$_txt
$_reseth
$_autopadding
$_cellpadding
$_border

protected string preserveBlankLines(string $txt)

Fill the empty lines of a multi-line text with a single space.

The engine drops empty lines from the rendered output: a line with no characters produces no text operator and no bounding-box advance, so consecutive line breaks collapse into one. The legacy API preserves each empty line as a full line feed, so give every empty line a single (invisible) space character to force the engine to render and advance past it. Line counting is unaffected: the engine already counts empty lines when measuring the cell, only their rendering position is lost.

Parameters

string $txt

Return Value

string

protected array legacyRowPitch(float $pitch, bool $withpadding = false)

Map the legacy text row pitch onto the engine text-cell inputs.

Legacy rendering emits every text line as a cell at least getCellHeight() tall with the text vertically centered in it, while the engine stacks the lines at the bare font metric height below the cell top. The extra leading between the rows becomes the engine inter-line space and half of it (the centering of the first line inside its row) is added to the cell top padding.

Parameters

float $pitch

Row pitch in user units (the caller resolves the legacy minimum cell height).

bool $withpadding

When true the cell carries the legacy cell padding and margins (MultiCell); when false the rows span the whole cell like legacy Write().

Return Value

array

Engine inter-line space in user units and cell definition (in internal points).

Write($_h, $_txt, $_link = '', $_fill = false, $_align = '', $_ln = false, $_stretch = 0, $_firstline = false, $_firstblock = false, $_maxh = 0, $_wadj = 0, $_margin = null)

No description

Parameters

$_h
$_txt
$_link
$_fill
$_align
$_ln
$_stretch
$_firstline
$_firstblock
$_maxh
$_wadj
$_margin

protected array currentFontMetric()

Return the current font metric array (inserting the default when missing).

Return Value

array

Image($_file, $_x = null, $_y = null, $_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 = [])

No description

Parameters

$_file
$_x
$_y
$_w
$_h
$_type
$_link
$_align
$_resize
$_dpi
$_palign
$_ismask
$_imgmask
$_border
$_fitbox
$_hidden
$_fitonpage
$_alt
$_altimgs

protected string|null mergeImageAlphaMask(string $basefile, string $maskfile)

Apply a legacy 8-bit soft mask to an image by writing it into the image's alpha channel, then return the merged PNG content. The engine's import path then splits that alpha back out into a /SMask (the only soft-mask mechanism tc-lib-pdf-image exposes), reproducing legacy's separate-mask Image() call. Returns null when the images cannot be read (caller falls back to the unmasked file).

Mask polarity follows the PDF soft-mask convention used by legacy: a white mask pixel is fully opaque, a black one fully transparent.

Parameters

string $basefile
string $maskfile

Return Value

string|null

protected array imagePixelSize(string $file)

Return the pixel size of an image file or '@'-prefixed data stream.

Parameters

string $file

Return Value

array

Width and height in pixels (0 when unknown).

Ln($_h = null, $_cell = false)

No description

Parameters

$_h
$_cell

float GetX()

No description

Return Value

float

Relative X coordinate of the cursor in user units.

float GetAbsX()

No description

Return Value

float

Absolute X coordinate of the cursor in user units.

float GetY()

No description

Return Value

float

Y coordinate of the cursor in user units.

setX($_x, $_rtloff = false)

No description

Parameters

$_x
$_rtloff

setY($_y, $_resetx = true, $_rtloff = false)

No description

Parameters

$_y
$_resetx
$_rtloff

setXY($_x, $_y, $_rtloff = false)

No description

Parameters

$_x
$_y
$_rtloff

setAbsX($_x)

No description

Parameters

$_x

setAbsY($_y)

No description

Parameters

$_y

setAbsXY($_x, $_y)

No description

Parameters

$_x
$_y

Output($_name = 'doc.pdf', $_dest = 'I')

No description

Parameters

$_name
$_dest

getPDFData()

No description

setExtraXMP($_xmp)

No description

Parameters

$_xmp

setExtraXMPRDF($_xmp)

No description

Parameters

$_xmp

setExtraXMPPdfaextension($_xmp)

No description

Parameters

$_xmp

setDocCreationTimestamp($_time)

No description

Parameters

$_time

setDocModificationTimestamp($_time)

No description

Parameters

$_time

getDocCreationTimestamp()

No description

getDocModificationTimestamp()

No description

setHeaderFont($_font)

No description

Parameters

$_font

array{0: string, 1: string, 2: float} getHeaderFont()

No description

Return Value

array{0: string, 1: string, 2: float}

Header font: family, style, size in points.

setFooterFont($_font)

No description

Parameters

$_font

array{0: string, 1: string, 2: float} getFooterFont()

No description

Return Value

array{0: string, 1: string, 2: float}

Footer font: family, style, size in points.

setLanguageArray($_language)

No description

Parameters

$_language

No description

Parameters

$_url
$_name
$_fill
$_firstline
$_color
$_style
$_firstblock

pixelsToUnits($_px)

No description

Parameters

$_px

unhtmlentities($_text_to_convert)

No description

Parameters

$_text_to_convert

setProtection($_permissions = ['print', 'modify', 'copy', 'annot-forms', 'fill-forms', 'extract', 'assemble', 'print-high'], $_user_pass = '', $_owner_pass = null, $_mode = 0, $_pubkeys = null)

No description

Parameters

$_permissions
$_user_pass
$_owner_pass
$_mode
$_pubkeys

StartTransform()

No description

StopTransform()

No description

ScaleX($_s_x, $_x = '', $_y = '')

No description

Parameters

$_s_x
$_x
$_y

ScaleY($_s_y, $_x = '', $_y = '')

No description

Parameters

$_s_y
$_x
$_y

ScaleXY($_s, $_x = '', $_y = '')

No description

Parameters

$_s
$_x
$_y

Scale($_s_x, $_s_y, $_x = null, $_y = null)

No description

Parameters

$_s_x
$_s_y
$_x
$_y

MirrorH($_x = null)

No description

Parameters

$_x

MirrorV($_y = null)

No description

Parameters

$_y

MirrorP($_x = null, $_y = null)

No description

Parameters

$_x
$_y

MirrorL($_angle = 0, $_x = null, $_y = null)

No description

Parameters

$_angle
$_x
$_y

TranslateX($_t_x)

No description

Parameters

$_t_x

TranslateY($_t_y)

No description

Parameters

$_t_y

Translate($_t_x, $_t_y)

No description

Parameters

$_t_x
$_t_y

Rotate($_angle, $_x = null, $_y = null)

No description

Parameters

$_angle
$_x
$_y

SkewX($_angle_x, $_x = null, $_y = null)

No description

Parameters

$_angle_x
$_x
$_y

SkewY($_angle_y, $_x = null, $_y = null)

No description

Parameters

$_angle_y
$_x
$_y

Skew($_angle_x, $_angle_y, $_x = null, $_y = null)

No description

Parameters

$_angle_x
$_angle_y
$_x
$_y

setLineWidth($_width)

No description

Parameters

$_width

float GetLineWidth()

No description

Return Value

float

Current line width in user units.

setLineStyle($_style, $_ret = false)

No description

Parameters

$_style
$_ret

Line($_x1, $_y1, $_x2, $_y2, $_style = [])

No description

Parameters

$_x1
$_y1
$_x2
$_y2
$_style

Rect($_x, $_y, $_w, $_h, $_style = '', $_border_style = [], $_fill_color = [])

No description

Parameters

$_x
$_y
$_w
$_h
$_style
$_border_style
$_fill_color

Curve($_x0, $_y0, $_x1, $_y1, $_x2, $_y2, $_x3, $_y3, $_style = '', $_line_style = [], $_fill_color = [])

No description

Parameters

$_x0
$_y0
$_x1
$_y1
$_x2
$_y2
$_x3
$_y3
$_style
$_line_style
$_fill_color

Polycurve($_x0, $_y0, $_segments, $_style = '', $_line_style = [], $_fill_color = [])

No description

Parameters

$_x0
$_y0
$_segments
$_style
$_line_style
$_fill_color

Ellipse($_x0, $_y0, $_rx, $_ry = 0, $_angle = 0, $_astart = 0, $_afinish = 360, $_style = '', $_line_style = [], $_fill_color = [], $_nc = 2)

No description

Parameters

$_x0
$_y0
$_rx
$_ry
$_angle
$_astart
$_afinish
$_style
$_line_style
$_fill_color
$_nc

Circle($_x0, $_y0, $_r, $_angstr = 0, $_angend = 360, $_style = '', $_line_style = [], $_fill_color = [], $_nc = 2)

No description

Parameters

$_x0
$_y0
$_r
$_angstr
$_angend
$_style
$_line_style
$_fill_color
$_nc

PolyLine($_p, $_style = '', $_line_style = [], $_fill_color = [])

No description

Parameters

$_p
$_style
$_line_style
$_fill_color

Polygon($_p, $_style = '', $_line_style = [], $_fill_color = [], $_closed = true)

No description

Parameters

$_p
$_style
$_line_style
$_fill_color
$_closed

RegularPolygon($_x0, $_y0, $_r, $_ns, $_angle = 0, $_draw_circle = false, $_style = '', $_line_style = [], $_fill_color = [], $_circle_style = '', $_circle_outLine_style = [], $_circle_fill_color = [])

No description

Parameters

$_x0
$_y0
$_r
$_ns
$_angle
$_draw_circle
$_style
$_line_style
$_fill_color
$_circle_style
$_circle_outLine_style
$_circle_fill_color

StarPolygon($_x0, $_y0, $_r, $_nv, $_ng, $_angle = 0, $_draw_circle = false, $_style = '', $_line_style = [], $_fill_color = [], $_circle_style = '', $_circle_outLine_style = [], $_circle_fill_color = [])

No description

Parameters

$_x0
$_y0
$_r
$_nv
$_ng
$_angle
$_draw_circle
$_style
$_line_style
$_fill_color
$_circle_style
$_circle_outLine_style
$_circle_fill_color

RoundedRect($_x, $_y, $_w, $_h, $_r, $_round_corner = '1111', $_style = '', $_border_style = [], $_fill_color = [])

No description

Parameters

$_x
$_y
$_w
$_h
$_r
$_round_corner
$_style
$_border_style
$_fill_color

RoundedRectXY($_x, $_y, $_w, $_h, $_rx, $_ry, $_round_corner = '1111', $_style = '', $_border_style = [], $_fill_color = [])

No description

Parameters

$_x
$_y
$_w
$_h
$_rx
$_ry
$_round_corner
$_style
$_border_style
$_fill_color

Arrow($_x0, $_y0, $_x1, $_y1, $_head_style = 0, $_arm_size = 5, $_arm_angle = 15)

No description

Parameters

$_x0
$_y0
$_x1
$_y1
$_head_style
$_arm_size
$_arm_angle

setDestination($_name, $_y = -1, $_page = '', $_x = -1)

No description

Parameters

$_name
$_y
$_page
$_x

getDestination()

No description

setBookmark($_txt, $_level = 0, $_y = -1, $_page = '', $_style = '', $_color = [0, 0, 0], $_x = -1, $_link = '')

No description

Parameters

$_txt
$_level
$_y
$_page
$_style
$_color
$_x
$_link

Bookmark($_txt, $_level = 0, $_y = -1, $_page = '', $_style = '', $_color = [0, 0, 0], $_x = -1, $_link = '')

No description

Parameters

$_txt
$_level
$_y
$_page
$_style
$_color
$_x
$_link

IncludeJS($_script)

No description

Parameters

$_script

addJavascriptObject($_script, $_onload = false)

No description

Parameters

$_script
$_onload

setFormDefaultProp($_prop = [])

No description

Parameters

$_prop

getFormDefaultProp()

No description

protected array formFieldValues(mixed $values)

Normalize legacy list/combo values: either a list of strings or a list of [export, display] pairs (the engine requires a homogeneous list).

Parameters

mixed $values

Return Value

array

protected array formFieldOptions(mixed $prop, mixed $opt)

Normalize legacy form-field (prop, opt) pairs for the engine.

Parameters

mixed $prop
mixed $opt

Return Value

array

[opt, jsp]

protected void attachAnnotRef(int $oid)

Attach a freshly created annotation/form-field widget to the current page so the engine emits it in the page's /Annots array.

The engine's addFF*()/setAnnotation()/setLink() methods register the annotation object and return its id, but leave page attachment to the caller (see Com\Tecnick\Pdf\JavaScript::setAnnotation). An id of 0 means the object was not created (e.g. captured by an XObject template or suppressed in PDF/X mode) and must not be referenced.

Parameters

int $oid

Return Value

void

protected void advanceFormFieldX(float $width)

Advance the horizontal cursor after placing a form field, matching the legacy behaviour where each field method shifts the current X position by the field width (RTL-aware). The shift is applied to the live cursor regardless of any explicit x/y override, exactly as legacy TCPDF does.

Parameters

float $width

Return Value

void

TextField($_name, $_w, $_h, $_prop = [], $_opt = [], $_x = null, $_y = null, $_js = false)

No description

Parameters

$_name
$_w
$_h
$_prop
$_opt
$_x
$_y
$_js

RadioButton($_name, $_w, $_prop = [], $_opt = [], $_onvalue = 'On', $_checked = false, $_x = null, $_y = null, $_js = false)

No description

Parameters

$_name
$_w
$_prop
$_opt
$_onvalue
$_checked
$_x
$_y
$_js

ListBox($_name, $_w, $_h, $_values, $_prop = [], $_opt = [], $_x = null, $_y = null, $_js = false)

No description

Parameters

$_name
$_w
$_h
$_values
$_prop
$_opt
$_x
$_y
$_js

ComboBox($_name, $_w, $_h, $_values, $_prop = [], $_opt = [], $_x = null, $_y = null, $_js = false)

No description

Parameters

$_name
$_w
$_h
$_values
$_prop
$_opt
$_x
$_y
$_js

CheckBox($_name, $_w, $_checked = false, $_prop = [], $_opt = [], $_onvalue = 'Yes', $_x = null, $_y = null, $_js = false)

No description

Parameters

$_name
$_w
$_checked
$_prop
$_opt
$_onvalue
$_x
$_y
$_js

Button($_name, $_w, $_h, $_caption, $_action, $_prop = [], $_opt = [], $_x = null, $_y = null, $_js = false)

No description

Parameters

$_name
$_w
$_h
$_caption
$_action
$_prop
$_opt
$_x
$_y
$_js

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 = '')

No description

Parameters

$_enable
$_document
$_annots
$_form
$_signature
$_ef
$_formex

setSignature($_signing_cert = '', $_private_key = '', $_private_key_password = '', $_extracerts = '', $_cert_type = 2, $_info = [], $_approval = '')

No description

Parameters

$_signing_cert
$_private_key
$_private_key_password
$_extracerts
$_cert_type
$_info
$_approval

setSignatureAppearance($_x = 0, $_y = 0, $_w = 0, $_h = 0, $_page = -1, $_name = '')

No description

Parameters

$_x
$_y
$_w
$_h
$_page
$_name

addEmptySignatureAppearance($_x = 0, $_y = 0, $_w = 0, $_h = 0, $_page = -1, $_name = '')

No description

Parameters

$_x
$_y
$_w
$_h
$_page
$_name

setTimeStamp($_tsa_host = '', $_tsa_username = '', $_tsa_password = '', $_tsa_cert = '')

No description

Parameters

$_tsa_host
$_tsa_username
$_tsa_password
$_tsa_cert

startPageGroup($_page = null)

No description

Parameters

$_page

setStartingPageNumber($_num = 1)

No description

Parameters

$_num

string getAliasRightShift()

No description

Return Value

string

Right-shift compensation prefix (unused by the facade).

string getAliasNbPages()

No description

Return Value

string

Total number of pages, or the legacy alias placeholder.

string getAliasNumPage()

No description

Return Value

string

Current page number, or the legacy alias placeholder.

string getPageGroupAlias()

No description

Return Value

string

Total pages in the current group, or the legacy alias placeholder.

string getPageNumGroupAlias()

No description

Return Value

string

Page number in the current group, or the legacy alias placeholder.

int getGroupPageNo()

No description

Return Value

int

Current page number within its page group.

getGroupPageNoFormatted()

No description

PageNoFormatted()

No description

startLayer($_name = '', $_print = true, $_view = true, $_lock = true)

No description

Parameters

$_name
$_print
$_view
$_lock

endLayer()

No description

setVisibility($_v)

No description

Parameters

$_v

setOverprint($_stroking = true, $_nonstroking = null, $_mode = 0)

No description

Parameters

$_stroking
$_nonstroking
$_mode

getOverprint()

No description

setAlpha($_stroking = 1, $_bm = 'Normal', $_nonstroking = null, $_ais = false)

No description

Parameters

$_stroking
$_bm
$_nonstroking
$_ais

protected void registerTemplateExtGState(string $cmd)

Register the ExtGState referenced by the given command with the open XObject template resource dictionary.

Parameters

string $cmd

Return Value

void

getAlpha()

No description

setJPEGQuality($_quality)

No description

Parameters

$_quality

setDefaultTableColumns($_cols = 4)

No description

Parameters

$_cols

setCellHeightRatio($_h)

No description

Parameters

$_h

float getCellHeightRatio()

No description

Return Value

float

Cell height ratio.

setPDFVersion($_version = '1.7')

No description

Parameters

$_version

setViewerPreferences($_preferences)

No description

Parameters

$_preferences

colorRegistrationBar($_x, $_y, $_w, $_h, $_transition = true, $_vertical = false, $_colors = 'A,R,G,B,C,M,Y,K')

No description

Parameters

$_x
$_y
$_w
$_h
$_transition
$_vertical
$_colors

cropMark($_x, $_y, $_w, $_h, $_type = 'T,R,B,L', $_color = [100, 100, 100, 100, 'All'])

No description

Parameters

$_x
$_y
$_w
$_h
$_type
$_color

registrationMark($_x, $_y, $_r, $_double = false, $_cola = [100, 100, 100, 100, 'All'], $_colb = [0, 0, 0, 0, 'None'])

No description

Parameters

$_x
$_y
$_r
$_double
$_cola
$_colb

registrationMarkCMYK($_x, $_y, $_r)

No description

Parameters

$_x
$_y
$_r

LinearGradient($_x, $_y, $_w, $_h, $_col1 = [], $_col2 = [], $_coords = [0, 0, 1, 0])

No description

Parameters

$_x
$_y
$_w
$_h
$_col1
$_col2
$_coords

RadialGradient($_x, $_y, $_w, $_h, $_col1 = [], $_col2 = [], $_coords = [0.5, 0.5, 0.5, 0.5, 1])

No description

Parameters

$_x
$_y
$_w
$_h
$_col1
$_col2
$_coords

CoonsPatchMesh($_x, $_y, $_w, $_h, $_col1 = [], $_col2 = [], $_col3 = [], $_col4 = [], $_coords = [0.0, 0.0, 0.33, 0.0, 0.67, 0.0, 1.0, 0.0, 1.0, 0.33, 1.0, 0.67, 1.0, 1.0, 0.67, 1.0, 0.33, 1.0, 0.0, 1.0, 0.0, 0.67, 0.0, 0.33], $_coords_min = 0, $_coords_max = 1, $_antialias = false)

No description

Parameters

$_x
$_y
$_w
$_h
$_col1
$_col2
$_col3
$_col4
$_coords
$_coords_min
$_coords_max
$_antialias

protected array coonsPatchArray(array $patches)

Convert a legacy Coons patch-mesh array (per-patch 'f', 'points', and 'colors' with 0-255 r/g/b keys) to the engine shape (normalized red/green/blue floats).

Parameters

array $patches

Return Value

array

Gradient($_type, $_coords, $_stops, $_background = [], $_antialias = false)

No description

Parameters

$_type
$_coords
$_stops
$_background
$_antialias

PieSector($_xc, $_yc, $_r, $_a, $_b, $_style = 'FD', $_cw = true, $_o = 90)

No description

Parameters

$_xc
$_yc
$_r
$_a
$_b
$_style
$_cw
$_o

PieSectorXY($_xc, $_yc, $_rx, $_ry, $_a, $_b, $_style = 'FD', $_cw = false, $_o = 0, $_nc = 2)

No description

Parameters

$_xc
$_yc
$_rx
$_ry
$_a
$_b
$_style
$_cw
$_o
$_nc

ImageEps($_file, $_x = null, $_y = null, $_w = 0, $_h = 0, $_link = '', $_useBoundingBox = true, $_align = '', $_palign = '', $_border = 0, $_fitonpage = false, $_fixoutvals = false)

[BREAKING CHANGE] EPS/AI vector import is not supported.

The modern engine has no PostScript interpreter: convert EPS/AI artwork to SVG (e.g. inkscape file.eps --export-filename=file.svg or mutool convert) and use ImageSVG() instead. As a convenience, SVG files passed to this method are dispatched to ImageSVG() and raster files to Image(); EPS/AI input is silently skipped.

Parameters

$_file
$_x
$_y
$_w
$_h
$_link
$_useBoundingBox
$_align
$_palign
$_border
$_fitonpage
$_fixoutvals

setBarcode($_bc = '')

No description

Parameters

$_bc

string getBarcode()

No description

Return Value

string

Document barcode string.

write1DBarcode($_code, $_type, $_x = null, $_y = null, $_w = null, $_h = null, $_xres = null, $_style = [], $_align = '')

No description

Parameters

$_code
$_type
$_x
$_y
$_w
$_h
$_xres
$_style
$_align

write2DBarcode($_code, $_type, $_x = null, $_y = null, $_w = null, $_h = null, $_style = [], $_align = '', $_distort = false)

No description

Parameters

$_code
$_type
$_x
$_y
$_w
$_h
$_style
$_align
$_distort

protected void emitBarcode(string $code, string $type, mixed $posx, mixed $posy, mixed $width, mixed $height, float $xres, mixed $style, string $align, bool $is2d, bool $distort = false)

Render a barcode at the given position via the engine.

Parameters

string $code
string $type
mixed $posx
mixed $posy
mixed $width
mixed $height
float $xres

Width (and height for 2D codes) of a single module in user units, used when no explicit size is given.

mixed $style
string $align
bool $is2d
bool $distort

Return Value

void

protected void drawBarcode1D(string $type, string $code, float $posx, float $posy, mixed $width, mixed $height, float $xres, array $style, string $align, int $maxw, string $fgspec)

Render a 1D barcode with the legacy geometry: bars, the optional human-readable label and the vertical padding all fit inside the requested height (barh = height - text_height - 2*vpadding) instead of the label being appended below it. Bar drawing is delegated to the engine; the box, label and cursor advance mirror write1DBarcode().

Parameters

string $type
string $code
float $posx
float $posy
mixed $width
mixed $height
float $xres
array $style
string $align
int $maxw
string $fgspec

Return Value

void

protected void drawBarcode2D(string $type, string $code, float $posx, float $posy, mixed $width, mixed $height, array $style, string $align, int $cols, int $rows, string $fgspec, bool $distort)

Render a 2D barcode with the legacy geometry: the barcode cells are inset inside the requested box by the (auto) padding quiet-zone and the aspect ratio is preserved unless $distort is set. Mirrors write2DBarcode().

Parameters

string $type
string $code
float $posx
float $posy
mixed $width
mixed $height
array $style
string $align
int $cols
int $rows
string $fgspec
bool $distort

Return Value

void

protected float fitBarcodeBlock(float $posx, float $posy, float $boxh)

Move to the next page when a barcode of the given height would not fit below the current Y, preserving the abscissa. Returns the Y to draw at.

Parameters

float $posx
float $posy
float $boxh

Return Value

float

protected float barcodeBoxX(string $position, float $posx, float $boxw)

Left edge of a barcode box for the legacy position keyword (L/C/R or the current abscissa for the empty/default case).

Parameters

string $position
float $posx
float $boxw

Return Value

float

protected string barcodeBox(float $x, float $y, float $w, float $h, array $style)

Background fill and/or border around a barcode box.

Parameters

float $x
float $y
float $w
float $h
array $style

Return Value

string

protected void advanceAfterBarcode(string $align, string $position, float $posx, float $drawy, float $boxw, float $boxh)

Advance the cursor next to a drawn barcode for the legacy $align value.

Parameters

string $align
string $position
float $posx
float $drawy
float $boxw
float $boxh

Return Value

void

getMargins()

No description

getOriginalMargins()

No description

float getFontSize()

No description

Return Value

float

Current font size in user units.

float getFontSizePt()

No description

Return Value

float

Current font size in points.

string getFontFamily()

No description

Return Value

string

Current font family.

string getFontStyle()

No description

Return Value

string

Current font style letters including decorations.

fixHTMLCode($_html, $_default_css = '', $_tagvs = null, $_tidy_options = null)

No description

Parameters

$_html
$_default_css
$_tagvs
$_tidy_options

getCSSPadding($_csspadding, $_width = 0)

No description

Parameters

$_csspadding
$_width

getCSSMargin($_cssmargin, $_width = 0)

No description

Parameters

$_cssmargin
$_width

getCSSBorderMargin($_cssbspace, $_width = 0)

No description

Parameters

$_cssbspace
$_width

protected array cssBoxValues(string $css, float $width)

Parse a CSS shorthand box value (top right bottom left) into user units.

Parameters

string $css
float $width

Return Value

array

getHTMLFontUnits($_val, $_refsize = 12, $_parent_size = 12, $_defaultunit = 'pt')

No description

Parameters

$_val
$_refsize
$_parent_size
$_defaultunit

serializeTCPDFtag($_method, $_params = [])

No description

Parameters

$_method
$_params

writeHTMLCell($_w, $_h, $_x, $_y, $_html = '', $_border = 0, $_ln = 0, $_fill = false, $_reseth = true, $_align = '', $_autopadding = true)

No description

Parameters

$_w
$_h
$_x
$_y
$_html
$_border
$_ln
$_fill
$_reseth
$_align
$_autopadding

protected string absolutizeMarkupPath(string $source)

Make a relative local markup resource path absolute.

Parameters

string $source

Return Value

string

protected string cssSafeMarkupPath(string $source)

Return a markup resource path that survives CSS lowercasing.

CSS values are lowercased by the engine parser, so paths used in CSS context are copied to a lowercase temporary file when necessary.

Parameters

string $source

Return Value

string

protected string inheritHtmlBackgrounds(string $html)

Flatten styled inline elements that contain nested inline children.

The engine HTML renderer only paints inline backgrounds for fragments whose element sits directly below the block element; nested children (e.g. xy) lose the background. The parent is therefore split into a sequence of sibling elements of the same tag, each carrying the merged style and the original attributes (links keep working, one annotation per piece).

Parameters

string $html

Return Value

string

protected string normalizeHtmlMarkup(string $html)

Adapt legacy-tolerant HTML markup for the stricter engine renderer.

Applied transformations:

  • styled inline parents with nested children are flattened so the engine paints their backgrounds (see inheritHtmlBackgrounds());
  • vertical align attributes are dropped from images inside tables (the engine would overlap them with the row borders);
  • '@'-prefixed base64 image data is rewritten to a data URI;
  • relative local image paths are made absolute (src attributes, CSS url() values and the legacy img| list-bullet syntax);
  • malformed hexadecimal color tokens, silently coerced by the legacy parser, are repaired to valid values.

Parameters

string $html

Return Value

string

protected void writeHtmlWithTcpdfTags(string $html, mixed $w, mixed $h, mixed $x, mixed $y, mixed $border, mixed $_ln, mixed $fill, mixed $reseth, mixed $align, mixed $autopadding)

Render HTML containing embedded method calls (K_TCPDF_CALLS_IN_HTML feature): the markup is split at the tags, each chunk is rendered normally and each tag invokes the serialized facade method when listed in K_ALLOWED_TCPDF_TAGS.

Parameters

string $html
mixed $w
mixed $h
mixed $x
mixed $y
mixed $border
mixed $_ln
mixed $fill
mixed $reseth
mixed $align
mixed $autopadding

Return Value

void

writeHTML($_html, $_ln = true, $_fill = false, $_reseth = false, $_cell = false, $_align = '')

No description

Parameters

$_html
$_ln
$_fill
$_reseth
$_cell
$_align

setLIsymbol($_symbol = '!')

No description

Parameters

$_symbol

setBooklet($_booklet = true, $_inner = -1, $_outer = -1)

No description

Parameters

$_booklet
$_inner
$_outer

setHtmlVSpace($_tagvs)

No description

Parameters

$_tagvs

setListIndentWidth($_width)

No description

Parameters

$_width

setOpenCell($_isopen)

No description

Parameters

$_isopen

setHtmlLinksStyle($_color = [0, 0, 255], $_fontstyle = 'U')

No description

Parameters

$_color
$_fontstyle

getHTMLUnitToUnits($_htmlval, $_refsize = 1, $_defaultunit = 'px', $_points = false)

No description

Parameters

$_htmlval
$_refsize
$_defaultunit
$_points

movePage($_frompage, $_topage)

No description

Parameters

$_frompage
$_topage

deletePage($_page)

No description

Parameters

$_page

copyPage($_page = 0)

No description

Parameters

$_page

addTOC($_page = null, $_numbersfont = '', $_filler = '.', $_toc_name = 'TOC', $_style = '', $_color = [0, 0, 0])

No description

Parameters

$_page
$_numbersfont
$_filler
$_toc_name
$_style
$_color

addHTMLTOC($_page = null, $_toc_name = 'TOC', $_templates = [], $_correct_align = true, $_style = '', $_color = [0, 0, 0])

No description

Parameters

$_page
$_toc_name
$_templates
$_correct_align
$_style
$_color

startTransaction()

No description

commitTransaction()

No description

rollbackTransaction($_self = false)

No description

Parameters

$_self

protected array equalColumnRegions(int $numcols, float $width, float $ypos)

Legacy equal-column geometry: the requested width is capped to an even share of the content width and the remainder becomes the inter-column gutters.

Parameters

int $numcols
float $width
float $ypos

Return Value

array

protected void setEnginePageRegions(array $regions)

Replace the region (column) layout of the current engine page.

The engine fixes the region list when a page is created and exposes no mutator: the normalized region data (same normalization as the engine page settings) is written directly into the page store.

Parameters

array $regions

Return Value

void

protected bool inColumnMode()

True when the current page is split into multiple column regions.

Return Value

bool

setEqualColumns($_numcols = 0, $_width = 0, $_y = null)

No description

Parameters

$_numcols
$_width
$_y

resetColumns()

No description

setColumnsArray($_columns)

No description

Parameters

$_columns

selectColumn($_col = null)

No description

Parameters

$_col

getColumn()

No description

getNumberOfColumns()

No description

setTextRenderingMode($_stroke = 0, $_fill = true, $_clip = false)

No description

Parameters

$_stroke
$_fill
$_clip

setTextShadow($_params = ['enabled' => false, 'depth_w' => 0, 'depth_h' => 0, 'color' => false, 'opacity' => 1, 'blend_mode' => 'Normal'])

No description

Parameters

$_params

array{enabled: bool, depth_w: int|float, depth_h: int|float, color: mixed, opacity: int|float, blend_mode: string} getTextShadow()

No description

Return Value

array{enabled: bool, depth_w: int|float, depth_h: int|float, color: mixed, opacity: int|float, blend_mode: string}

Text shadow parameters.

hyphenateText($_text, $_patterns, $_dictionary = [], $_leftmin = 1, $_rightmin = 2, $_charmin = 1, $_charmax = 8)

No description

Parameters

$_text
$_patterns
$_dictionary
$_leftmin
$_rightmin
$_charmin
$_charmax

setRasterizeVectorImages($_mode)

No description

Parameters

$_mode

setFontSubsetting($_enable = true)

No description

Parameters

$_enable

bool getFontSubsetting()

No description

Return Value

bool

Default font subsetting mode.

stringLeftTrim($_str, $_replace = '')

No description

Parameters

$_str
$_replace

stringRightTrim($_str, $_replace = '')

No description

Parameters

$_str
$_replace

stringTrim($_str, $_replace = '')

No description

Parameters

$_str
$_replace

isUnicodeFont()

No description

getFontFamilyName($_fontfamily)

No description

Parameters

$_fontfamily

startTemplate($_w = 0, $_h = 0, $_group = false)

No description

Parameters

$_w
$_h
$_group

endTemplate()

No description

printTemplate($_id, $_x = null, $_y = null, $_w = 0, $_h = 0, $_align = '', $_palign = '', $_fitonpage = false)

No description

Parameters

$_id
$_x
$_y
$_w
$_h
$_align
$_palign
$_fitonpage

setFontStretching($_perc = 100)

No description

Parameters

$_perc

float getFontStretching()

No description

Return Value

float

Font stretching percentage.

setFontSpacing($_spacing = 0)

No description

Parameters

$_spacing

float getFontSpacing()

No description

Return Value

float

Extra font spacing in user units.

getPageRegions()

No description

setPageRegions($_regions = [])

No description

Parameters

$_regions

addPageRegion($_region)

No description

Parameters

$_region

removePageRegion($_key)

No description

Parameters

$_key

protected array currentPageNoWriteAreas()

The legacy no-write areas registered for the current page, in the engine setNoWriteRegions() input format (xt/yt/xb/yb/side).

No-write regions only apply to flowing body content; the header/footer decoration (drawn in a late pass with the page context restored, when a page's regions may already be set) must keep its own layout, so report none while rendering it — matching legacy, whose header sits above the content area the regions live in.

Return Value

array

protected bool applyNoWriteRegionsForFlow(float $bandheight, float $cursory)

(Re)build the engine banded writable regions for the current page from its legacy no-write areas, using $bandheight as the height of each horizontal slice, then select the region that contains the current Y so the flow starts at the cursor and hugs the obstacles band by band. The text/HTML engine then advances region -> region -> fresh full-width page on its own.

Parameters

float $bandheight
float $cursory

Return Value

bool

True when no-write regions were applied (multi-region flow).

protected void selectRegionAtY(float $y)

Select the (top-to-bottom ordered) writable region of the current page whose vertical span contains $y, so a flow that starts at the cursor begins in the right band. Falls back to the first region when $y sits above them all.

Parameters

float $y

Return Value

void

protected float noWriteBandFromHtml(string $html)

Band height (one writable slice) for a no-write region flow of HTML: the cell height of the body (outermost) font size declared in the fragment, falling back to the current font. A slice should be about one body line tall so the bands hug the obstacle without wasting vertical space (which would push too much text onto the continuation page); larger inline runs sit in the tall merged region at the top rather than at a band boundary.

Parameters

string $html

Return Value

float

ImageSVG($_file, $_x = null, $_y = null, $_w = 0, $_h = 0, $_link = '', $_align = '', $_palign = '', $_border = 0, $_fitonpage = false)

No description

Parameters

$_file
$_x
$_y
$_w
$_h
$_link
$_align
$_palign
$_border
$_fitonpage