Skip to content
forked from psliwa/PHPPdf

Commit

Permalink
Merge pull request #1 from jobcloud/feat/BE-1914/fork-and-adapt
Browse files Browse the repository at this point in the history
feat(BE-1914): fork and adapt for php 7.4
  • Loading branch information
haeber authored May 28, 2021
2 parents 2e38a65 + 7a548a5 commit 36ee83c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 10 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "psliwa/php-pdf",
"name": "jobcloud/psliwa-php-pdf",
"description": "Pdf and graphic files generator library for PHP.",
"keywords": ["PDF", "PHPPdf"],
"type": "library",
Expand All @@ -12,19 +12,20 @@
}
],
"require": {
"zendframework/zendpdf": "~2.0.0",
"zendframework/zend-cache": "^2.0"
"zendframework/zendpdf": "~2.0.0",
"laminas/laminas-cache": "^2.0",
"laminas/laminas-zendframework-bridge": "^1.1"
},
"require-dev": {
"zendframework/zend-barcode": "^2.0",
"zendframework/zend-validator": "^2.0",
"imagine/Imagine": ">=0.2.0,<0.6.0",
"laminas/laminas-barcode": "^2.0",
"laminas/laminas-validator": "^2.0",
"imagine/imagine": ">=0.2.0,<0.6.0",
"phpunit/phpunit": ">=4,<5.4.0"
},
"suggest": {
"zendframework/zend-barcode": "If you want to use barcodes",
"zendframework/zend-validator": "If you want to use barcodes (required by zend-barcode)",
"imagine/Imagine": "If you want to use image generating (required version: >=v0.2.6)"
"laminas/laminas-barcode": "If you want to use barcodes",
"laminas/laminas-validator": "If you want to use barcodes (required by zend-barcode)",
"imagine/imagine": "If you want to use image generating (required version: >=v0.2.6)"
},
"autoload": {
"psr-0": { "PHPPdf": "lib/", "Imagine": "lib/" }
Expand Down
2 changes: 1 addition & 1 deletion lib/PHPPdf/Core/Formatter/StandardPositionFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function format(Nodes\Node $node, Document $document)
list($x, $y) = $boundary->getFirstPoint()->toArray();

$attributesSnapshot = $node->getAttributesSnapshot();
$diffWidth = $node->getWidth() - $attributesSnapshot['width'];
$diffWidth = $node->getWidth() - ($attributesSnapshot['width'] ?? 0);
$width = $node->getWidth();
$x += $width;
$yEnd = $y - $node->getHeight();
Expand Down

0 comments on commit 36ee83c

Please sign in to comment.