Skip to content

Commit

Permalink
User units are floats
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaasuni committed Nov 29, 2023
1 parent b532f93 commit df75ca4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.10
2.0.11
12 changes: 6 additions & 6 deletions src/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ class Import extends \Com\Tecnick\Pdf\Image\Output
* @param string $image 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').
* @param int $width New width in pixels or null to keep the original value.
* @param int $height New height in pixels or null to keep the original value.
* @param ?int $width New width in pixels or null to keep the original value.
* @param ?int $height New height in pixels or null to keep the original value.
* @param bool $ismask True if the image is a transparency mask.
* @param int $quality Quality for JPEG files (0 = max compression; 100 = best quality, bigger file).
* @param bool $defprint Indicate if the image is the default
Expand All @@ -161,8 +161,8 @@ class Import extends \Com\Tecnick\Pdf\Image\Output
*/
public function add(
string $image,
int $width = null,
int $height = null,
?int $width = null,
?int $height = null,
bool $ismask = false,
int $quality = 100,
bool $defprint = false,
Expand Down Expand Up @@ -229,8 +229,8 @@ public function getImageDataByKey(string $key): array
* @param string $image 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').
* @param int $width New width in pixels or null to keep the original value.
* @param int $height New height in pixels or null to keep the original value.
* @param ?int $width New width in pixels or null to keep the original value.
* @param ?int $height New height in pixels or null to keep the original value.
* @param bool $ismask True if the image is a transparency mask.
* @param int $quality Quality for JPEG files (0 = max compression; 100 = best quality, bigger file).
*
Expand Down
22 changes: 11 additions & 11 deletions src/Output.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,22 +99,22 @@ public function getObjectNumber(): int
/**
* Get the PDF output string to print the specified image ID.
*
* @param int $iid Image ID.
* @param int $xpos Abscissa (X coordinate) of the upper-left Image corner.
* @param int $ypos Ordinate (Y coordinate) of the upper-left Image corner.
* @param int $width Image width in user units.
* @param int $height Image height in user units.
* @param int $pageheight Page height in user units.
* @param int $iid Image ID.
* @param float $xpos Abscissa (X coordinate) of the upper-left Image corner in user units.
* @param float $ypos Ordinate (Y coordinate) of the upper-left Image corner in user units.
* @param float $width Image width in user units.
* @param float $height Image height in user units.
* @param float $pageheight Page height in user units.
*
* @return string Image PDF page content.
*/
public function getSetImage(
int $iid,
int $xpos,
int $ypos,
int $width,
int $height,
int $pageheight
float $xpos,
float $ypos,
float $width,
float $height,
float $pageheight
): string {
if (empty($this->image[$iid])) {
throw new ImageException('Unknown image ID: ' . $iid);
Expand Down

0 comments on commit df75ca4

Please sign in to comment.