Output

Output API reference

Namespace: Com\Tecnick\Pdf\Image

abstract class Output

Source: src/Output.php:49

Types

TFileOptions

array{
  allowedHosts?: array<string>,
  maxRemoteSize?: int,
  curlopts?: array<int, bool|int|string>,
  defaultCurlOpts?: array<int, bool|int|string>,
  fixedCurlOpts?: array<int, bool|int|string>
}

Methods

__construct()

Initialize images data.

public __construct(
    float $kunit,
    Encrypt $encrypt,
    File $fileHelper,
    bool $pdfa = false,
    bool $compress = true,
    ?ImageCacheInterface $imageCache = null,
    bool $notransparency = false
)

Parameters:

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

Source: src/Output.php:102

getObjectNumber()

Returns current PDF object number.

public getObjectNumber(): int

Returns: int

Source: src/Output.php:115

getOutImagesBlock()

Get the PDF output string for Images.

public getOutImagesBlock(int $pon): string

Parameters:

  • $pon (int): Current PDF Object Number.

Returns: string: PDF code for the images block.

Throws:

Source: src/Output.php:230

getSetImage()

Get the PDF output string to print the specified image ID.

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.

Returns: string: Image PDF page content.

Throws:

Source: src/Output.php:188

getXobjectDict()

Return XObjects Dictionary portion for the images.

public getXobjectDict(): string

Returns: string

Source: src/Output.php:362

getXobjectDictByKeys()

Return XObjects Dictionary.

public getXobjectDictByKeys(int[] $keys): string

Parameters:

  • $keys (int[]): Image IDs.

Returns: string

Source: src/Output.php:377

hasDeviceCmykImage()

Returns true when any added image is emitted in the DeviceCMYK color space.

public hasDeviceCmykImage(): bool

Returns: bool

Source: src/Output.php:132

hasDroppedAlpha()

Returns true when the soft mask of an alpha image was dropped because transparency is disabled. Set by getOutImagesBlock().

public hasDroppedAlpha(): bool

Returns: bool

Source: src/Output.php:124

withFileHelper()

Run a callback with a temporary file helper.

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

Parameters:

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

Returns: TResult

Source: src/Output.php:162