classes-Com-Tecnick-Pdf-Image-Import

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.

Import extends Output

in package

Com\Tecnick\Pdf\Image\Import

Tags
since
2011-05-23
category

Library

author

Nicola Asuni info@tecnick.com

copyright

2011-2024 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-image
phpstan-type

ImageBaseData array{ 'bits': int, 'channels': int, 'colspace': string, 'data': string, 'exturl': bool, 'file': string, 'filter': string, 'height': int, 'icc': string, 'ismask': bool, 'key': string, 'mapto': int, 'native': bool, 'obj': int, 'obj_alt': int, 'obj_icc': int, 'obj_pal': int, 'pal': string, 'parms': string, 'raw': string, 'recode': bool, 'recoded': bool, 'splitalpha': bool, 'trns': array<int, int>, 'type': int, 'width': int, }

phpstan-type

ImageRawData array{ 'bits': int, 'channels': int, 'colspace': string, 'data': string, 'exturl': bool, 'file': string, 'filter': string, 'height': int, 'icc': string, 'ismask': bool, 'key': string, 'mapto': int, 'mask'?: ImageBaseData, 'native': bool, 'obj': int, 'obj_alt': int, 'obj_icc': int, 'obj_pal': int, 'pal': string, 'parms': string, 'plain'?: ImageBaseData, 'raw': string, 'recode': bool, 'recoded': bool, 'splitalpha': bool, 'trns': array<int, int>, 'type': int, 'width': int, }

SuppressWarnings

("PHPMD.ExcessiveClassLength")

SuppressWarnings

("PHPMD.ExcessiveClassComplexity")

Table of Contents

Methods

__construct()  : mixed
Initialize images data.
add()  : int
Add a new image.
getImageDataByKey()  : ImageRawData
Get an imported image by key.
getKey()  : string
Get the Image key used for caching.
getObjectNumber()  : int
Returns current PDF object number.
getOutImagesBlock()  : string
Get the PDF output string for Images.
getSetImage()  : string
Get the PDF output string to print the specified image ID.
getXobjectDict()  : string
Return XObjects Dictionary portion for the images.
getXobjectDictByKeys()  : string
Return XObjects Dictionary.

Methods

__construct()

Initialize images data.

public __construct(float $kunit, Encrypt $encrypt[, bool $pdfa = false ][, bool $compress = true ]) : mixed
Parameters
$kunit : float

Unit of measure conversion ratio.

$encrypt : Encrypt

Encrypt object.

$pdfa : bool = false

True if we are in PDF/A mode.

$compress : bool = true

Set to false to disable stream compression.

add()

Add a new image.

public add(string $image[, int|null $width = null ][, int|null $height = null ][, bool $ismask = false ][, int $quality = 100 ][, bool $defprint = false ][, array<int, int> $altimgs = [] ]) : int
Parameters
$image : string

Image file name, URL or a '@' character followed by the image data string. To link an image without embedding it on the document, set an asterisk character before the URL (i.e.: '*http://www.example.com/image.jpg').

$width : int|null = null

New width in pixels or null to keep the original value.

$height : int|null = null

New height in pixels or null to keep the original value.

$ismask : bool = false

True if the image is a transparency mask.

$quality : int = 100

Quality for JPEG files (0 = max compression; 100 = best quality, bigger file).

$defprint : bool = false

Indicate if the image is the default for printing when used as alternative image.

$altimgs : array<int, int> = []

Arrays of alternate image keys.

Return values
int

Image ID.

getImageDataByKey()

Get an imported image by key.

public getImageDataByKey(string $key) : ImageRawData
Parameters
$key : string

Image key.

Return values
ImageRawData

Image raw data array.

getKey()

Get the Image key used for caching.

public getKey(string $image[, int $width = 0 ][, int $height = 0 ][, int $quality = 100 ]) : string
Parameters
$image : string

Image file name or content.

$width : int = 0

Width in pixels.

$height : int = 0

Height in pixels.

$quality : int = 100

Quality for JPEG files.

Return values
string

getObjectNumber()

Returns current PDF object number.

public getObjectNumber() : int
Return values
int

getOutImagesBlock()

Get the PDF output string for Images.

public getOutImagesBlock(int $pon) : string
Parameters
$pon : int

Current PDF Object Number.

Return values
string

PDF code for the images block.

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.

Return values
string

Image PDF page content.

getXobjectDict()

Return XObjects Dictionary portion for the images.

public getXobjectDict() : string
Return values
string

getXobjectDictByKeys()

Return XObjects Dictionary.

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

Image IDs.

Return values
string
On this page
 

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