Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/FpdfTpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This file is part of FPDI
*
* @package setasign\Fpdi
* @copyright Copyright (c) 2024 Setasign GmbH & Co. KG (https://www.setasign.com)
* @copyright Copyright (c) 2026 Setasign GmbH & Co. KG (https://www.setasign.com)
* @license http://opensource.org/licenses/mit-license The MIT License
*/

Expand Down
2 changes: 1 addition & 1 deletion src/FpdfTplTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This file is part of FPDI
*
* @package setasign\Fpdi
* @copyright Copyright (c) 2024 Setasign GmbH & Co. KG (https://www.setasign.com)
* @copyright Copyright (c) 2026 Setasign GmbH & Co. KG (https://www.setasign.com)
* @license http://opensource.org/licenses/mit-license The MIT License
*/

Expand Down
8 changes: 4 additions & 4 deletions src/FpdfTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This file is part of FPDI
*
* @package setasign\Fpdi
* @copyright Copyright (c) 2024 Setasign GmbH & Co. KG (https://www.setasign.com)
* @copyright Copyright (c) 2026 Setasign GmbH & Co. KG (https://www.setasign.com)
* @license http://opensource.org/licenses/mit-license The MIT License
*/

Expand Down Expand Up @@ -137,7 +137,7 @@ protected function _putlinks($n)
{
foreach ($this->PageLinks[$n] as $pl) {
$this->_newobj();
$rect = sprintf('%.2F %.2F %.2F %.2F', $pl[0], $pl[1], $pl[0] + $pl[2], $pl[1] - $pl[3]);
$rect = \sprintf('%.2F %.2F %.2F %.2F', $pl[0], $pl[1], $pl[0] + $pl[2], $pl[1] - $pl[3]);
$this->_put('<</Type /Annot /Subtype /Link /Rect [' . $rect . ']', false);
if (is_string($pl[4])) {
if (isset($pl['importedLink'])) {
Expand All @@ -152,7 +152,7 @@ protected function _putlinks($n)
if (isset($pl['quadPoints'])) {
$s = '/QuadPoints[';
foreach ($pl['quadPoints'] as $value) {
$s .= sprintf('%.2F ', $value);
$s .= \sprintf('%.2F ', $value);
}
$s .= ']';
$this->_put($s);
Expand All @@ -172,7 +172,7 @@ protected function _putlinks($n)
? $this->DefPageSize[1] * $this->k
: $this->DefPageSize[0] * $this->k;
}
$this->_put(sprintf(
$this->_put(\sprintf(
'/Dest [%d 0 R /XYZ 0 %.2F null]>>',
$this->PageInfo[$l[0]]['n'],
$h - $l[1] * $this->k
Expand Down
2 changes: 1 addition & 1 deletion src/Fpdi.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This file is part of FPDI
*
* @package setasign\Fpdi
* @copyright Copyright (c) 2024 Setasign GmbH & Co. KG (https://www.setasign.com)
* @copyright Copyright (c) 2026 Setasign GmbH & Co. KG (https://www.setasign.com)
* @license http://opensource.org/licenses/mit-license The MIT License
*/

Expand Down
2 changes: 1 addition & 1 deletion src/FpdiException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This file is part of FPDI
*
* @package setasign\Fpdi
* @copyright Copyright (c) 2024 Setasign GmbH & Co. KG (https://www.setasign.com)
* @copyright Copyright (c) 2026 Setasign GmbH & Co. KG (https://www.setasign.com)
* @license http://opensource.org/licenses/mit-license The MIT License
*/

Expand Down
10 changes: 5 additions & 5 deletions src/FpdiTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This file is part of FPDI
*
* @package setasign\Fpdi
* @copyright Copyright (c) 2024 Setasign GmbH & Co. KG (https://www.setasign.com)
* @copyright Copyright (c) 2026 Setasign GmbH & Co. KG (https://www.setasign.com)
* @license http://opensource.org/licenses/mit-license The MIT License
*/

Expand Down Expand Up @@ -313,7 +313,7 @@ public function importPage(
$dict->value['Resources'] = $resources;
}

list($width, $height) = $page->getWidthAndHeight($box);
[$width, $height] = $page->getWidthAndHeight($box);

$a = 1;
$b = 0;
Expand Down Expand Up @@ -522,11 +522,11 @@ public function useImportedPage($pageId, $x = 0, $y = 0, $width = null, $height
protected function adjustLastLink($externalLink, $xPt, $scaleX, $yPt, $newHeightPt, $scaleY, $importedPage)
{
// let's create a relation of the newly created link to the data of the external link
$lastLink = count($this->PageLinks[$this->page]);
$lastLink = \count($this->PageLinks[$this->page]);
$this->PageLinks[$this->page][$lastLink - 1]['importedLink'] = $externalLink;
if (count($externalLink['quadPoints']) > 0) {
if (\count($externalLink['quadPoints']) > 0) {
$quadPoints = [];
for ($i = 0, $n = count($externalLink['quadPoints']); $i < $n; $i += 2) {
for ($i = 0, $n = \count($externalLink['quadPoints']); $i < $n; $i += 2) {
$quadPoints[] = $xPt + $externalLink['quadPoints'][$i] * $scaleX;
$quadPoints[] = $this->hPt - $yPt - $newHeightPt + $externalLink['quadPoints'][$i + 1] * $scaleY;
}
Expand Down
10 changes: 5 additions & 5 deletions src/GraphicsState.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This file is part of FPDI
*
* @package setasign\Fpdi
* @copyright Copyright (c) 2024 Setasign GmbH & Co. KG (https://www.setasign.com)
* @copyright Copyright (c) 2026 Setasign GmbH & Co. KG (https://www.setasign.com)
* @license http://opensource.org/licenses/mit-license The MIT License
*/

Expand Down Expand Up @@ -53,13 +53,13 @@ public function add(Matrix $matrix)
*/
public function rotate($x, $y, $angle)
{
if (abs($angle) < 1e-5) {
if (\abs($angle) < 1e-5) {
return $this;
}

$angle = deg2rad($angle);
$c = cos($angle);
$s = sin($angle);
$angle = \deg2rad($angle);
$c = \cos($angle);
$s = \sin($angle);

$this->add(new Matrix($c, $s, -$s, $c, $x, $y));

Expand Down
2 changes: 1 addition & 1 deletion src/Math/Matrix.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This file is part of FPDI
*
* @package setasign\Fpdi
* @copyright Copyright (c) 2024 Setasign GmbH & Co. KG (https://www.setasign.com)
* @copyright Copyright (c) 2026 Setasign GmbH & Co. KG (https://www.setasign.com)
* @license http://opensource.org/licenses/mit-license The MIT License
*/

Expand Down
4 changes: 2 additions & 2 deletions src/Math/Vector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This file is part of FPDI
*
* @package setasign\Fpdi
* @copyright Copyright (c) 2024 Setasign GmbH & Co. KG (https://www.setasign.com)
* @copyright Copyright (c) 2026 Setasign GmbH & Co. KG (https://www.setasign.com)
* @license http://opensource.org/licenses/mit-license The MIT License
*/

Expand Down Expand Up @@ -57,7 +57,7 @@ public function getY()
*/
public function multiplyWithMatrix(Matrix $matrix)
{
list($a, $b, $c, $d, $e, $f) = $matrix->getValues();
[$a, $b, $c, $d, $e, $f] = $matrix->getValues();
$x = $a * $this->x + $c * $this->y + $e;
$y = $b * $this->x + $d * $this->y + $f;

Expand Down
2 changes: 1 addition & 1 deletion src/PdfParser/CrossReference/AbstractReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This file is part of FPDI
*
* @package setasign\Fpdi
* @copyright Copyright (c) 2024 Setasign GmbH & Co. KG (https://www.setasign.com)
* @copyright Copyright (c) 2026 Setasign GmbH & Co. KG (https://www.setasign.com)
* @license http://opensource.org/licenses/mit-license The MIT License
*/

Expand Down
2 changes: 1 addition & 1 deletion src/PdfParser/CrossReference/CrossReference.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This file is part of FPDI
*
* @package setasign\Fpdi
* @copyright Copyright (c) 2024 Setasign GmbH & Co. KG (https://www.setasign.com)
* @copyright Copyright (c) 2026 Setasign GmbH & Co. KG (https://www.setasign.com)
* @license http://opensource.org/licenses/mit-license The MIT License
*/

Expand Down
2 changes: 1 addition & 1 deletion src/PdfParser/CrossReference/CrossReferenceException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This file is part of FPDI
*
* @package setasign\Fpdi
* @copyright Copyright (c) 2024 Setasign GmbH & Co. KG (https://www.setasign.com)
* @copyright Copyright (c) 2026 Setasign GmbH & Co. KG (https://www.setasign.com)
* @license http://opensource.org/licenses/mit-license The MIT License
*/

Expand Down
6 changes: 3 additions & 3 deletions src/PdfParser/CrossReference/FixedReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This file is part of FPDI
*
* @package setasign\Fpdi
* @copyright Copyright (c) 2024 Setasign GmbH & Co. KG (https://www.setasign.com)
* @copyright Copyright (c) 2026 Setasign GmbH & Co. KG (https://www.setasign.com)
* @license http://opensource.org/licenses/mit-license The MIT License
*/

Expand Down Expand Up @@ -62,7 +62,7 @@ public function getSubSections()
*/
public function getOffsetFor($objectNumber)
{
foreach ($this->subSections as $offset => list($startObject, $objectCount)) {
foreach ($this->subSections as $offset => [$startObject, $objectCount]) {
/**
* @var int $startObject
* @var int $objectCount
Expand Down Expand Up @@ -189,7 +189,7 @@ public function fixFaultySubSectionShift()
}

if ($this->getOffsetFor(1) === false) {
foreach ($subSections as $offset => list($startObject, $objectCount)) {
foreach ($subSections as $offset => [$startObject, $objectCount]) {
$this->subSections[$offset] = [$startObject - 1, $objectCount];
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/PdfParser/CrossReference/LineReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This file is part of FPDI
*
* @package setasign\Fpdi
* @copyright Copyright (c) 2024 Setasign GmbH & Co. KG (https://www.setasign.com)
* @copyright Copyright (c) 2026 Setasign GmbH & Co. KG (https://www.setasign.com)
* @license http://opensource.org/licenses/mit-license The MIT License
*/

Expand Down
2 changes: 1 addition & 1 deletion src/PdfParser/CrossReference/ReaderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This file is part of FPDI
*
* @package setasign\Fpdi
* @copyright Copyright (c) 2024 Setasign GmbH & Co. KG (https://www.setasign.com)
* @copyright Copyright (c) 2026 Setasign GmbH & Co. KG (https://www.setasign.com)
* @license http://opensource.org/licenses/mit-license The MIT License
*/

Expand Down
24 changes: 12 additions & 12 deletions src/PdfParser/Filter/Ascii85.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This file is part of FPDI
*
* @package setasign\Fpdi
* @copyright Copyright (c) 2024 Setasign GmbH & Co. KG (https://www.setasign.com)
* @copyright Copyright (c) 2026 Setasign GmbH & Co. KG (https://www.setasign.com)
* @license http://opensource.org/licenses/mit-license The MIT License
*/

Expand Down Expand Up @@ -47,7 +47,7 @@ public function decode($data)
}

if ($ch === 122 /* z */ && $state === 0) {
$out .= \chr(0) . \chr(0) . \chr(0) . \chr(0);
$out .= "\x00\x00\x00\x00";
continue;
}

Expand All @@ -69,10 +69,10 @@ public function decode($data)
$r = (int)($r * 85 + $chn[$j]);
}

$out .= \chr($r >> 24)
. \chr($r >> 16)
. \chr($r >> 8)
. \chr($r);
$out .= \chr(($r >> 24) & 255)
. \chr(($r >> 16) & 255)
. \chr(($r >> 8) & 255)
. \chr($r & 255);
}
}

Expand All @@ -85,16 +85,16 @@ public function decode($data)

if ($state === 2) {
$r = $chn[0] * 85 * 85 * 85 * 85 + ($chn[1] + 1) * 85 * 85 * 85;
$out .= \chr($r >> 24);
$out .= \chr(($r >> 24) & 255);
} elseif ($state === 3) {
$r = $chn[0] * 85 * 85 * 85 * 85 + $chn[1] * 85 * 85 * 85 + ($chn[2] + 1) * 85 * 85;
$out .= \chr($r >> 24);
$out .= \chr($r >> 16);
$out .= \chr(($r >> 24) & 255);
$out .= \chr(($r >> 16) & 255);
} elseif ($state === 4) {
$r = $chn[0] * 85 * 85 * 85 * 85 + $chn[1] * 85 * 85 * 85 + $chn[2] * 85 * 85 + ($chn[3] + 1) * 85;
$out .= \chr($r >> 24);
$out .= \chr($r >> 16);
$out .= \chr($r >> 8);
$out .= \chr(($r >> 24) & 255);
$out .= \chr(($r >> 16) & 255);
$out .= \chr(($r >> 8) & 255);
}

return $out;
Expand Down
2 changes: 1 addition & 1 deletion src/PdfParser/Filter/Ascii85Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This file is part of FPDI
*
* @package setasign\Fpdi
* @copyright Copyright (c) 2024 Setasign GmbH & Co. KG (https://www.setasign.com)
* @copyright Copyright (c) 2026 Setasign GmbH & Co. KG (https://www.setasign.com)
* @license http://opensource.org/licenses/mit-license The MIT License
*/

Expand Down
2 changes: 1 addition & 1 deletion src/PdfParser/Filter/AsciiHex.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This file is part of FPDI
*
* @package setasign\Fpdi
* @copyright Copyright (c) 2024 Setasign GmbH & Co. KG (https://www.setasign.com)
* @copyright Copyright (c) 2026 Setasign GmbH & Co. KG (https://www.setasign.com)
* @license http://opensource.org/licenses/mit-license The MIT License
*/

Expand Down
2 changes: 1 addition & 1 deletion src/PdfParser/Filter/FilterException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This file is part of FPDI
*
* @package setasign\Fpdi
* @copyright Copyright (c) 2024 Setasign GmbH & Co. KG (https://www.setasign.com)
* @copyright Copyright (c) 2026 Setasign GmbH & Co. KG (https://www.setasign.com)
* @license http://opensource.org/licenses/mit-license The MIT License
*/

Expand Down
2 changes: 1 addition & 1 deletion src/PdfParser/Filter/FilterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This file is part of FPDI
*
* @package setasign\Fpdi
* @copyright Copyright (c) 2024 Setasign GmbH & Co. KG (https://www.setasign.com)
* @copyright Copyright (c) 2026 Setasign GmbH & Co. KG (https://www.setasign.com)
* @license http://opensource.org/licenses/mit-license The MIT License
*/

Expand Down
2 changes: 1 addition & 1 deletion src/PdfParser/Filter/Flate.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This file is part of FPDI
*
* @package setasign\Fpdi
* @copyright Copyright (c) 2024 Setasign GmbH & Co. KG (https://www.setasign.com)
* @copyright Copyright (c) 2026 Setasign GmbH & Co. KG (https://www.setasign.com)
* @license http://opensource.org/licenses/mit-license The MIT License
*/

Expand Down
2 changes: 1 addition & 1 deletion src/PdfParser/Filter/FlateException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This file is part of FPDI
*
* @package setasign\Fpdi
* @copyright Copyright (c) 2024 Setasign GmbH & Co. KG (https://www.setasign.com)
* @copyright Copyright (c) 2026 Setasign GmbH & Co. KG (https://www.setasign.com)
* @license http://opensource.org/licenses/mit-license The MIT License
*/

Expand Down
2 changes: 1 addition & 1 deletion src/PdfParser/Filter/Lzw.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This file is part of FPDI
*
* @package setasign\Fpdi
* @copyright Copyright (c) 2024 Setasign GmbH & Co. KG (https://www.setasign.com)
* @copyright Copyright (c) 2026 Setasign GmbH & Co. KG (https://www.setasign.com)
* @license http://opensource.org/licenses/mit-license The MIT License
*/

Expand Down
2 changes: 1 addition & 1 deletion src/PdfParser/Filter/LzwException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This file is part of FPDI
*
* @package setasign\Fpdi
* @copyright Copyright (c) 2024 Setasign GmbH & Co. KG (https://www.setasign.com)
* @copyright Copyright (c) 2026 Setasign GmbH & Co. KG (https://www.setasign.com)
* @license http://opensource.org/licenses/mit-license The MIT License
*/

Expand Down
6 changes: 3 additions & 3 deletions src/PdfParser/PdfParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This file is part of FPDI
*
* @package setasign\Fpdi
* @copyright Copyright (c) 2024 Setasign GmbH & Co. KG (https://www.setasign.com)
* @copyright Copyright (c) 2026 Setasign GmbH & Co. KG (https://www.setasign.com)
* @license http://opensource.org/licenses/mit-license The MIT License
*/

Expand Down Expand Up @@ -177,7 +177,7 @@ public function getPdfVersion()
PdfParserException::PDF_VERSION_NOT_FOUND
);
}
list(, $major, $minor) = $result;
[, $major, $minor] = $result;

$catalog = $this->getCatalog();
if (isset($catalog->value['Version'])) {
Expand All @@ -186,7 +186,7 @@ public function getPdfVersion()
PdfName::unescape(PdfType::resolve($catalog->value['Version'], $this)->value)
);
if (count($versionParts) === 2) {
list($major, $minor) = $versionParts;
[$major, $minor] = $versionParts;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/PdfParser/PdfParserException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This file is part of FPDI
*
* @package setasign\Fpdi
* @copyright Copyright (c) 2024 Setasign GmbH & Co. KG (https://www.setasign.com)
* @copyright Copyright (c) 2026 Setasign GmbH & Co. KG (https://www.setasign.com)
* @license http://opensource.org/licenses/mit-license The MIT License
*/

Expand Down
Loading