Import extends Output
in package
Com\Tecnick\Pdf\Image\Import
Tags
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
stringgetObjectNumber()
Returns current PDF object number.
public getObjectNumber()
: int
Return values
intgetOutImagesBlock()
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
stringgetXobjectDictByKeys()
Return XObjects Dictionary.
public getXobjectDictByKeys(array<string|int,
int> $keys)
: string
Parameters
- $keys : array<string|int, int>
-
Image IDs.