Output

Com\Tecnick\Pdf\Image\Output

Namespace: Com\Tecnick\Pdf\Image

Abstract: Yes

File: Output.php line 49

Tags

  • since: 2011-05-23
  • category: Library
  • author: Nicola Asuni info@tecnick.com
  • copyright: 2011-2026 Nicola Asuni - Tecnick.com LTD
  • license: https://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE)
  • link: https://github.com/tecnickcom/tc-lib-pdf-image
  • phpstan-type: TFileOptions array{ allowedHosts?: array, maxRemoteSize?: int, curlopts?: array<int, bool|int|string>, defaultCurlOpts?: array<int, bool|int|string>, fixedCurlOpts?: array<int, bool|int|string> }
  • phpstan-import-type: ImageBaseData from \Com\Tecnick\Pdf\Image\Import
  • phpstan-import-type: ImageRawData from \Com\Tecnick\Pdf\Image\Import
  • SuppressWarnings: (“PHPMD.ExcessiveClassComplexity”)

Methods

__construct()

File: Output.php line 102

public __construct(float $kunit, Encrypt $encrypt, File $fileHelper[, bool $pdfa = false ][, bool $compress = true ][, ImageCacheInterface|null $imageCache = null ][, bool $notransparency = false ]) : mixed

Parameters

  • $kunit : float: Unit of measure conversion ratio.
  • $encrypt : Encrypt: Encrypt object.
  • $fileHelper : File: File helper for image loading and writing.
  • $pdfa : bool = false: True if we are in PDF/A mode.
  • $compress : bool = true: Set to false to disable stream compression.
  • $imageCache : ImageCacheInterface|null = null: External cache used to persist processed image data across instances and processes (null = disabled).
  • $notransparency : bool = false: True to suppress the soft mask of an alpha image.

getObjectNumber()

File: Output.php line 115

public getObjectNumber() : int

Return values

int

getOutImagesBlock()

File: Output.php line 230

public getOutImagesBlock(int $pon) : string

Parameters

  • $pon : int: Current PDF Object Number.

Tags

  • throws: Exception If image object encryption fails.

Return values

string —

PDF code for the images block.

getSetImage()

File: Output.php line 188

public getSetImage(int $iid, float $xpos, float $ypos, float $width, float $height, float $pageheight) : string

Parameters

  • $iid : int: Image ID.
  • $xpos : float: Abscissa (X coordinate) of the upper-left Image corner in user units.
  • $ypos : float: Ordinate (Y coordinate) of the upper-left Image corner in user units.
  • $width : float: Image width in user units.
  • $height : float: Image height in user units.
  • $pageheight : float: Page height in user units.

Tags

  • throws: Exception If the image ID is not found.

Return values

string —

Image PDF page content.

getXobjectDict()

File: Output.php line 362

public getXobjectDict() : string

Return values

string

getXobjectDictByKeys()

File: Output.php line 377

public getXobjectDictByKeys(array<string|int, int> $keys) : string

Parameters

  • $keys : array<string|int, int>: Image IDs.

Return values

string

hasDeviceCmykImage()

File: Output.php line 132

public hasDeviceCmykImage() : bool

Return values

bool

hasDroppedAlpha()

File: Output.php line 124

public hasDroppedAlpha() : bool

Return values

bool

withFileHelper()

File: Output.php line 162

public withFileHelper(File $fileHelper, callable(): TResult $callback) : TResult

Parameters

  • $fileHelper : File: Temporary file helper to use while the callback executes.
  • $callback : callable(): TResult: Callback executed with the temporary file helper.

Tags

  • template

Return values

TResult