|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* This file is based on code of tecnickcom/TCPDF PDF library. |
|
5
|
|
|
* |
|
6
|
|
|
* Original author Nicola Asuni ([email protected]) and |
|
7
|
|
|
* contributors (https://github.com/tecnickcom/TCPDF/graphs/contributors). |
|
8
|
|
|
* |
|
9
|
|
|
* @see https://github.com/tecnickcom/TCPDF |
|
10
|
|
|
* |
|
11
|
|
|
* Original code was licensed on the terms of the LGPL v3. |
|
12
|
|
|
* |
|
13
|
|
|
* ------------------------------------------------------------------------------ |
|
14
|
|
|
* |
|
15
|
|
|
* @file This file is part of the PdfParser library. |
|
16
|
|
|
* |
|
17
|
|
|
* @author Alastair Irvine <[email protected]> |
|
18
|
|
|
* |
|
19
|
|
|
* @date 2024-01-12 |
|
20
|
|
|
* |
|
21
|
|
|
* @license LGPLv3 |
|
22
|
|
|
* |
|
23
|
|
|
* @url <https://github.com/smalot/pdfparser> |
|
24
|
|
|
* |
|
25
|
|
|
* PdfParser is a pdf library written in PHP, extraction oriented. |
|
26
|
|
|
* Copyright (C) 2017 - Sébastien MALOT <[email protected]> |
|
27
|
|
|
* |
|
28
|
|
|
* This program is free software: you can redistribute it and/or modify |
|
29
|
|
|
* it under the terms of the GNU Lesser General Public License as published by |
|
30
|
|
|
* the Free Software Foundation, either version 3 of the License, or |
|
31
|
|
|
* (at your option) any later version. |
|
32
|
|
|
* |
|
33
|
|
|
* This program is distributed in the hope that it will be useful, |
|
34
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
35
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
36
|
|
|
* GNU Lesser General Public License for more details. |
|
37
|
|
|
* |
|
38
|
|
|
* You should have received a copy of the GNU Lesser General Public License |
|
39
|
|
|
* along with this program. |
|
40
|
|
|
* If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>. |
|
41
|
|
|
*/ |
|
42
|
|
|
|
|
43
|
|
|
namespace Smalot\PdfParser; |
|
44
|
|
|
|
|
45
|
|
|
/** |
|
46
|
|
|
*/ |
|
47
|
|
|
class Utils |
|
48
|
|
|
{ |
|
49
|
|
|
/** |
|
50
|
|
|
* Convert an integer to a string of @p $numBytes bytes, LSB first. |
|
51
|
|
|
* |
|
52
|
|
|
* @return byte string representing a little-endian integer |
|
|
|
|
|
|
53
|
|
|
*/ |
|
54
|
|
|
static function lowestBytesStr($n, $numBytes) |
|
|
|
|
|
|
55
|
|
|
{ |
|
56
|
|
|
$result = ""; |
|
57
|
|
|
for ($i = 0; $i < $numBytes; ++$i) { |
|
58
|
|
|
$result .= chr($n & 0xFF); |
|
59
|
|
|
$n = $n >> 8; |
|
60
|
|
|
} |
|
61
|
|
|
return $result; |
|
|
|
|
|
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
|
|
65
|
|
|
/** |
|
66
|
|
|
* Create a byte string of a given length. |
|
67
|
|
|
* |
|
68
|
|
|
* @param $numBytes |
|
69
|
|
|
* @param $byte The byte to use for each character, default NUL |
|
|
|
|
|
|
70
|
|
|
* |
|
71
|
|
|
* @return byte string representing a little-endian integer |
|
72
|
|
|
*/ |
|
73
|
|
|
static function byteString(int $numBytes, int $byte = 0) |
|
|
|
|
|
|
74
|
|
|
{ |
|
75
|
|
|
return \implode(\array_map( |
|
|
|
|
|
|
76
|
|
|
function($n) { return chr($n); }, |
|
77
|
|
|
\array_fill(0, $numBytes, $byte) |
|
78
|
|
|
)); |
|
79
|
|
|
} |
|
80
|
|
|
} |
|
81
|
|
|
|
|
82
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths