PageTemplate

Immutable value object representing a page that has been imported as a Form XObject.

Namespace: Com\Tecnick\Pdf\Import

class PageTemplate implements PageTemplateInterface

Implements: PageTemplateInterface

Source: src/Import/PageTemplate.php:36

Immutable value object representing a page that has been imported as a Form XObject.

Types

PageBox

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

Properties

$height

Height of the imported page in user units.

public float $height

Source: src/Import/PageTemplate.php:57

$mediaBox

MediaBox as [x0, y0, x1, y1] in points.

public array<int,float> $mediaBox

Source: src/Import/PageTemplate.php:85

$rotation

Page rotation in degrees (0, 90, 180, 270).

public int $rotation

Source: src/Import/PageTemplate.php:64

$sourceId

Source document identifier.

public string $sourceId

Source: src/Import/PageTemplate.php:71

$sourcePage

1-based page number in the source document.

public int $sourcePage

Source: src/Import/PageTemplate.php:78

$width

Width of the imported page in user units.

public float $width

Source: src/Import/PageTemplate.php:50

$xobjId

XObject template ID (e.g. “IMP1”).

public string $xobjId

Source: src/Import/PageTemplate.php:43

Methods

__construct()

Constructor.

public __construct(
    string $xobjId,
    float $width,
    float $height,
    int $rotation,
    string $sourceId,
    int $sourcePage,
    array<int,float> $mediaBox
)

Parameters:

  • $xobjId (string): XObject template ID.
  • $width (float): Width in user units.
  • $height (float): Height in user units.
  • $rotation (int): Page rotation in degrees.
  • $sourceId (string): Source document identifier.
  • $sourcePage (int): 1-based page number.
  • $mediaBox (array<int,float>): MediaBox [x0, y0, x1, y1] in points.

Source: src/Import/PageTemplate.php:98

getHeight()

Height of the imported page in PDF user units (points).

public getHeight(): float

Returns: float

Source: src/Import/PageTemplate.php:126

getMediaBox()

Effective page box as [x0, y0, x1, y1] in points.

public getMediaBox(): array<int,float>

Returns: array<int,float>

Source: src/Import/PageTemplate.php:149

getRotation()

Page rotation in degrees (0, 90, 180, 270).

public getRotation(): int

Returns: int

Source: src/Import/PageTemplate.php:131

getSourceId()

Stable identifier of the source document this template was imported from.

public getSourceId(): string

Returns: string

Source: src/Import/PageTemplate.php:136

getSourcePage()

1-based page number in the source document.

public getSourcePage(): int

Returns: int

Source: src/Import/PageTemplate.php:141

getWidth()

Width of the imported page in PDF user units (points).

public getWidth(): float

Returns: float

Source: src/Import/PageTemplate.php:121

getXobjId()

XObject template ID (e.g. “IMP1”) used to reference the Form XObject in content streams.

public getXobjId(): string

Returns: string

Source: src/Import/PageTemplate.php:116