classes-Com-Tecnick-Pdf-Text

It appears that you are using AdBlocking software. The cost of running this website is covered by advertisements. If you like it please feel free to a small amount of money to secure the future of this website.

Text extends Cell

in package

AbstractYes

Com\Tecnick\Pdf\Text

Text PDF data

Tags
since
2002-08-03
category

Library

author

Nicola Asuni info@tecnick.com

copyright

2002-2023 Nicola Asuni - Tecnick.com LTD

license

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

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

TTextDims from \Com\Tecnick\Pdf\Font\Stack

phpstan-type

TextBBox array{ 'x': float, 'y': float, 'width': float, 'height': float, }

Table of Contents

Properties

$barcode  : Barcode
Barcode object
$cache  : Cache
Cache object
$color  : Pdf
Color object
$encrypt  : Encrypt
Encrypt object
$file  : File
File object
$font  : Stack
Font object
$graph  : Draw
Graph object
$image  : Import
Image Import object
$page  : Page
Page object
$pon  : int
Current PDF object number.
$uniconv  : Convert
Unicode Convert object

Methods

getLastTextBBox()  : TextBBox
Returns the last text bounding box [llx, lly, urx, ury].
getTextLine()  : string
Returns the PDF code to render a line of text.
loadTexHyphenPatterns()  : array<string, string>
Returns an array of hyphenation patterns.
setDefaultCellMargin()  : void
Set the default cell margin in user units.
setDefaultCellPadding()  : void
Set the default cell padding in user units.
toPoints()  : float
Convert user units to internal points unit.
toUnit()  : float
Convert internal points to user unit.
toYPoints()  : float
Convert vertical user value to internal points unit.
toYUnit()  : float
Convert vertical internal points value to user unit.

Properties

$barcode

Barcode object

public Barcode $barcode

$cache

Cache object

public Cache $cache

$color

Color object

public Pdf $color

$encrypt

Encrypt object

public Encrypt $encrypt

$file

File object

public File $file

$font

Font object

public Stack $font

$graph

Graph object

public Draw $graph

$image

Image Import object

public Import $image

$page

Page object

public Page $page

$pon

Current PDF object number.

public int $pon = 0

$uniconv

Unicode Convert object

public Convert $uniconv

Methods

getLastTextBBox()

Returns the last text bounding box [llx, lly, urx, ury].

public getLastTextBBox() : TextBBox
Return values
TextBBox

Array of bounding box values.

getTextLine()

Returns the PDF code to render a line of text.

public getTextLine(string $txt[, float $posx = 0 ][, float $posy = 0 ][, float $width = 0 ][, float $strokewidth = 0 ][, float $wordspacing = 0 ][, float $leading = 0 ][, float $rise = 0 ][, bool $fill = true ][, bool $stroke = false ][, bool $clip = false ][, string $forcedir = '' ]) : string
Parameters
$txt : string

Text string to be processed.

$posx : float = 0

X position relative to the start of the current line.

$posy : float = 0

Y position relative to the start of the current line (font baseline).

$width : float = 0

Desired string width to force justification via word spacing (0 = automatic).

$strokewidth : float = 0

Stroke width.

$wordspacing : float = 0

Word spacing (use it only when width == 0).

$leading : float = 0

Leading.

$rise : float = 0

Text rise.

$fill : bool = true

If true fills the text.

$stroke : bool = false

If true stroke the text.

$clip : bool = false

If true activate clipping mode.

$forcedir : string = ''

If 'R' forces RTL, if 'L' forces LTR

Return values
string

loadTexHyphenPatterns()

Returns an array of hyphenation patterns.

public loadTexHyphenPatterns(string $file) : array<string, string>
Parameters
$file : string

TEX file containing hypenation patterns. TEX patterns can be downloaded from https://www.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/tex See https://www.ctan.org/tex-archive/language/hyph-utf8/ for more information.

Return values
array<string, string>

Array of hyphenation patterns.

setDefaultCellMargin()

Set the default cell margin in user units.

public setDefaultCellMargin(float $top, float $right, float $bottom, float $left) : void
Parameters
$top : float

Top.

$right : float

Right.

$bottom : float

Bottom.

$left : float

Left.

setDefaultCellPadding()

Set the default cell padding in user units.

public setDefaultCellPadding(float $top, float $right, float $bottom, float $left) : void
Parameters
$top : float

Top.

$right : float

Right.

$bottom : float

Bottom.

$left : float

Left.

toPoints()

Convert user units to internal points unit.

public toPoints(float $usr) : float
Parameters
$usr : float

Value to convert.

Return values
float

toUnit()

Convert internal points to user unit.

public toUnit(float $pnt) : float
Parameters
$pnt : float

Value to convert in user units.

Return values
float

toYPoints()

Convert vertical user value to internal points unit.

public toYPoints(float $usr[, float $pageh = -1 ]) : float

Note: the internal Y points coordinate starts at the bottom left of the page.

Parameters
$usr : float

Value to convert.

$pageh : float = -1

Optional page height in internal points ($pageh:$this->page->getPage()['pheight']).

Return values
float

toYUnit()

Convert vertical internal points value to user unit.

public toYUnit(float $pnt[, float $pageh = -1 ]) : float

Note: the internal Y points coordinate starts at the bottom left of the page.

Parameters
$pnt : float

Value to convert.

$pageh : float = -1

Optional page height in internal points ($pageh:$this->page->getPage()['pheight']).

Return values
float
On this page
 

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