phpdftk API Documentation

TextSpan
in package

FinalYes

A positioned span of text extracted from a PDF page.

Coordinates are in PDF user space (origin at bottom-left of page). Width and height are computed from font metrics and the current text/graphics state at the time the text was rendered.

Table of Contents

Properties

$fontName  : string
PDF resource name of the font (e.g., "F1", "F2").
$fontSize  : float
Font size in points at the time of rendering.
$height  : float
Height of the span in user space points (based on font size).
$text  : string
The Unicode text content of this span.
$width  : float
Width of the span in user space points.
$x  : float
X coordinate of the span origin (left edge) in user space points.
$y  : float
Y coordinate of the span baseline in user space points.

Methods

__construct()  : mixed

Properties

$fontName read-only

PDF resource name of the font (e.g., "F1", "F2").

public string $fontName

$fontSize read-only

Font size in points at the time of rendering.

public float $fontSize

$height read-only

Height of the span in user space points (based on font size).

public float $height

$text read-only

The Unicode text content of this span.

public string $text

$width read-only

Width of the span in user space points.

public float $width

$x read-only

X coordinate of the span origin (left edge) in user space points.

public float $x

$y read-only

Y coordinate of the span baseline in user space points.

public float $y

Methods

__construct()

public __construct(string $text, float $x, float $y, float $width, float $height, float $fontSize, string $fontName) : mixed
Parameters
$text : string
$x : float
$y : float
$width : float
$height : float
$fontSize : float
$fontName : string

        
On this page

Search results