pax_global_header 0000666 0000000 0000000 00000000064 15112050317 0014505 g ustar 00root root 0000000 0000000 52 comment=f8039166007112ef2a803092726873b294a91574
icingaweb2-module-pdfexport-0.12.0+dfsg/ 0000775 0000000 0000000 00000000000 15112050317 0020012 5 ustar 00root root 0000000 0000000 icingaweb2-module-pdfexport-0.12.0+dfsg/.github/ 0000775 0000000 0000000 00000000000 15112050317 0021352 5 ustar 00root root 0000000 0000000 icingaweb2-module-pdfexport-0.12.0+dfsg/.github/ISSUE_TEMPLATE.md 0000664 0000000 0000000 00000002747 15112050317 0024071 0 ustar 00root root 0000000 0000000
## Expected Behavior
## Current Behavior
## Possible Solution
## Steps to Reproduce (for bugs)
1.
2.
3.
4.
## Context
## Your Environment
* Module version (System - About):
* Icinga Web 2 version and modules (System - About):
* Icinga 2 version (`icinga2 --version`):
* Operating System and version:
* Webserver, PHP versions:
icingaweb2-module-pdfexport-0.12.0+dfsg/.github/ISSUE_TEMPLATE/ 0000775 0000000 0000000 00000000000 15112050317 0023535 5 ustar 00root root 0000000 0000000 icingaweb2-module-pdfexport-0.12.0+dfsg/.github/ISSUE_TEMPLATE/bug_report.md 0000664 0000000 0000000 00000001373 15112050317 0026233 0 ustar 00root root 0000000 0000000 ---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
## Describe the bug
A clear and concise description of what the bug is.
## To Reproduce
Steps to reproduce the behavior:
1.
2.
3.
4.
## Expected behavior
A clear and concise description of what you expected to happen.
## Screenshots
If applicable, add screenshots to help explain your problem.
## Your Environment
* Module version:
* Dependent module versions:
* Icinga Web 2 version and modules (System - About):
* Chrome/Chromium version (`google-chrome --version`):
* Web browser and version:
* PHP version used (`php --version`):
* Server operating system and version:
## Additional context
Add any other context about the problem here.
icingaweb2-module-pdfexport-0.12.0+dfsg/.github/ISSUE_TEMPLATE/feature_request.md 0000664 0000000 0000000 00000001142 15112050317 0027260 0 ustar 00root root 0000000 0000000 ---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
## Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always using this feature but am missing [...]
## Describe the solution you'd like
A clear and concise description of what you want to happen.
## Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
## Additional context
Add any other context or screenshots about the feature request here.
icingaweb2-module-pdfexport-0.12.0+dfsg/.github/dependabot.yml 0000664 0000000 0000000 00000000157 15112050317 0024205 0 ustar 00root root 0000000 0000000 version: 2
updates:
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "daily"
icingaweb2-module-pdfexport-0.12.0+dfsg/.github/workflows/ 0000775 0000000 0000000 00000000000 15112050317 0023407 5 ustar 00root root 0000000 0000000 icingaweb2-module-pdfexport-0.12.0+dfsg/.github/workflows/L10n-update.yml 0000664 0000000 0000000 00000000247 15112050317 0026127 0 ustar 00root root 0000000 0000000 name: L10n Update
on:
push:
branches:
- main
jobs:
update:
uses: icinga/github-actions/.github/workflows/L10n-update.yml@main
secrets: inherit
icingaweb2-module-pdfexport-0.12.0+dfsg/.github/workflows/php.yml 0000664 0000000 0000000 00000001554 15112050317 0024726 0 ustar 00root root 0000000 0000000 name: PHP Tests
on:
push:
branches:
- main
- release/*
pull_request:
branches:
- main
jobs:
lint:
name: Static analysis for php ${{ matrix.php }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
php: ['8.2', '8.3', '8.4']
os: ['ubuntu-latest']
steps:
- name: Checkout code base
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: phpcs
- name: Setup dependencies
run: composer require -n --no-progress overtrue/phplint
- name: PHP Lint
if: ${{ ! cancelled() }}
run: ./vendor/bin/phplint -n --exclude={^vendor/.*} -- .
- name: PHP CodeSniffer
if: ${{ ! cancelled() }}
run: phpcs
icingaweb2-module-pdfexport-0.12.0+dfsg/.github/workflows/phpstan.yml 0000664 0000000 0000000 00000000414 15112050317 0025606 0 ustar 00root root 0000000 0000000 name: PHPStan
on:
pull_request:
branches:
- main
jobs:
phpstan:
uses: icinga/github-actions/.github/workflows/phpstan.yml@main
with:
dependencies: |
{
"/icingaweb2" : "https://github.com/Icinga/icingaweb2.git"
}
icingaweb2-module-pdfexport-0.12.0+dfsg/.gitignore 0000664 0000000 0000000 00000000104 15112050317 0021775 0 ustar 00root root 0000000 0000000 # Exclude all hidden files
.*
# Except those related to Git
!.git*
icingaweb2-module-pdfexport-0.12.0+dfsg/.phpcs.xml 0000664 0000000 0000000 00000001333 15112050317 0021727 0 ustar 00root root 0000000 0000000
Sniff our code a while
./
vendor/*
icingaweb2-module-pdfexport-0.12.0+dfsg/LICENSE 0000664 0000000 0000000 00000043176 15112050317 0021032 0 ustar 00root root 0000000 0000000 GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{description}
Copyright (C) {year} {fullname}
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
{signature of Ty Coon}, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
icingaweb2-module-pdfexport-0.12.0+dfsg/README.md 0000664 0000000 0000000 00000001101 15112050317 0021262 0 ustar 00root root 0000000 0000000 # Icinga PDF Export
[](https://php.net/)

[](https://github.com/Icinga/icingaweb2-module-pdfexport)
PDF export functionality for Icinga Web 2 using Google Chrome/Chromium for rendering.
## Documentation
* [Installation](doc/02-Installation.md)
* [Troubleshooting](doc/70-Troubleshooting.md)
icingaweb2-module-pdfexport-0.12.0+dfsg/application/ 0000775 0000000 0000000 00000000000 15112050317 0022315 5 ustar 00root root 0000000 0000000 icingaweb2-module-pdfexport-0.12.0+dfsg/application/controllers/ 0000775 0000000 0000000 00000000000 15112050317 0024663 5 ustar 00root root 0000000 0000000 icingaweb2-module-pdfexport-0.12.0+dfsg/application/controllers/ConfigController.php 0000664 0000000 0000000 00000001250 15112050317 0030643 0 ustar 00root root 0000000 0000000 assertPermission('config/modules');
parent::init();
}
public function chromeAction()
{
$form = (new ChromeBinaryForm())
->setIniConfig(Config::module('pdfexport'));
$form->handleRequest();
$this->view->tabs = $this->Module()->getConfigTabs()->activate('chrome');
$this->view->form = $form;
}
}
icingaweb2-module-pdfexport-0.12.0+dfsg/application/forms/ 0000775 0000000 0000000 00000000000 15112050317 0023443 5 ustar 00root root 0000000 0000000 icingaweb2-module-pdfexport-0.12.0+dfsg/application/forms/ChromeBinaryForm.php 0000664 0000000 0000000 00000006071 15112050317 0027366 0 ustar 00root root 0000000 0000000 setName('pdfexport_binary');
$this->setSubmitLabel($this->translate('Save Changes'));
}
public function createElements(array $formData)
{
$this->addElement('text', 'chrome_binary', [
'label' => $this->translate('Local Binary'),
'placeholder' => '/usr/bin/google-chrome',
'validators' => [new Zend_Validate_Callback(function ($value) {
$chrome = (new HeadlessChrome())
->setBinary($value);
try {
$version = $chrome->getVersion();
} catch (Exception $e) {
$this->getElement('chrome_binary')->addError($e->getMessage());
return true;
}
if ($version < 59) {
$this->getElement('chrome_binary')->addError(sprintf(
$this->translate(
'Chrome/Chromium supporting headless mode required'
. ' which is provided since version 59. Version detected: %s'
),
$version
));
}
return true;
})]
]);
$this->addElement('checkbox', 'chrome_force_temp_storage', [
'label' => $this->translate('Force local temp storage')
]);
$this->addElement('text', 'chrome_host', [
'label' => $this->translate('Remote Host'),
'validators' => [new Zend_Validate_Callback(function ($value) {
if ($value === null) {
return true;
}
$port = $this->getValue('chrome_port') ?: 9222;
$chrome = (new HeadlessChrome())
->setRemote($value, $port);
try {
$version = $chrome->getVersion();
} catch (Exception $e) {
$this->getElement('chrome_host')->addError($e->getMessage());
return true;
}
if ($version < 59) {
$this->getElement('chrome_host')->addError(sprintf(
$this->translate(
'Chrome/Chromium supporting headless mode required'
. ' which is provided since version 59. Version detected: %s'
),
$version
));
}
return true;
})]
]);
$this->addElement('number', 'chrome_port', [
'label' => $this->translate('Remote Port'),
'placeholder' => 9222,
'min' => 1,
'max' => 65535
]);
}
}
icingaweb2-module-pdfexport-0.12.0+dfsg/application/views/ 0000775 0000000 0000000 00000000000 15112050317 0023452 5 ustar 00root root 0000000 0000000 icingaweb2-module-pdfexport-0.12.0+dfsg/application/views/scripts/ 0000775 0000000 0000000 00000000000 15112050317 0025141 5 ustar 00root root 0000000 0000000 icingaweb2-module-pdfexport-0.12.0+dfsg/application/views/scripts/config/ 0000775 0000000 0000000 00000000000 15112050317 0026406 5 ustar 00root root 0000000 0000000 icingaweb2-module-pdfexport-0.12.0+dfsg/application/views/scripts/config/chrome.phtml 0000664 0000000 0000000 00000000311 15112050317 0030724 0 ustar 00root root 0000000 0000000
= /** @var \Icinga\Web\Widget\Tabs $tabs */ $tabs ?>
= /** @var \Icinga\Module\Pdfexport\Forms\ChromeBinaryForm $form */ $form ?>
icingaweb2-module-pdfexport-0.12.0+dfsg/composer.json 0000664 0000000 0000000 00000000231 15112050317 0022530 0 ustar 00root root 0000000 0000000 {
"require": {
"php": ">=8.2",
"phrity/websocket": "^3.6",
"karriere/pdf-merge": "^3.3"
},
"config": {
"sort-packages": true
}
}
icingaweb2-module-pdfexport-0.12.0+dfsg/composer.lock 0000664 0000000 0000000 00000056340 15112050317 0022523 0 ustar 00root root 0000000 0000000 {
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "5cffa2096256d965b5bbedcd5a7b515b",
"packages": [
{
"name": "karriere/pdf-merge",
"version": "v3.3.1",
"source": {
"type": "git",
"url": "https://github.com/karriereat/pdf-merge.git",
"reference": "d524a9d261ea96b18bbbab685b5710a7a0fe3a6e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/karriereat/pdf-merge/zipball/d524a9d261ea96b18bbbab685b5710a7a0fe3a6e",
"reference": "d524a9d261ea96b18bbbab685b5710a7a0fe3a6e",
"shasum": ""
},
"require": {
"php": "8.1.* | 8.2.* | 8.3.* | 8.4.*",
"tecnickcom/tcpdf": "^6.3"
},
"require-dev": {
"laravel/pint": "^1.5 | ^1.6",
"pestphp/pest": "^1.22",
"phpstan/phpstan": "^1.10"
},
"type": "library",
"autoload": {
"psr-4": {
"Karriere\\PdfMerge\\": "src/"
},
"classmap": [
"tcpi/fpdf_tpl.php",
"tcpi/tcpdi.php",
"tcpi/tcpdi_parser.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "Alexander Lentner",
"email": "alexander.lentner@karriere.at",
"role": "Maintainer"
}
],
"description": "A wrapper for the TCPDF class that provides an elegant API for merging PDFs",
"keywords": [
"merge",
"pdf"
],
"support": {
"issues": "https://github.com/karriereat/pdf-merge/issues",
"source": "https://github.com/karriereat/pdf-merge/tree/v3.3.1"
},
"time": "2025-02-19T11:02:10+00:00"
},
{
"name": "phrity/comparison",
"version": "1.4.0",
"source": {
"type": "git",
"url": "https://github.com/sirn-se/phrity-comparison.git",
"reference": "aedd44d59db08de7d6c31812d1490c22aab35c92"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sirn-se/phrity-comparison/zipball/aedd44d59db08de7d6c31812d1490c22aab35c92",
"reference": "aedd44d59db08de7d6c31812d1490c22aab35c92",
"shasum": ""
},
"require": {
"php": "^8.1"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.0",
"phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^10.0 | ^11.0 | ^12.0",
"squizlabs/php_codesniffer": "^3.5"
},
"type": "library",
"autoload": {
"psr-4": {
"Phrity\\Comparison\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Sören Jensen",
"email": "sirn@sirn.se",
"homepage": "https://phrity.sirn.se"
}
],
"description": "Interfaces and helper trait for comparing objects. Comparator for sort and filter applications.",
"homepage": "https://phrity.sirn.se/comparison",
"keywords": [
"comparable",
"comparator",
"comparison",
"equalable",
"filter",
"sort"
],
"support": {
"issues": "https://github.com/sirn-se/phrity-comparison/issues",
"source": "https://github.com/sirn-se/phrity-comparison/tree/1.4.0"
},
"time": "2025-05-26T20:12:39+00:00"
},
{
"name": "phrity/http",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/sirn-se/phrity-http.git",
"reference": "536e3e46e6220d171a59599ed1f4da9f6b6244fc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sirn-se/phrity-http/zipball/536e3e46e6220d171a59599ed1f4da9f6b6244fc",
"reference": "536e3e46e6220d171a59599ed1f4da9f6b6244fc",
"shasum": ""
},
"require": {
"php": "^8.1",
"psr/http-factory": "^1.0",
"psr/http-message": "^1.1 | ^2.0"
},
"require-dev": {
"guzzlehttp/psr7": "^2.0",
"phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^10.0 | ^11.0 | ^12.0",
"robiningelbrecht/phpunit-coverage-tools": "^1.9",
"squizlabs/php_codesniffer": "^3.5"
},
"type": "library",
"autoload": {
"psr-4": {
"Phrity\\Http\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Sören Jensen",
"email": "sirn@sirn.se",
"homepage": "https://phrity.sirn.se"
}
],
"description": "Utilities and interfaces for handling HTTP.",
"homepage": "https://phrity.sirn.se/http",
"keywords": [
"HTTP Factories",
"http",
"psr-17"
],
"support": {
"issues": "https://github.com/sirn-se/phrity-http/issues",
"source": "https://github.com/sirn-se/phrity-http/tree/1.0.0"
},
"time": "2025-09-07T17:04:26+00:00"
},
{
"name": "phrity/net-stream",
"version": "2.3.1",
"source": {
"type": "git",
"url": "https://github.com/sirn-se/phrity-net-stream.git",
"reference": "c621bb3108a5a02bba64df2e5f0cd7ada02665b5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sirn-se/phrity-net-stream/zipball/c621bb3108a5a02bba64df2e5f0cd7ada02665b5",
"reference": "c621bb3108a5a02bba64df2e5f0cd7ada02665b5",
"shasum": ""
},
"require": {
"php": "^8.1",
"phrity/util-errorhandler": "^1.1",
"psr/http-factory": "^1.0",
"psr/http-message": "^1.1 | ^2.0"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.0",
"phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^10.0 | ^11.0 | ^12.0",
"phrity/net-uri": "^2.0",
"squizlabs/php_codesniffer": "^3.5"
},
"type": "library",
"autoload": {
"psr-4": {
"Phrity\\Net\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Sören Jensen",
"email": "sirn@sirn.se",
"homepage": "https://phrity.sirn.se"
}
],
"description": "Socket stream classes implementing PSR-7 Stream and PSR-17 StreamFactory",
"homepage": "https://phrity.sirn.se/net-stream",
"keywords": [
"Socket",
"client",
"psr-17",
"psr-7",
"server",
"stream",
"stream factory"
],
"support": {
"issues": "https://github.com/sirn-se/phrity-net-stream/issues",
"source": "https://github.com/sirn-se/phrity-net-stream/tree/2.3.1"
},
"time": "2025-08-08T09:51:04+00:00"
},
{
"name": "phrity/net-uri",
"version": "2.2.0",
"source": {
"type": "git",
"url": "https://github.com/sirn-se/phrity-net-uri.git",
"reference": "08de4cf07e439c4708f572249659f09198ac99f0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sirn-se/phrity-net-uri/zipball/08de4cf07e439c4708f572249659f09198ac99f0",
"reference": "08de4cf07e439c4708f572249659f09198ac99f0",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"php": "^8.1",
"phrity/comparison": "^1.0",
"psr/http-factory": "^1.0",
"psr/http-message": "^1.1 | ^2.0"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.0",
"phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^10.0 | ^11.0 | ^12.0",
"phrity/util-errorhandler": "^1.1",
"squizlabs/php_codesniffer": "^3.5"
},
"suggest": {
"ext-intl": "Enables IDN conversion for non-ASCII domains"
},
"type": "library",
"autoload": {
"psr-4": {
"Phrity\\Net\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Sören Jensen",
"email": "sirn@sirn.se",
"homepage": "https://phrity.sirn.se"
}
],
"description": "PSR-7 Uri and PSR-17 UriFactory implementation",
"homepage": "https://phrity.sirn.se/net-uri",
"keywords": [
"psr-17",
"psr-7",
"uri",
"uri factory"
],
"support": {
"issues": "https://github.com/sirn-se/phrity-net-uri/issues",
"source": "https://github.com/sirn-se/phrity-net-uri/tree/2.2.0"
},
"time": "2025-05-25T13:05:13+00:00"
},
{
"name": "phrity/util-errorhandler",
"version": "1.2.1",
"source": {
"type": "git",
"url": "https://github.com/sirn-se/phrity-util-errorhandler.git",
"reference": "9825f15ef9b4a93252ce53ca8962278832d834da"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sirn-se/phrity-util-errorhandler/zipball/9825f15ef9b4a93252ce53ca8962278832d834da",
"reference": "9825f15ef9b4a93252ce53ca8962278832d834da",
"shasum": ""
},
"require": {
"php": "^8.1"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.0",
"phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^10.0 | ^11.0 | ^12.0",
"squizlabs/php_codesniffer": "^3.5"
},
"type": "library",
"autoload": {
"psr-4": {
"Phrity\\Util\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Sören Jensen",
"email": "sirn@sirn.se",
"homepage": "https://phrity.sirn.se"
}
],
"description": "Inline error handler; catch and resolve errors for code block.",
"homepage": "https://phrity.sirn.se/util-errorhandler",
"keywords": [
"error",
"warning"
],
"support": {
"issues": "https://github.com/sirn-se/phrity-util-errorhandler/issues",
"source": "https://github.com/sirn-se/phrity-util-errorhandler/tree/1.2.1"
},
"time": "2025-08-08T09:48:45+00:00"
},
{
"name": "phrity/websocket",
"version": "3.6.0",
"source": {
"type": "git",
"url": "https://github.com/sirn-se/websocket-php.git",
"reference": "3f16b2564a230bbce716cccaff2f6156a60a8798"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sirn-se/websocket-php/zipball/3f16b2564a230bbce716cccaff2f6156a60a8798",
"reference": "3f16b2564a230bbce716cccaff2f6156a60a8798",
"shasum": ""
},
"require": {
"php": "^8.1",
"phrity/http": "^1.0",
"phrity/net-stream": "^2.3",
"phrity/net-uri": "^2.1",
"psr/http-message": "^1.1 | ^2.0",
"psr/log": "^1.0 | ^2.0 | ^3.0"
},
"require-dev": {
"guzzlehttp/psr7": "^2.0",
"php-coveralls/php-coveralls": "^2.0",
"phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^10.0 | ^11.0 | ^12.0",
"phrity/logger-console": "^1.0",
"phrity/net-mock": "^2.3",
"phrity/util-errorhandler": "^1.1",
"robiningelbrecht/phpunit-coverage-tools": "^1.9",
"squizlabs/php_codesniffer": "^3.5"
},
"type": "library",
"autoload": {
"psr-4": {
"WebSocket\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"ISC"
],
"authors": [
{
"name": "Fredrik Liljegren"
},
{
"name": "Sören Jensen",
"email": "sirn@sirn.se",
"homepage": "https://phrity.sirn.se"
}
],
"description": "WebSocket client and server",
"homepage": "https://phrity.sirn.se/websocket",
"keywords": [
"client",
"server",
"websocket"
],
"support": {
"issues": "https://github.com/sirn-se/websocket-php/issues",
"source": "https://github.com/sirn-se/websocket-php/tree/3.6.0"
},
"time": "2025-09-08T16:21:41+00:00"
},
{
"name": "psr/http-factory",
"version": "1.1.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-factory.git",
"reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a",
"reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a",
"shasum": ""
},
"require": {
"php": ">=7.1",
"psr/http-message": "^1.0 || ^2.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Http\\Message\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"description": "PSR-17: Common interfaces for PSR-7 HTTP message factories",
"keywords": [
"factory",
"http",
"message",
"psr",
"psr-17",
"psr-7",
"request",
"response"
],
"support": {
"source": "https://github.com/php-fig/http-factory"
},
"time": "2024-04-15T12:06:14+00:00"
},
{
"name": "psr/http-message",
"version": "2.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-message.git",
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71",
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Http\\Message\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common interface for HTTP messages",
"homepage": "https://github.com/php-fig/http-message",
"keywords": [
"http",
"http-message",
"psr",
"psr-7",
"request",
"response"
],
"support": {
"source": "https://github.com/php-fig/http-message/tree/2.0"
},
"time": "2023-04-04T09:54:51+00:00"
},
{
"name": "psr/log",
"version": "3.0.2",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
"reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
"shasum": ""
},
"require": {
"php": ">=8.0.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Log\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common interface for logging libraries",
"homepage": "https://github.com/php-fig/log",
"keywords": [
"log",
"psr",
"psr-3"
],
"support": {
"source": "https://github.com/php-fig/log/tree/3.0.2"
},
"time": "2024-09-11T13:17:53+00:00"
},
{
"name": "tecnickcom/tcpdf",
"version": "6.10.0",
"source": {
"type": "git",
"url": "https://github.com/tecnickcom/TCPDF.git",
"reference": "ca5b6de294512145db96bcbc94e61696599c391d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/ca5b6de294512145db96bcbc94e61696599c391d",
"reference": "ca5b6de294512145db96bcbc94e61696599c391d",
"shasum": ""
},
"require": {
"ext-curl": "*",
"php": ">=7.1.0"
},
"type": "library",
"autoload": {
"classmap": [
"config",
"include",
"tcpdf.php",
"tcpdf_barcodes_1d.php",
"tcpdf_barcodes_2d.php",
"include/tcpdf_colors.php",
"include/tcpdf_filters.php",
"include/tcpdf_font_data.php",
"include/tcpdf_fonts.php",
"include/tcpdf_images.php",
"include/tcpdf_static.php",
"include/barcodes/datamatrix.php",
"include/barcodes/pdf417.php",
"include/barcodes/qrcode.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0-or-later"
],
"authors": [
{
"name": "Nicola Asuni",
"email": "info@tecnick.com",
"role": "lead"
}
],
"description": "TCPDF is a PHP class for generating PDF documents and barcodes.",
"homepage": "http://www.tcpdf.org/",
"keywords": [
"PDFD32000-2008",
"TCPDF",
"barcodes",
"datamatrix",
"pdf",
"pdf417",
"qrcode"
],
"support": {
"issues": "https://github.com/tecnickcom/TCPDF/issues",
"source": "https://github.com/tecnickcom/TCPDF/tree/6.10.0"
},
"funding": [
{
"url": "https://www.paypal.com/donate/?hosted_button_id=NZUEC5XS8MFBJ",
"type": "custom"
}
],
"time": "2025-05-27T18:02:28+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": {},
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": ">=8.2"
},
"platform-dev": {},
"plugin-api-version": "2.6.0"
}
icingaweb2-module-pdfexport-0.12.0+dfsg/configuration.php 0000664 0000000 0000000 00000000471 15112050317 0023374 0 ustar 00root root 0000000 0000000 provideConfigTab('chrome', array(
'title' => $this->translate('Configure the Chrome/Chromium connection'),
'label' => $this->translate('Chrome'),
'url' => 'config/chrome'
));
icingaweb2-module-pdfexport-0.12.0+dfsg/doc/ 0000775 0000000 0000000 00000000000 15112050317 0020557 5 ustar 00root root 0000000 0000000 icingaweb2-module-pdfexport-0.12.0+dfsg/doc/02-Installation.md 0000664 0000000 0000000 00000005441 15112050317 0023765 0 ustar 00root root 0000000 0000000 # Installation
## Requirements
* PHP (>= 8.2)
* Icinga Web 2 (>= 2.12)
* Icinga Web 2 libraries:
* [Icinga PHP Library (ipl)](https://github.com/Icinga/icinga-php-library) (>= 0.17.1)
* [Icinga PHP Thirdparty](https://github.com/Icinga/icinga-php-thirdparty) (>= 0.13)
## Google Chrome/Chromium Setup
The module needs Google Chrome or Chromium supporting headless mode.
### RHEL/CentOS
Add the Chrome repository from Google to yum, next to EPEL.
```
yum -y install epel-release
cat >/etc/yum.repos.d/google-chrome-stable.repo <
Add the Chrome repository from Google to apt.
```
apt-get -y install apt-transport-https gnupg wget
wget -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
apt-get update
```
Install Chrome.
```
apt-get install google-chrome-stable
```
## Module Installation
1. Install it [like any other module](https://icinga.com/docs/icinga-web-2/latest/doc/08-Modules/#installation).
Use `pdfexport` as name.
2. You might need to set the absolute path to the Google Chrome / Chromium
binary, depending on your system. This can be done in
`Configuration -> Modules -> pdfexport -> Chrome`
This concludes the installation. PDF exports now use Google Chrome/Chromium for rendering.
### Using a Remote Chrome/Chromium
As an alternative to a local installation of Chrome/Chromium it is also possible
to launch and utilize a remote instance.
Just install it as described above on a different machine and configure its connection
details in `Configuration -> Modules -> pdfexport -> Chrome`.
To start a remote instance of Chrome/Chromium use the following commandline options:
> google-chrome --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222 --headless --keep-alive-for-test --disable-gpu --disable-dev-shm-usage --no-sandbox --bwsi --no-first-run --user-data-dir=/tmp --homedir=/tmp
Note that the browser does accept any and all connection attempts without any authentication.
Keep that in mind and let it listen on a public IP (or even on 0.0.0.0) only during tests or
with a proper firewall in place.
icingaweb2-module-pdfexport-0.12.0+dfsg/doc/70-Troubleshooting.md 0000664 0000000 0000000 00000001115 15112050317 0024512 0 ustar 00root root 0000000 0000000 # Troubleshooting
## PDF Export
If the PDF export fails, ensure that Chrome headless works fine.
You can test that on the CLI like this:
```
google-chrome --version
```
If you have a local installation, you could also try to force temporary local
storage. (Available in the module's configuration) This will store the content
to print on disk, instead of transferring it directly to the browser. Note that
for this to work, the browser needs to be able to access the temporary files of
the webserver's process user.
icingaweb2-module-pdfexport-0.12.0+dfsg/library/ 0000775 0000000 0000000 00000000000 15112050317 0021456 5 ustar 00root root 0000000 0000000 icingaweb2-module-pdfexport-0.12.0+dfsg/library/Pdfexport/ 0000775 0000000 0000000 00000000000 15112050317 0023431 5 ustar 00root root 0000000 0000000 icingaweb2-module-pdfexport-0.12.0+dfsg/library/Pdfexport/HeadlessChrome.php 0000664 0000000 0000000 00000061711 15112050317 0027036 0 ustar 00root root 0000000 0000000 \d+\.?){4}:\d+)\/devtools\/browser\/([\w-]+)/';
/** @var string */
const WAIT_FOR_NETWORK = 'wait-for-network';
/** @var string Javascript Promise to wait for layout initialization */
const WAIT_FOR_LAYOUT = << {
let timeoutId = setTimeout(() => reject('fail'), 10000);
if (document.documentElement.dataset.layoutReady === 'yes') {
clearTimeout(timeoutId);
fulfill(null);
return;
}
document.addEventListener('layout-ready', e => {
clearTimeout(timeoutId);
fulfill(e.detail);
}, {
once: true
});
})
JS;
/** @var string Path to the Chrome binary */
protected $binary;
/** @var array Host and port to the remote Chrome */
protected $remote;
/**
* The document to print
*
* @var PrintableHtmlDocument
*/
protected $document;
/** @var string Target Url */
protected $url;
/** @var StorageInterface */
protected $fileStorage;
/** @var array */
private $interceptedRequests = [];
/** @var array */
private $interceptedEvents = [];
/**
* Get the path to the Chrome binary
*
* @return string
*/
public function getBinary()
{
return $this->binary;
}
/**
* Set the path to the Chrome binary
*
* @param string $binary
*
* @return $this
*/
public function setBinary($binary)
{
$this->binary = $binary;
return $this;
}
/**
* Get host and port combination of the remote chrome
*
* @return array
*/
public function getRemote()
{
return $this->remote;
}
/**
* Set host and port combination of a remote chrome
*
* @param string $host
* @param int $port
*
* @return $this
*/
public function setRemote($host, $port)
{
$this->remote = [$host, $port];
return $this;
}
/**
* Get the target Url
*
* @return string
*/
public function getUrl()
{
return $this->url;
}
/**
* Set the target Url
*
* @param string $url
*
* @return $this
*/
public function setUrl($url)
{
$this->url = $url;
return $this;
}
/**
* Get the file storage
*
* @return StorageInterface
*/
public function getFileStorage()
{
if ($this->fileStorage === null) {
$this->fileStorage = new TemporaryLocalFileStorage();
}
return $this->fileStorage;
}
/**
* Set the file storage
*
* @param StorageInterface $fileStorage
*
* @return $this
*/
public function setFileStorage($fileStorage)
{
$this->fileStorage = $fileStorage;
return $this;
}
/**
* Render the given argument name-value pairs as shell-escaped string
*
* @param array $arguments
*
* @return string
*/
public static function renderArgumentList(array $arguments)
{
$list = [];
foreach ($arguments as $name => $value) {
if ($value !== null) {
$value = escapeshellarg($value);
if (! is_int($name)) {
if (substr($name, -1) === '=') {
$glue = '';
} else {
$glue = ' ';
}
$list[] = escapeshellarg($name) . $glue . $value;
} else {
$list[] = $value;
}
} else {
$list[] = escapeshellarg($name);
}
}
return implode(' ', $list);
}
/**
* Use the given HTML as input
*
* @param string|PrintableHtmlDocument $html
* @param bool $asFile
* @return $this
*/
public function fromHtml($html, $asFile = false)
{
if ($html instanceof PrintableHtmlDocument) {
$this->document = $html;
} else {
$this->document = (new PrintableHtmlDocument())
->setContent(HtmlString::create($html));
}
if ($asFile) {
$path = uniqid('icingaweb2-pdfexport-') . '.html';
$storage = $this->getFileStorage();
$storage->create($path, $this->document->render());
$path = $storage->resolvePath($path, true);
$this->setUrl("file://$path");
}
return $this;
}
/**
* Generate a PDF raw string asynchronously.
*
* @return ExtendedPromiseInterface
*/
public function asyncToPdf(): ExtendedPromiseInterface
{
$deferred = new Promise\Deferred();
Loop::futureTick(function () use ($deferred) {
switch (true) {
case $this->remote !== null:
try {
$result = $this->jsonVersion($this->remote[0], $this->remote[1]);
if (is_array($result)) {
$parts = explode('/', $result['webSocketDebuggerUrl']);
$pdf = $this->printToPDF(
join(':', $this->remote),
end($parts),
! $this->document->isEmpty() ? $this->document->getPrintParameters() : []
);
break;
}
} catch (Exception $e) {
if ($this->binary == null) {
$deferred->reject($e);
return;
}
Logger::warning(
'Failed to connect to remote chrome: %s:%d (%s)',
$this->remote[0],
$this->remote[1],
$e
);
}
// Reject the promise if we didn't get the expected output from the /json/version endpoint.
if ($this->binary === null) {
$deferred->reject(
new Exception('Failed to determine remote chrome version via the /json/version endpoint.')
);
return;
}
// Fallback to the local binary if a remote chrome is unavailable
case $this->binary !== null:
$browserHome = $this->getFileStorage()->resolvePath('HOME');
$commandLine = join(' ', [
escapeshellarg($this->getBinary()),
static::renderArgumentList([
'--bwsi',
'--headless',
'--disable-gpu',
'--no-sandbox',
'--no-first-run',
'--disable-dev-shm-usage',
'--remote-debugging-port=0',
'--homedir=' => $browserHome,
'--user-data-dir=' => $browserHome
])
]);
if (Platform::isLinux()) {
Logger::debug('Starting browser process: HOME=%s exec %s', $browserHome, $commandLine);
$chrome = new Process('exec ' . $commandLine, null, ['HOME' => $browserHome]);
} else {
Logger::debug('Starting browser process: %s', $commandLine);
$chrome = new Process($commandLine);
}
$killer = Loop::addTimer(10, function (TimerInterface $timer) use ($chrome, $deferred) {
$chrome->terminate(6); // SIGABRT
Logger::error(
'Browser timed out after %d seconds without the expected output',
$timer->getInterval()
);
$deferred->reject(
new Exception(
'Received empty response or none at all from browser.'
. ' Please check the logs for further details.'
)
);
});
$chrome->start();
$chrome->stderr->on('data', function ($chunk) use ($chrome, $deferred, $killer) {
Logger::debug('Caught browser output: %s', $chunk);
if (preg_match(self::DEBUG_ADDR_PATTERN, trim($chunk), $matches)) {
Loop::cancelTimer($killer);
try {
$pdf = $this->printToPDF(
$matches[1],
$matches[2],
! $this->document->isEmpty() ? $this->document->getPrintParameters() : []
);
} catch (Exception $e) {
Logger::error('Failed to print PDF. An error occurred: %s', $e);
}
$chrome->terminate();
if (! empty($pdf)) {
$deferred->resolve($pdf);
} else {
$deferred->reject(
new Exception(
'Received empty response or none at all from browser.'
. ' Please check the logs for further details.'
)
);
}
}
});
$chrome->on('exit', function ($exitCode, $signal) use ($killer) {
Loop::cancelTimer($killer);
Logger::debug('Browser terminated by signal %d and exited with code %d', $signal, $exitCode);
// Browser is either timed out (after 10s) and the promise should have already been rejected,
// or it is terminated using its terminate() method, in which case the promise is also already
// resolved/rejected. So, we don't need to resolve/reject the promise here.
});
return;
}
if (! empty($pdf)) {
$deferred->resolve($pdf);
} else {
$deferred->reject(
new Exception(
'Received empty response or none at all from browser.'
. ' Please check the logs for further details.'
)
);
}
});
return $deferred->promise();
}
/**
* Export to PDF
*
* @return string
* @throws Exception
*/
public function toPdf()
{
$pdf = '';
// We don't intend to register any then/otherwise handlers, so call done on that promise
// to properly propagate unhandled exceptions to the caller.
$this->asyncToPdf()->done(function (string $newPdf) use (&$pdf) {
$pdf = $newPdf;
});
Loop::run();
return $pdf;
}
/**
* Export to PDF and save as file on disk
*
* @return string The path to the file on disk
*/
public function savePdf()
{
$path = uniqid('icingaweb2-pdfexport-') . '.pdf';
$storage = $this->getFileStorage();
$storage->create($path, '');
$path = $storage->resolvePath($path, true);
file_put_contents($path, $this->toPdf());
return $path;
}
private function printToPDF($socket, $browserId, array $parameters)
{
$browser = new Client(sprintf('ws://%s/devtools/browser/%s', $socket, $browserId));
// Open new tab, get its id
$result = $this->communicate($browser, 'Target.createTarget', [
'url' => 'about:blank'
]);
if (isset($result['targetId'])) {
$targetId = $result['targetId'];
} else {
throw new Exception('Expected target id. Got instead: ' . json_encode($result));
}
$page = new Client(sprintf('ws://%s/devtools/page/%s', $socket, $targetId), ['timeout' => 300]);
// enable various events
$this->communicate($page, 'Log.enable');
$this->communicate($page, 'Network.enable');
$this->communicate($page, 'Page.enable');
try {
$this->communicate($page, 'Console.enable');
} catch (Exception $_) {
// Deprecated, might fail
}
if (($url = $this->getUrl()) !== null) {
// Navigate to target
$result = $this->communicate($page, 'Page.navigate', [
'url' => $url
]);
if (isset($result['frameId'])) {
$frameId = $result['frameId'];
} else {
throw new Exception('Expected navigation frame. Got instead: ' . json_encode($result));
}
// wait for page to fully load
$this->waitFor($page, 'Page.frameStoppedLoading', ['frameId' => $frameId]);
} elseif (! $this->document->isEmpty()) {
// If there's no url to load transfer the document's content directly
$this->communicate($page, 'Page.setDocumentContent', [
'frameId' => $targetId,
'html' => $this->document->render()
]);
// wait for page to fully load
$this->waitFor($page, 'Page.loadEventFired');
} else {
throw new LogicException('Nothing to print');
}
// Wait for network activity to finish
$this->waitFor($page, self::WAIT_FOR_NETWORK);
// Wait for layout to initialize
if (! $this->document->isEmpty()) {
// Ensure layout scripts work in the same environment as the pdf printing itself
$this->communicate($page, 'Emulation.setEmulatedMedia', ['media' => 'print']);
$this->communicate($page, 'Runtime.evaluate', [
'timeout' => 1000,
'expression' => 'setTimeout(() => new Layout().apply(), 0)'
]);
$promisedResult = $this->communicate($page, 'Runtime.evaluate', [
'awaitPromise' => true,
'returnByValue' => true,
'timeout' => 1000, // Failsafe, doesn't apply to `await` it seems
'expression' => static::WAIT_FOR_LAYOUT
]);
if (isset($promisedResult['exceptionDetails'])) {
if (isset($promisedResult['exceptionDetails']['exception']['description'])) {
Logger::error(
'PDF layout failed to initialize: %s',
$promisedResult['exceptionDetails']['exception']['description']
);
} else {
Logger::warning('PDF layout failed to initialize. Pages might look skewed.');
}
}
// Reset media emulation, this may prevent the real media from coming into effect?
$this->communicate($page, 'Emulation.setEmulatedMedia', ['media' => '']);
}
// print pdf
$result = $this->communicate($page, 'Page.printToPDF', array_merge(
$parameters,
['transferMode' => 'ReturnAsBase64', 'printBackground' => true]
));
if (isset($result['data']) && !empty($result['data'])) {
$pdf = base64_decode($result['data']);
} else {
throw new Exception('Expected base64 data. Got instead: ' . json_encode($result));
}
// close tab
$result = $this->communicate($browser, 'Target.closeTarget', [
'targetId' => $targetId
]);
if (! isset($result['success'])) {
throw new Exception('Expected close confirmation. Got instead: ' . json_encode($result));
}
try {
$browser->close();
} catch (ConnectionException $e) {
// For some reason, the browser doesn't send a response
Logger::debug(sprintf('Failed to close browser connection: ' . $e->getMessage()));
}
return $pdf;
}
private function renderApiCall($method, $options = null): string
{
$data = [
'id' => time(),
'method' => $method,
'params' => $options ?: []
];
return json_encode($data, JSON_FORCE_OBJECT);
}
private function parseApiResponse(string $payload)
{
$data = json_decode($payload, true);
if (isset($data['method']) || isset($data['result'])) {
return $data;
} elseif (isset($data['error'])) {
throw new Exception(sprintf(
'Error response (%s): %s',
$data['error']['code'],
$data['error']['message']
));
} else {
throw new Exception(sprintf('Unknown response received: %s', $payload));
}
}
private function registerEvent($method, $params)
{
if (Logger::getInstance()->getLevel() === Logger::DEBUG) {
$shortenValues = function ($params) use (&$shortenValues) {
foreach ($params as &$value) {
if (is_array($value)) {
$value = $shortenValues($value);
} elseif (is_string($value)) {
$shortened = substr($value, 0, 256);
if ($shortened !== $value) {
$value = $shortened . '...';
}
}
}
return $params;
};
$shortenedParams = $shortenValues($params);
Logger::debug(
'Received CDP event: %s(%s)',
$method,
join(',', array_map(function ($param) use ($shortenedParams) {
return $param . '=' . json_encode($shortenedParams[$param]);
}, array_keys($shortenedParams)))
);
}
if ($method === 'Network.requestWillBeSent') {
$this->interceptedRequests[$params['requestId']] = $params;
} elseif ($method === 'Network.loadingFinished') {
unset($this->interceptedRequests[$params['requestId']]);
} elseif ($method === 'Network.loadingFailed') {
$requestData = $this->interceptedRequests[$params['requestId']];
unset($this->interceptedRequests[$params['requestId']]);
Logger::error(
'Headless Chrome was unable to complete a request to "%s". Error: %s',
$requestData['request']['url'],
$params['errorText']
);
} else {
$this->interceptedEvents[] = ['method' => $method, 'params' => $params];
}
}
private function communicate(Client $ws, $method, $params = null)
{
Logger::debug('Transmitting CDP call: %s(%s)', $method, $params ? join(',', array_keys($params)) : '');
$ws->text($this->renderApiCall($method, $params));
do {
$response = $this->parseApiResponse($ws->receive()->getContent());
$gotEvent = isset($response['method']);
if ($gotEvent) {
$this->registerEvent($response['method'], $response['params']);
}
} while ($gotEvent);
Logger::debug('Received CDP result: %s', empty($response['result'])
? 'none'
: join(',', array_keys($response['result'])));
return $response['result'];
}
private function waitFor(Client $ws, $eventName, array $expectedParams = null)
{
if ($eventName !== self::WAIT_FOR_NETWORK) {
Logger::debug(
'Awaiting CDP event: %s(%s)',
$eventName,
$expectedParams ? join(',', array_keys($expectedParams)) : ''
);
} elseif (empty($this->interceptedRequests)) {
return null;
}
$wait = true;
$interceptedPos = -1;
$params = null;
do {
if (isset($this->interceptedEvents[++$interceptedPos])) {
$response = $this->interceptedEvents[$interceptedPos];
$intercepted = true;
} else {
$response = $this->parseApiResponse($ws->receive()->getContent());
$intercepted = false;
}
if (isset($response['method'])) {
$method = $response['method'];
$params = $response['params'];
if (! $intercepted) {
$this->registerEvent($method, $params);
}
if ($eventName === self::WAIT_FOR_NETWORK) {
$wait = ! empty($this->interceptedRequests);
} elseif ($method === $eventName) {
if ($expectedParams !== null) {
$diff = array_intersect_assoc($params, $expectedParams);
$wait = empty($diff);
} else {
$wait = false;
}
}
if (! $wait && $intercepted) {
unset($this->interceptedEvents[$interceptedPos]);
}
}
} while ($wait);
return $params;
}
/**
* Get the major version number of Chrome or false on failure
*
* @return int|false
*
* @throws Exception
*/
public function getVersion()
{
switch (true) {
case $this->remote !== null:
try {
$result = $this->jsonVersion($this->remote[0], $this->remote[1]);
$version = $result['Browser'];
break;
} catch (Exception $e) {
if ($this->binary === null) {
throw $e;
} else {
Logger::warning(
'Failed to connect to remote chrome: %s:%d (%s)',
$this->remote[0],
$this->remote[1],
$e
);
}
}
// Fallback to the local binary if a remote chrome is unavailable
case $this->binary !== null:
$command = new ShellCommand(
escapeshellarg($this->getBinary()) . ' ' . static::renderArgumentList(['--version']),
false
);
$output = $command->execute();
if ($command->getExitCode() !== 0) {
throw new \Exception($output->stderr);
}
$version = $output->stdout;
break;
default:
throw new LogicException('Set a binary or remote first');
}
if (preg_match('/(\d+)\.[\d.]+/', $version, $match)) {
return (int) $match[1];
}
return false;
}
/**
* Fetch result from the /json/version API endpoint
*
* @param string $host
* @param int $port
*
* @return bool|array
*/
protected function jsonVersion($host, $port)
{
$client = new \GuzzleHttp\Client();
try {
$response = $client->request('GET', sprintf('http://%s:%s/json/version', $host, $port));
} catch (\GuzzleHttp\Exception\ServerException $e) {
// Check if we've run into the host header security change, and re-run the request with no host header.
// ref: https://issues.chromium.org/issues/40090537
if (strstr($e->getMessage(), 'Host header is specified and is not an IP address or localhost.')) {
$response = $client->request(
'GET',
sprintf('http://%s:%s/json/version', $host, $port),
['headers' => ['Host' => null]]
);
} else {
throw $e;
}
}
if ($response->getStatusCode() !== 200) {
return false;
}
return json_decode($response->getBody(), true);
}
}
icingaweb2-module-pdfexport-0.12.0+dfsg/library/Pdfexport/PrintStyleSheet.php 0000664 0000000 0000000 00000001165 15112050317 0027253 0 ustar 00root root 0000000 0000000 lessCompiler->setTheme(join(DIRECTORY_SEPARATOR, [
Icinga::app()->getModuleManager()->getModule('pdfexport')->getCssDir(),
'print.less'
]));
if (method_exists($this->lessCompiler, 'setThemeMode')) {
$this->lessCompiler->setThemeMode($this->pubPath . '/css/modes/none.less');
}
}
}
icingaweb2-module-pdfexport-0.12.0+dfsg/library/Pdfexport/PrintableHtmlDocument.php 0000664 0000000 0000000 00000032626 15112050317 0030417 0 ustar 00root root 0000000 0000000 *:not(:last-child),
footer > *:not(:last-child) {
margin-right: 10px;
}
span {
line-height: 7px;
white-space: nowrap;
}
p {
margin: 0;
line-height: 7px;
word-break: break-word;
text-overflow: ellipsis;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}
CSS;
/** @var string Document title */
protected $title;
/**
* Paper orientation
*
* Defaults to false.
*
* @var ?bool
*/
protected $landscape;
/**
* Print background graphics
*
* Defaults to false.
*
* @var ?bool
*/
protected $printBackground;
/**
* Scale of the webpage rendering
*
* Defaults to 1.
*
* @var ?float
*/
protected $scale;
/**
* Paper width in inches
*
* Defaults to 8.5 inches.
*
* @var ?float
*/
protected $paperWidth;
/**
* Paper height in inches
*
* Defaults to 11 inches.
*
* @var ?float
*/
protected $paperHeight;
/**
* Top margin in inches
*
* Defaults to 1cm (~0.4 inches).
*
* @var ?float
*/
protected $marginTop;
/**
* Bottom margin in inches
*
* Defaults to 1cm (~0.4 inches).
*
* @var ?float
*/
protected $marginBottom;
/**
* Left margin in inches
*
* Defaults to 1cm (~0.4 inches).
*
* @var ?float
*/
protected $marginLeft;
/**
* Right margin in inches
*
* Defaults to 1cm (~0.4 inches).
*
* @var ?float
*/
protected $marginRight;
/**
* Paper ranges to print, e.g., '1-5, 8, 11-13'
*
* Defaults to the empty string, which means print all pages
*
* @var ?string
*/
protected $pageRanges;
/**
* Page height in pixels
*
* Minus the default vertical margins, this is 1035.
* If the vertical margins are zero, it's 1160.
* Whether there's a header or footer doesn't matter in any case.
*
* @var int
*/
protected $pagePixelHeight = 1035;
/**
* HTML template for the print header
*
* Should be valid HTML markup with following classes used to inject printing values into them:
* * date: formatted print date
* * title: document title
* * url: document location
* * pageNumber: current page number
* * totalPages: total pages in the document
*
* For example, `` would generate span containing the title.
*
* Note that the header cannot exceed a height of 21px regardless of the margin's height or document's scale.
* With the default style, this height is separated by three lines, each accommodating 7px.
* Use `span`'s for single line text and `p`'s for multiline text.
*
* @var ?ValidHtml
*/
protected $headerTemplate;
/**
* HTML template for the print footer
*
* Should be valid HTML markup with following classes used to inject printing values into them:
* * date: formatted print date
* * title: document title
* * url: document location
* * pageNumber: current page number
* * totalPages: total pages in the document
*
* For example, `` would generate span containing the title.
*
* Note that the footer cannot exceed a height of 21px regardless of the margin's height or document's scale.
* With the default style, this height is separated by three lines, each accommodating 7px.
* Use `span`'s for single line text and `p`'s for multiline text.
*
* @var ?ValidHtml
*/
protected $footerTemplate;
/**
* HTML for the cover page
*
* @var ValidHtml
*/
protected $coverPage;
/**
* Whether or not to prefer page size as defined by css
*
* Defaults to false, in which case the content will be scaled to fit the paper size.
*
* @var ?bool
*/
protected $preferCSSPageSize;
protected $tag = 'body';
/**
* Get the document title
*
* @return string
*/
public function getTitle()
{
return $this->title;
}
/**
* Set the document title
*
* @param string $title
*
* @return $this
*/
public function setTitle($title)
{
$this->title = $title;
return $this;
}
/**
* Set page header
*
* @param ValidHtml $header
*
* @return $this
*/
public function setHeader(ValidHtml $header)
{
$this->headerTemplate = $header;
return $this;
}
/**
* Set page footer
*
* @param ValidHtml $footer
*
* @return $this
*/
public function setFooter(ValidHtml $footer)
{
$this->footerTemplate = $footer;
return $this;
}
/**
* Get the cover page
*
* @return ValidHtml|null
*/
public function getCoverPage()
{
return $this->coverPage;
}
/**
* Set cover page
*
* @param ValidHtml $coverPage
*
* @return $this
*/
public function setCoverPage(ValidHtml $coverPage)
{
$this->coverPage = $coverPage;
return $this;
}
/**
* Remove page margins
*
* @return $this
*/
public function removeMargins()
{
$this->marginBottom = 0;
$this->marginLeft = 0;
$this->marginRight = 0;
$this->marginTop = 0;
return $this;
}
/**
* Finalize document to be printed
*/
protected function assemble()
{
$this->setWrapper(new HtmlElement(
'html',
null,
new HtmlElement(
'head',
null,
new HtmlElement(
'title',
null,
Text::create($this->title)
),
$this->createStylesheet(),
$this->createLayoutScript()
)
));
$this->getAttributes()->registerAttributeCallback('data-content-height', function () {
return $this->pagePixelHeight;
});
$this->getAttributes()->registerAttributeCallback('style', function () {
return sprintf('width: %sin;', $this->paperWidth ?: 8.5);
});
}
/**
* Get the parameters for Page.printToPDF
*
* @return array
*/
public function getPrintParameters()
{
$parameters = [];
if (isset($this->landscape)) {
$parameters['landscape'] = $this->landscape;
}
if (isset($this->printBackground)) {
$parameters['printBackground'] = $this->printBackground;
}
if (isset($this->scale)) {
$parameters['scale'] = $this->scale;
}
if (isset($this->paperWidth)) {
$parameters['paperWidth'] = $this->paperWidth;
}
if (isset($this->paperHeight)) {
$parameters['paperHeight'] = $this->paperHeight;
}
if (isset($this->marginTop)) {
$parameters['marginTop'] = $this->marginTop;
}
if (isset($this->marginBottom)) {
$parameters['marginBottom'] = $this->marginBottom;
}
if (isset($this->marginLeft)) {
$parameters['marginLeft'] = $this->marginLeft;
}
if (isset($this->marginRight)) {
$parameters['marginRight'] = $this->marginRight;
}
if (isset($this->pageRanges)) {
$parameters['pageRanges'] = $this->pageRanges;
}
if (isset($this->headerTemplate)) {
$parameters['headerTemplate'] = $this->createHeader()->render();
$parameters['displayHeaderFooter'] = true;
if (! isset($parameters['marginTop'])) {
$parameters['marginTop'] = 0.6;
}
} else {
$parameters['headerTemplate'] = ' '; // An empty string is ignored
}
if (isset($this->footerTemplate)) {
$parameters['footerTemplate'] = $this->createFooter()->render();
$parameters['displayHeaderFooter'] = true;
if (! isset($parameters['marginBottom'])) {
$parameters['marginBottom'] = 0.6;
}
} else {
$parameters['footerTemplate'] = ' '; // An empty string is ignored
}
if (isset($this->preferCSSPageSize)) {
$parameters['preferCSSPageSize'] = $this->preferCSSPageSize;
}
return $parameters;
}
/**
* Create CSS stylesheet
*
* @return ValidHtml
*/
protected function createStylesheet(): ValidHtml
{
$app = Icinga::app();
$css = preg_replace_callback(
'~(?<=url\()[\'"]?([^(\'"]*)[\'"]?(?=\))~',
function ($matches) use ($app) {
if (substr($matches[1], 0, 3) !== '../') {
return $matches[1];
}
$path = substr($matches[1], 3);
if (substr($path, 0, 4) === 'lib/') {
$assetPath = substr($path, 4);
$library = null;
foreach ($app->getLibraries() as $candidate) {
if (substr($assetPath, 0, strlen($candidate->getName())) === $candidate->getName()) {
$library = $candidate;
$assetPath = ltrim(substr($assetPath, strlen($candidate->getName())), '/');
break;
}
}
if ($library === null) {
return $matches[1];
}
$path = $library->getStaticAssetPath() . DIRECTORY_SEPARATOR . $assetPath;
} elseif (substr($matches[1], 0, 14) === '../static/img?') {
list($_, $query) = explode('?', $matches[1], 2);
$params = UrlParams::fromQueryString($query);
if (! $app->getModuleManager()->hasEnabled($params->get('module_name'))) {
return $matches[1];
}
$module = $app->getModuleManager()->getModule($params->get('module_name'));
$imgRoot = $module->getBaseDir() . '/public/img/';
$path = realpath($imgRoot . $params->get('file'));
} else {
$path = $app->getBootstrapDirectory() . '/' . $path;
}
if (! $path || ! file_exists($path) || ! is_file($path)) {
return $matches[1];
}
$mimeType = @mime_content_type($path);
if ($mimeType === false) {
return $matches[1];
}
$fileContent = @file_get_contents($path);
if ($fileContent === false) {
return $matches[1];
}
return "'data:$mimeType; base64, " . base64_encode($fileContent) . "'";
},
(new PrintStyleSheet())->render(true)
);
return new HtmlElement('style', null, HtmlString::create($css));
}
/**
* Create layout javascript
*
* @return ValidHtml
*/
protected function createLayoutScript(): ValidHtml
{
$module = Icinga::app()->getModuleManager()->getModule('pdfexport');
if (! method_exists($module, 'getJsDir')) {
$jsPath = join(DIRECTORY_SEPARATOR, [$module->getBaseDir(), 'public', 'js']);
} else {
$jsPath = $module->getJsDir();
}
$layoutJS = file_get_contents($jsPath . '/layout.js') . "\n\n\n";
$layoutJS .= file_get_contents($jsPath . '/layout-plugins/page-breaker.js') . "\n\n\n";
return new HtmlElement(
'script',
Attributes::create(['type' => 'application/javascript']),
HtmlString::create($layoutJS)
);
}
/**
* Create document header
*
* @return ValidHtml
*/
protected function createHeader(): ValidHtml
{
return (new HtmlDocument())
->addHtml(
new HtmlElement('style', null, HtmlString::create(
static::DEFAULT_HEADER_FOOTER_STYLE
)),
new HtmlElement('header', null, $this->headerTemplate)
);
}
/**
* Create document footer
*
* @return ValidHtml
*/
protected function createFooter(): ValidHtml
{
return (new HtmlDocument())
->addHtml(
new HtmlElement('style', null, HtmlString::create(
static::DEFAULT_HEADER_FOOTER_STYLE
)),
new HtmlElement('footer', null, $this->footerTemplate)
);
}
}
icingaweb2-module-pdfexport-0.12.0+dfsg/library/Pdfexport/ProvidedHook/ 0000775 0000000 0000000 00000000000 15112050317 0026026 5 ustar 00root root 0000000 0000000 icingaweb2-module-pdfexport-0.12.0+dfsg/library/Pdfexport/ProvidedHook/Pdfexport.php 0000664 0000000 0000000 00000012724 15112050317 0030520 0 ustar 00root root 0000000 0000000 isSupported()) {
throw new Exception(
sprintf("Can't export: %s does not support exporting PDFs", get_class($pdfexport))
);
}
}
if (! $pdfexport) {
throw new Exception("Can't export: No module found which provides PDF export");
}
return $pdfexport;
}
public static function getBinary()
{
return Config::module('pdfexport')->get('chrome', 'binary', '/usr/bin/google-chrome');
}
public static function getForceTempStorage()
{
return (bool) Config::module('pdfexport')->get('chrome', 'force_temp_storage', '0');
}
public static function getHost()
{
return Config::module('pdfexport')->get('chrome', 'host');
}
public static function getPort()
{
return Config::module('pdfexport')->get('chrome', 'port', 9222);
}
public function isSupported()
{
try {
return $this->chrome()->getVersion() >= 59;
} catch (Exception $e) {
return false;
}
}
public function htmlToPdf($html)
{
// Keep reference to the chrome object because it is using temp files which are automatically removed when
// the object is destructed
$chrome = $this->chrome();
$pdf = $chrome->fromHtml($html, static::getForceTempStorage())->toPdf();
if ($html instanceof PrintableHtmlDocument && ($coverPage = $html->getCoverPage()) !== null) {
$coverPagePdf = $chrome
->fromHtml(
(new PrintableHtmlDocument())
->add($coverPage)
->addAttributes($html->getAttributes())
->removeMargins(),
static::getForceTempStorage()
)
->toPdf();
$pdf = $this->mergePdfs($coverPagePdf, $pdf);
}
return $pdf;
}
/**
* Transforms the given printable html document/string asynchronously to PDF.
*
* @param PrintableHtmlDocument|string $html
*
* @return ExtendedPromiseInterface
*/
public function asyncHtmlToPdf($html): ExtendedPromiseInterface
{
// Keep reference to the chrome object because it is using temp files which are automatically removed when
// the object is destructed
$chrome = $this->chrome();
$pdfPromise = $chrome->fromHtml($html, static::getForceTempStorage())->asyncToPdf();
if ($html instanceof PrintableHtmlDocument && ($coverPage = $html->getCoverPage()) !== null) {
/** @var ExtendedPromiseInterface $pdfPromise */
$pdfPromise = $pdfPromise->then(function (string $pdf) use ($chrome, $html, $coverPage) {
return $chrome->fromHtml(
(new PrintableHtmlDocument())
->add($coverPage)
->addAttributes($html->getAttributes())
->removeMargins(),
static::getForceTempStorage()
)->asyncToPdf()->then(
function (string $coverPagePdf) use ($pdf) {
return $this->mergePdfs($coverPagePdf, $pdf);
}
);
});
}
return $pdfPromise;
}
public function streamPdfFromHtml($html, $filename)
{
$filename = basename($filename, '.pdf') . '.pdf';
// Generate the PDF before changing the response headers to properly handle and display errors in the UI.
$pdf = $this->htmlToPdf($html);
/** @var Web $app */
$app = Icinga::app();
$app->getResponse()
->setHeader('Content-Type', 'application/pdf', true)
->setHeader('Content-Disposition', "inline; filename=\"$filename\"", true)
->setBody($pdf)
->sendResponse();
exit;
}
/**
* Create an instance of HeadlessChrome from configuration
*
* @return HeadlessChrome
*/
protected function chrome()
{
$chrome = new HeadlessChrome();
$chrome->setBinary(static::getBinary());
if (($host = static::getHost()) !== null) {
$chrome->setRemote($host, static::getPort());
}
return $chrome;
}
protected function mergePdfs(string ...$pdfs): string
{
$merger = new PdfMerge();
$storage = new TemporaryLocalFileStorage();
try {
foreach ($pdfs as $i => $pdf) {
$storage->create($i, $pdf);
$merger->add($storage->resolvePath($i));
}
return $merger->merge('', 'S');
} finally {
foreach ($pdfs as $i => $_) {
$storage->delete($i);
}
}
}
}
icingaweb2-module-pdfexport-0.12.0+dfsg/library/Pdfexport/ShellCommand.php 0000664 0000000 0000000 00000007042 15112050317 0026513 0 ustar 00root root 0000000 0000000 command = $escape ? escapeshellcmd($command) : $command;
}
/**
* Get the exit code of the command
*
* @return int
*/
public function getExitCode()
{
return $this->exitCode;
}
/**
* Get the status of the command
*
* @return object
*/
public function getStatus()
{
$status = (object) proc_get_status($this->resource);
if ($status->running === false && $this->exitCode === null) {
// The exit code is only valid the first time proc_get_status is
// called in terms of running false, hence we capture it
$this->exitCode = $status->exitcode;
}
return $status;
}
/**
* Execute the command
*
* @return object
*
* @throws \Exception
*/
public function execute()
{
if ($this->resource !== null) {
throw new \Exception('Command already started');
}
$descriptors = [
['pipe', 'r'], // stdin
['pipe', 'w'], // stdout
['pipe', 'w'] // stderr
];
$this->resource = proc_open(
$this->command,
$descriptors,
$pipes
);
if (! is_resource($this->resource)) {
throw new \Exception(sprintf(
"Can't fork '%s'",
$this->command
));
}
$namedpipes = (object) [
'stdin' => &$pipes[0],
'stdout' => &$pipes[1],
'stderr' => &$pipes[2]
];
fclose($namedpipes->stdin);
$read = [$namedpipes->stderr, $namedpipes->stdout];
$origRead = $read;
$write = null; // stdin not handled
$except = null;
$stdout = '';
$stderr = '';
stream_set_blocking($namedpipes->stdout, false); // non-blocking
stream_set_blocking($namedpipes->stderr, false);
while (stream_select($read, $write, $except, 0, 20000) !== false) {
foreach ($read as $pipe) {
if ($pipe === $namedpipes->stdout) {
$stdout .= stream_get_contents($pipe);
}
if ($pipe === $namedpipes->stderr) {
$stderr .= stream_get_contents($pipe);
}
}
foreach ($origRead as $i => $str) {
if (feof($str)) {
unset($origRead[$i]);
}
}
if (empty($origRead)) {
break;
}
// Reset pipes
$read = $origRead;
}
fclose($namedpipes->stderr);
fclose($namedpipes->stdout);
$exitCode = proc_close($this->resource);
if ($this->exitCode === null) {
$this->exitCode = $exitCode;
}
$this->resource = null;
return (object) [
'stdout' => $stdout,
'stderr' => $stderr
];
}
}
icingaweb2-module-pdfexport-0.12.0+dfsg/module.info 0000664 0000000 0000000 00000000255 15112050317 0022156 0 ustar 00root root 0000000 0000000 Module: PDF Export
Version: 0.12.0
Requires:
Libraries: icinga-php-library (>=0.17.1), icinga-php-thirdparty (>=0.13.0)
Description: PDF Export via Google Chrome/Chromium
icingaweb2-module-pdfexport-0.12.0+dfsg/patches/ 0000775 0000000 0000000 00000000000 15112050317 0021441 5 ustar 00root root 0000000 0000000 icingaweb2-module-pdfexport-0.12.0+dfsg/patches/iio-libmergepdf-support-php82.patch 0000664 0000000 0000000 00000005654 15112050317 0030203 0 ustar 00root root 0000000 0000000 diff --git a/vendor/iio/libmergepdf/tcpdi/fpdf_tpl.php b/vendor/iio/libmergepdf/tcpdi/fpdf_tpl.php
index 0da7d7b..5322fa8 100644
--- a/vendor/iio/libmergepdf/tcpdi/fpdf_tpl.php
+++ b/vendor/iio/libmergepdf/tcpdi/fpdf_tpl.php
@@ -145,7 +145,7 @@ class FPDF_TPL extends FPDF {
function endTemplate() {
if (is_subclass_of($this, 'TCPDF')) {
$args = func_get_args();
- return call_user_func_array(array($this, 'TCPDF::endTemplate'), $args);
+ return call_user_func_array(array('TCPDF', 'endTemplate'), $args);
}
if ($this->_intpl) {
@@ -275,7 +275,7 @@ class FPDF_TPL extends FPDF {
public function SetFont($family, $style = '', $size = 0, $fontfile='', $subset='default', $out=true) {
if (is_subclass_of($this, 'TCPDF')) {
$args = func_get_args();
- return call_user_func_array(array($this, 'TCPDF::SetFont'), $args);
+ return call_user_func_array(array('TCPDF', 'SetFont'), $args);
}
parent::SetFont($family, $style, $size);
@@ -299,7 +299,7 @@ class FPDF_TPL extends FPDF {
) {
if (is_subclass_of($this, 'TCPDF')) {
$args = func_get_args();
- return call_user_func_array(array($this, 'TCPDF::Image'), $args);
+ return call_user_func_array(array('TCPDF', 'Image'), $args);
}
$ret = parent::Image($file, $x, $y, $w, $h, $type, $link);
@@ -320,7 +320,7 @@ class FPDF_TPL extends FPDF {
function AddPage($orientation = '', $format = '', $keepmargins = false, $tocpage = false) {
if (is_subclass_of($this, 'TCPDF')) {
$args = func_get_args();
- return call_user_func_array(array($this, 'TCPDF::AddPage'), $args);
+ return call_user_func_array(array('TCPDF', 'AddPage'), $args);
}
if ($this->_intpl)
@@ -335,7 +335,7 @@ class FPDF_TPL extends FPDF {
function Link($x, $y, $w, $h, $link, $spaces = 0) {
if (is_subclass_of($this, 'TCPDF')) {
$args = func_get_args();
- return call_user_func_array(array($this, 'TCPDF::Link'), $args);
+ return call_user_func_array(array('TCPDF', 'Link'), $args);
}
if ($this->_intpl)
@@ -347,7 +347,7 @@ class FPDF_TPL extends FPDF {
function AddLink() {
if (is_subclass_of($this, 'TCPDF')) {
$args = func_get_args();
- return call_user_func_array(array($this, 'TCPDF::AddLink'), $args);
+ return call_user_func_array(array('TCPDF', 'AddLink'), $args);
}
if ($this->_intpl)
@@ -358,7 +358,7 @@ class FPDF_TPL extends FPDF {
function SetLink($link, $y = 0, $page = -1) {
if (is_subclass_of($this, 'TCPDF')) {
$args = func_get_args();
- return call_user_func_array(array($this, 'TCPDF::SetLink'), $args);
+ return call_user_func_array(array('TCPDF', 'SetLink'), $args);
}
if ($this->_intpl) icingaweb2-module-pdfexport-0.12.0+dfsg/phpstan-baseline.neon 0000664 0000000 0000000 00000031016 15112050317 0024131 0 ustar 00root root 0000000 0000000 parameters:
ignoreErrors:
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\Controllers\\\\ConfigController\\:\\:chromeAction\\(\\) has no return type specified\\.$#"
count: 1
path: application/controllers/ConfigController.php
-
message: "#^Cannot call method addError\\(\\) on Zend_Form_Element\\|null\\.$#"
count: 4
path: application/forms/ChromeBinaryForm.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\Forms\\\\ChromeBinaryForm\\:\\:createElements\\(\\) has no return type specified\\.$#"
count: 1
path: application/forms/ChromeBinaryForm.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\Forms\\\\ChromeBinaryForm\\:\\:createElements\\(\\) has parameter \\$formData with no value type specified in iterable type array\\.$#"
count: 1
path: application/forms/ChromeBinaryForm.php
-
message: "#^Parameter \\#2 \\$port of method Icinga\\\\Module\\\\Pdfexport\\\\HeadlessChrome\\:\\:setRemote\\(\\) expects int, mixed given\\.$#"
count: 1
path: application/forms/ChromeBinaryForm.php
-
message: "#^Access to an undefined property object\\:\\:\\$stderr\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Access to an undefined property object\\:\\:\\$stdout\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Cannot access offset 'Browser' on array\\|bool\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Cannot access offset 'code' on mixed\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Cannot access offset 'error' on mixed\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Cannot access offset 'message' on mixed\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Cannot access offset 'method' on mixed\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Cannot access offset 'result' on mixed\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Cannot call method on\\(\\) on React\\\\Stream\\\\ReadableStreamInterface\\|React\\\\Stream\\\\WritableStreamInterface\\|null\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\HeadlessChrome\\:\\:asyncToPdf\\(\\) should return React\\\\Promise\\\\ExtendedPromiseInterface but returns React\\\\Promise\\\\PromiseInterface\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\HeadlessChrome\\:\\:communicate\\(\\) has no return type specified\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\HeadlessChrome\\:\\:communicate\\(\\) has parameter \\$method with no type specified\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\HeadlessChrome\\:\\:communicate\\(\\) has parameter \\$params with no type specified\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\HeadlessChrome\\:\\:getFileStorage\\(\\) return type has no value type specified in iterable type Icinga\\\\File\\\\Storage\\\\StorageInterface\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\HeadlessChrome\\:\\:getRemote\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\HeadlessChrome\\:\\:jsonVersion\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\HeadlessChrome\\:\\:jsonVersion\\(\\) should return array\\|bool but returns mixed\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\HeadlessChrome\\:\\:parseApiResponse\\(\\) has no return type specified\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\HeadlessChrome\\:\\:parseApiResponse\\(\\) has parameter \\$payload with no type specified\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\HeadlessChrome\\:\\:printToPDF\\(\\) has no return type specified\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\HeadlessChrome\\:\\:printToPDF\\(\\) has parameter \\$browserId with no type specified\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\HeadlessChrome\\:\\:printToPDF\\(\\) has parameter \\$parameters with no value type specified in iterable type array\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\HeadlessChrome\\:\\:printToPDF\\(\\) has parameter \\$socket with no type specified\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\HeadlessChrome\\:\\:registerEvent\\(\\) has no return type specified\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\HeadlessChrome\\:\\:registerEvent\\(\\) has parameter \\$method with no type specified\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\HeadlessChrome\\:\\:registerEvent\\(\\) has parameter \\$params with no type specified\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\HeadlessChrome\\:\\:renderApiCall\\(\\) has no return type specified\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\HeadlessChrome\\:\\:renderApiCall\\(\\) has parameter \\$method with no type specified\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\HeadlessChrome\\:\\:renderApiCall\\(\\) has parameter \\$options with no type specified\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\HeadlessChrome\\:\\:renderArgumentList\\(\\) has parameter \\$arguments with no value type specified in iterable type array\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\HeadlessChrome\\:\\:setFileStorage\\(\\) has parameter \\$fileStorage with no value type specified in iterable type Icinga\\\\File\\\\Storage\\\\StorageInterface\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\HeadlessChrome\\:\\:waitFor\\(\\) has no return type specified\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\HeadlessChrome\\:\\:waitFor\\(\\) has parameter \\$eventName with no type specified\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\HeadlessChrome\\:\\:waitFor\\(\\) has parameter \\$expectedParams with no value type specified in iterable type array\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Parameter \\#2 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, mixed given\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Parameter \\#3 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, mixed given\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Property Icinga\\\\Module\\\\Pdfexport\\\\HeadlessChrome\\:\\:\\$fileStorage type has no value type specified in iterable type Icinga\\\\File\\\\Storage\\\\StorageInterface\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Property Icinga\\\\Module\\\\Pdfexport\\\\HeadlessChrome\\:\\:\\$interceptedEvents type has no value type specified in iterable type array\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Property Icinga\\\\Module\\\\Pdfexport\\\\HeadlessChrome\\:\\:\\$interceptedRequests type has no value type specified in iterable type array\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Property Icinga\\\\Module\\\\Pdfexport\\\\HeadlessChrome\\:\\:\\$remote type has no value type specified in iterable type array\\.$#"
count: 1
path: library/Pdfexport/HeadlessChrome.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\PrintStyleSheet\\:\\:collect\\(\\) has no return type specified\\.$#"
count: 1
path: library/Pdfexport/PrintStyleSheet.php
-
message: "#^Cannot call method getName\\(\\) on mixed\\.$#"
count: 3
path: library/Pdfexport/PrintableHtmlDocument.php
-
message: "#^Cannot call method getStaticAssetPath\\(\\) on mixed\\.$#"
count: 1
path: library/Pdfexport/PrintableHtmlDocument.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\PrintableHtmlDocument\\:\\:assemble\\(\\) has no return type specified\\.$#"
count: 1
path: library/Pdfexport/PrintableHtmlDocument.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\PrintableHtmlDocument\\:\\:getPrintParameters\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: library/Pdfexport/PrintableHtmlDocument.php
-
message: "#^Parameter \\#1 \\$content of static method ipl\\\\Html\\\\Text\\:\\:create\\(\\) expects string, string\\|null given\\.$#"
count: 1
path: library/Pdfexport/PrintableHtmlDocument.php
-
message: "#^Parameter \\#3 \\.\\.\\.\\$content of class ipl\\\\Html\\\\HtmlElement constructor expects ipl\\\\Html\\\\ValidHtml, ipl\\\\Html\\\\ValidHtml\\|null given\\.$#"
count: 2
path: library/Pdfexport/PrintableHtmlDocument.php
-
message: "#^Cannot call method isSupported\\(\\) on mixed\\.$#"
count: 1
path: library/Pdfexport/ProvidedHook/Pdfexport.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\ProvidedHook\\\\Pdfexport\\:\\:first\\(\\) has no return type specified\\.$#"
count: 1
path: library/Pdfexport/ProvidedHook/Pdfexport.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\ProvidedHook\\\\Pdfexport\\:\\:getBinary\\(\\) has no return type specified\\.$#"
count: 1
path: library/Pdfexport/ProvidedHook/Pdfexport.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\ProvidedHook\\\\Pdfexport\\:\\:getForceTempStorage\\(\\) has no return type specified\\.$#"
count: 1
path: library/Pdfexport/ProvidedHook/Pdfexport.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\ProvidedHook\\\\Pdfexport\\:\\:getHost\\(\\) has no return type specified\\.$#"
count: 1
path: library/Pdfexport/ProvidedHook/Pdfexport.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\ProvidedHook\\\\Pdfexport\\:\\:getPort\\(\\) has no return type specified\\.$#"
count: 1
path: library/Pdfexport/ProvidedHook/Pdfexport.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\ProvidedHook\\\\Pdfexport\\:\\:htmlToPdf\\(\\) has no return type specified\\.$#"
count: 1
path: library/Pdfexport/ProvidedHook/Pdfexport.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\ProvidedHook\\\\Pdfexport\\:\\:htmlToPdf\\(\\) has parameter \\$html with no type specified\\.$#"
count: 1
path: library/Pdfexport/ProvidedHook/Pdfexport.php
-
message: "#^Method Icinga\\\\Module\\\\Pdfexport\\\\ProvidedHook\\\\Pdfexport\\:\\:streamPdfFromHtml\\(\\) has no return type specified\\.$#"
count: 1
path: library/Pdfexport/ProvidedHook/Pdfexport.php
-
message: "#^Parameter \\#1 \\$object of function get_class expects object, mixed given\\.$#"
count: 1
path: library/Pdfexport/ProvidedHook/Pdfexport.php
-
message: "#^Parameter \\#1 \\$process of function proc_get_status expects resource, resource\\|null given\\.$#"
count: 1
path: library/Pdfexport/ShellCommand.php
-
message: "#^Property Icinga\\\\Module\\\\Pdfexport\\\\ShellCommand\\:\\:\\$resource \\(resource\\|null\\) does not accept resource\\|false\\.$#"
count: 1
path: library/Pdfexport/ShellCommand.php
icingaweb2-module-pdfexport-0.12.0+dfsg/phpstan.neon 0000664 0000000 0000000 00000001061 15112050317 0022346 0 ustar 00root root 0000000 0000000 includes:
- phpstan-baseline.neon
parameters:
level: max
checkFunctionNameCase: true
checkInternalClassCaseSensitivity: true
treatPhpDocTypesAsCertain: false
paths:
- application
- library
ignoreErrors:
-
messages:
- '#Unsafe usage of new static\(\)#'
- '#. but return statement is missing#'
reportUnmatched: false
scanDirectories:
- /icingaweb2
- /usr/share/icinga-php
universalObjectCratesClasses:
- Icinga\Web\View
icingaweb2-module-pdfexport-0.12.0+dfsg/public/ 0000775 0000000 0000000 00000000000 15112050317 0021270 5 ustar 00root root 0000000 0000000 icingaweb2-module-pdfexport-0.12.0+dfsg/public/css/ 0000775 0000000 0000000 00000000000 15112050317 0022060 5 ustar 00root root 0000000 0000000 icingaweb2-module-pdfexport-0.12.0+dfsg/public/css/print.less 0000664 0000000 0000000 00000001273 15112050317 0024107 0 ustar 00root root 0000000 0000000 // icingaweb2
@gray: #7F7F7F;
@gray-semilight: #A9A9A9;
@gray-light: #C9C9C9;
@gray-lighter: #EEEEEE;
@gray-lightest: #F7F7F7;
@icinga-blue: #0095BF;
@low-sat-blue: #dae3e6;
@low-sat-blue-dark: #becbcf;
@body-bg-color: #fff;
@text-color: @black;
@text-color-light: @gray;
@tr-active-color: @body-bg-color;
@tr-hover-color: @body-bg-color;
// ipl-web
@default-bg: @body-bg-color;
@base-gray: @gray;
@base-gray-light: @gray-light;
@base-gray-lighter: @gray-lighter;
@base-disabled: @disabled-gray;
@base-primary-color: @icinga-blue;
@base-primary-bg: @icinga-blue;
@default-text-color: @text-color;
@default-text-color-light: @text-color-light;
@default-text-color-inverted: @text-color-inverted;
icingaweb2-module-pdfexport-0.12.0+dfsg/public/js/ 0000775 0000000 0000000 00000000000 15112050317 0021704 5 ustar 00root root 0000000 0000000 icingaweb2-module-pdfexport-0.12.0+dfsg/public/js/layout-plugins/ 0000775 0000000 0000000 00000000000 15112050317 0024700 5 ustar 00root root 0000000 0000000 icingaweb2-module-pdfexport-0.12.0+dfsg/public/js/layout-plugins/page-breaker.js 0000664 0000000 0000000 00000003032 15112050317 0027561 0 ustar 00root root 0000000 0000000 /* Icinga PDF Export | (c) 2021 Icinga GmbH | GPLv2 */
"use strict";
(() => {
Layout.registerPlugin('page-breaker', () => {
let pageBreaksFor = document.querySelector('[data-pdfexport-page-breaks-at]');
if (! pageBreaksFor) {
return;
}
let pageBreaksAt = pageBreaksFor.dataset.pdfexportPageBreaksAt;
if (! pageBreaksAt) {
return;
}
let contentHeight = document.body.dataset.contentHeight;
let items = Array.from(pageBreaksFor.querySelectorAll(':scope > ' + pageBreaksAt));
let remainingHeight = contentHeight;
items.forEach((item, i) => {
let requiredHeight;
if (i < items.length - 1) {
requiredHeight = items[i + 1].getBoundingClientRect().top - item.getBoundingClientRect().top;
} else {
requiredHeight = item.parentElement.getBoundingClientRect().bottom - item.getBoundingClientRect().top;
}
if (remainingHeight < requiredHeight) {
if (!! item.previousElementSibling) {
item.previousElementSibling.style.pageBreakAfter = 'always';
item.previousElementSibling.classList.add('page-break-follows');
} else {
item.style.pageBreakAfter = 'always';
item.classList.add('page-break-follows');
}
remainingHeight = contentHeight;
}
remainingHeight -= requiredHeight;
});
});
})();
icingaweb2-module-pdfexport-0.12.0+dfsg/public/js/layout.js 0000664 0000000 0000000 00000001305 15112050317 0023556 0 ustar 00root root 0000000 0000000 /* Icinga PDF Export | (c) 2021 Icinga GmbH | GPLv2 */
"use strict";
class Layout
{
static #plugins = [];
static registerPlugin(name, plugin) {
this.#plugins.push([name, plugin]);
}
apply() {
for (let [name, plugin] of Layout.#plugins) {
try {
plugin();
} catch (error) {
console.error('Layout plugin ' + name + ' failed to run: ' + error);
}
}
this.finish();
}
finish() {
document.documentElement.dataset.layoutReady = 'yes';
document.dispatchEvent(new CustomEvent('layout-ready', {
cancelable: false,
bubbles: false
}));
}
}
icingaweb2-module-pdfexport-0.12.0+dfsg/run.php 0000664 0000000 0000000 00000000273 15112050317 0021331 0 ustar 00root root 0000000 0000000 provideHook('Pdfexport');
require_once 'vendor/autoload.php';
icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/ 0000775 0000000 0000000 00000000000 15112050317 0021307 5 ustar 00root root 0000000 0000000 icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/autoload.php 0000664 0000000 0000000 00000001354 15112050317 0023633 0 ustar 00root root 0000000 0000000
* Jordi Boggiano
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Autoload;
/**
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
*
* $loader = new \Composer\Autoload\ClassLoader();
*
* // register classes with namespaces
* $loader->add('Symfony\Component', __DIR__.'/component');
* $loader->add('Symfony', __DIR__.'/framework');
*
* // activate the autoloader
* $loader->register();
*
* // to enable searching the include path (eg. for PEAR packages)
* $loader->setUseIncludePath(true);
*
* In this example, if you try to use a class in the Symfony\Component
* namespace or one of its children (Symfony\Component\Console for instance),
* the autoloader will first look for the class under the component/
* directory, and it will then fallback to the framework/ directory if not
* found before giving up.
*
* This class is loosely based on the Symfony UniversalClassLoader.
*
* @author Fabien Potencier
* @author Jordi Boggiano
* @see https://www.php-fig.org/psr/psr-0/
* @see https://www.php-fig.org/psr/psr-4/
*/
class ClassLoader
{
/** @var \Closure(string):void */
private static $includeFile;
/** @var string|null */
private $vendorDir;
// PSR-4
/**
* @var array>
*/
private $prefixLengthsPsr4 = array();
/**
* @var array>
*/
private $prefixDirsPsr4 = array();
/**
* @var list
*/
private $fallbackDirsPsr4 = array();
// PSR-0
/**
* List of PSR-0 prefixes
*
* Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
*
* @var array>>
*/
private $prefixesPsr0 = array();
/**
* @var list
*/
private $fallbackDirsPsr0 = array();
/** @var bool */
private $useIncludePath = false;
/**
* @var array
*/
private $classMap = array();
/** @var bool */
private $classMapAuthoritative = false;
/**
* @var array
*/
private $missingClasses = array();
/** @var string|null */
private $apcuPrefix;
/**
* @var array
*/
private static $registeredLoaders = array();
/**
* @param string|null $vendorDir
*/
public function __construct($vendorDir = null)
{
$this->vendorDir = $vendorDir;
self::initializeIncludeClosure();
}
/**
* @return array>
*/
public function getPrefixes()
{
if (!empty($this->prefixesPsr0)) {
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
}
return array();
}
/**
* @return array>
*/
public function getPrefixesPsr4()
{
return $this->prefixDirsPsr4;
}
/**
* @return list
*/
public function getFallbackDirs()
{
return $this->fallbackDirsPsr0;
}
/**
* @return list
*/
public function getFallbackDirsPsr4()
{
return $this->fallbackDirsPsr4;
}
/**
* @return array Array of classname => path
*/
public function getClassMap()
{
return $this->classMap;
}
/**
* @param array $classMap Class to filename map
*
* @return void
*/
public function addClassMap(array $classMap)
{
if ($this->classMap) {
$this->classMap = array_merge($this->classMap, $classMap);
} else {
$this->classMap = $classMap;
}
}
/**
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
* @param string $prefix The prefix
* @param list|string $paths The PSR-0 root directories
* @param bool $prepend Whether to prepend the directories
*
* @return void
*/
public function add($prefix, $paths, $prepend = false)
{
$paths = (array) $paths;
if (!$prefix) {
if ($prepend) {
$this->fallbackDirsPsr0 = array_merge(
$paths,
$this->fallbackDirsPsr0
);
} else {
$this->fallbackDirsPsr0 = array_merge(
$this->fallbackDirsPsr0,
$paths
);
}
return;
}
$first = $prefix[0];
if (!isset($this->prefixesPsr0[$first][$prefix])) {
$this->prefixesPsr0[$first][$prefix] = $paths;
return;
}
if ($prepend) {
$this->prefixesPsr0[$first][$prefix] = array_merge(
$paths,
$this->prefixesPsr0[$first][$prefix]
);
} else {
$this->prefixesPsr0[$first][$prefix] = array_merge(
$this->prefixesPsr0[$first][$prefix],
$paths
);
}
}
/**
* Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param list|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
*
* @return void
*/
public function addPsr4($prefix, $paths, $prepend = false)
{
$paths = (array) $paths;
if (!$prefix) {
// Register directories for the root namespace.
if ($prepend) {
$this->fallbackDirsPsr4 = array_merge(
$paths,
$this->fallbackDirsPsr4
);
} else {
$this->fallbackDirsPsr4 = array_merge(
$this->fallbackDirsPsr4,
$paths
);
}
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
// Register directories for a new namespace.
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = $paths;
} elseif ($prepend) {
// Prepend directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
$paths,
$this->prefixDirsPsr4[$prefix]
);
} else {
// Append directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
$this->prefixDirsPsr4[$prefix],
$paths
);
}
}
/**
* Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix.
*
* @param string $prefix The prefix
* @param list|string $paths The PSR-0 base directories
*
* @return void
*/
public function set($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr0 = (array) $paths;
} else {
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
}
}
/**
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param list|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
*
* @return void
*/
public function setPsr4($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr4 = (array) $paths;
} else {
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
}
}
/**
* Turns on searching the include path for class files.
*
* @param bool $useIncludePath
*
* @return void
*/
public function setUseIncludePath($useIncludePath)
{
$this->useIncludePath = $useIncludePath;
}
/**
* Can be used to check if the autoloader uses the include path to check
* for classes.
*
* @return bool
*/
public function getUseIncludePath()
{
return $this->useIncludePath;
}
/**
* Turns off searching the prefix and fallback directories for classes
* that have not been registered with the class map.
*
* @param bool $classMapAuthoritative
*
* @return void
*/
public function setClassMapAuthoritative($classMapAuthoritative)
{
$this->classMapAuthoritative = $classMapAuthoritative;
}
/**
* Should class lookup fail if not found in the current class map?
*
* @return bool
*/
public function isClassMapAuthoritative()
{
return $this->classMapAuthoritative;
}
/**
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
*
* @param string|null $apcuPrefix
*
* @return void
*/
public function setApcuPrefix($apcuPrefix)
{
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
}
/**
* The APCu prefix in use, or null if APCu caching is not enabled.
*
* @return string|null
*/
public function getApcuPrefix()
{
return $this->apcuPrefix;
}
/**
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
*
* @return void
*/
public function register($prepend = false)
{
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
if (null === $this->vendorDir) {
return;
}
if ($prepend) {
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
} else {
unset(self::$registeredLoaders[$this->vendorDir]);
self::$registeredLoaders[$this->vendorDir] = $this;
}
}
/**
* Unregisters this instance as an autoloader.
*
* @return void
*/
public function unregister()
{
spl_autoload_unregister(array($this, 'loadClass'));
if (null !== $this->vendorDir) {
unset(self::$registeredLoaders[$this->vendorDir]);
}
}
/**
* Loads the given class or interface.
*
* @param string $class The name of the class
* @return true|null True if loaded, null otherwise
*/
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
$includeFile = self::$includeFile;
$includeFile($file);
return true;
}
return null;
}
/**
* Finds the path to the file where the class is defined.
*
* @param string $class The name of the class
*
* @return string|false The path if found, false otherwise
*/
public function findFile($class)
{
// class map lookup
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
return false;
}
if (null !== $this->apcuPrefix) {
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
if ($hit) {
return $file;
}
}
$file = $this->findFileWithExtension($class, '.php');
// Search for Hack files if we are running on HHVM
if (false === $file && defined('HHVM_VERSION')) {
$file = $this->findFileWithExtension($class, '.hh');
}
if (null !== $this->apcuPrefix) {
apcu_add($this->apcuPrefix.$class, $file);
}
if (false === $file) {
// Remember that this class does not exist.
$this->missingClasses[$class] = true;
}
return $file;
}
/**
* Returns the currently registered loaders keyed by their corresponding vendor directories.
*
* @return array
*/
public static function getRegisteredLoaders()
{
return self::$registeredLoaders;
}
/**
* @param string $class
* @param string $ext
* @return string|false
*/
private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
$first = $class[0];
if (isset($this->prefixLengthsPsr4[$first])) {
$subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos);
$search = $subPath . '\\';
if (isset($this->prefixDirsPsr4[$search])) {
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) {
if (file_exists($file = $dir . $pathEnd)) {
return $file;
}
}
}
}
}
// PSR-4 fallback dirs
foreach ($this->fallbackDirsPsr4 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
return $file;
}
}
// PSR-0 lookup
if (false !== $pos = strrpos($class, '\\')) {
// namespaced class name
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
} else {
// PEAR-like class name
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
}
if (isset($this->prefixesPsr0[$first])) {
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
if (0 === strpos($class, $prefix)) {
foreach ($dirs as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
}
}
}
// PSR-0 fallback dirs
foreach ($this->fallbackDirsPsr0 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
// PSR-0 include paths.
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
return $file;
}
return false;
}
/**
* @return void
*/
private static function initializeIncludeClosure()
{
if (self::$includeFile !== null) {
return;
}
/**
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*
* @param string $file
* @return void
*/
self::$includeFile = \Closure::bind(static function($file) {
include $file;
}, null, null);
}
}
icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/composer/InstalledVersions.php 0000664 0000000 0000000 00000041763 15112050317 0027332 0 ustar 00root root 0000000 0000000
* Jordi Boggiano
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer;
use Composer\Autoload\ClassLoader;
use Composer\Semver\VersionParser;
/**
* This class is copied in every Composer installed project and available to all
*
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
*
* To require its presence, you can require `composer-runtime-api ^2.0`
*
* @final
*/
class InstalledVersions
{
/**
* @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to
* @internal
*/
private static $selfDir = null;
/**
* @var mixed[]|null
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null
*/
private static $installed;
/**
* @var bool
*/
private static $installedIsLocalDir;
/**
* @var bool|null
*/
private static $canGetVendors;
/**
* @var array[]
* @psalm-var array}>
*/
private static $installedByVendor = array();
/**
* Returns a list of all package names which are present, either by being installed, replaced or provided
*
* @return string[]
* @psalm-return list
*/
public static function getInstalledPackages()
{
$packages = array();
foreach (self::getInstalled() as $installed) {
$packages[] = array_keys($installed['versions']);
}
if (1 === \count($packages)) {
return $packages[0];
}
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
}
/**
* Returns a list of all package names with a specific type e.g. 'library'
*
* @param string $type
* @return string[]
* @psalm-return list
*/
public static function getInstalledPackagesByType($type)
{
$packagesByType = array();
foreach (self::getInstalled() as $installed) {
foreach ($installed['versions'] as $name => $package) {
if (isset($package['type']) && $package['type'] === $type) {
$packagesByType[] = $name;
}
}
}
return $packagesByType;
}
/**
* Checks whether the given package is installed
*
* This also returns true if the package name is provided or replaced by another package
*
* @param string $packageName
* @param bool $includeDevRequirements
* @return bool
*/
public static function isInstalled($packageName, $includeDevRequirements = true)
{
foreach (self::getInstalled() as $installed) {
if (isset($installed['versions'][$packageName])) {
return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
}
}
return false;
}
/**
* Checks whether the given package satisfies a version constraint
*
* e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
*
* Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
*
* @param VersionParser $parser Install composer/semver to have access to this class and functionality
* @param string $packageName
* @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
* @return bool
*/
public static function satisfies(VersionParser $parser, $packageName, $constraint)
{
$constraint = $parser->parseConstraints((string) $constraint);
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
return $provided->matches($constraint);
}
/**
* Returns a version constraint representing all the range(s) which are installed for a given package
*
* It is easier to use this via isInstalled() with the $constraint argument if you need to check
* whether a given version of a package is installed, and not just whether it exists
*
* @param string $packageName
* @return string Version constraint usable with composer/semver
*/
public static function getVersionRanges($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
$ranges = array();
if (isset($installed['versions'][$packageName]['pretty_version'])) {
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
}
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
}
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
}
if (array_key_exists('provided', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
}
return implode(' || ', $ranges);
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
*/
public static function getVersion($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['version'])) {
return null;
}
return $installed['versions'][$packageName]['version'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
*/
public static function getPrettyVersion($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
return null;
}
return $installed['versions'][$packageName]['pretty_version'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
*/
public static function getReference($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['reference'])) {
return null;
}
return $installed['versions'][$packageName]['reference'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
*/
public static function getInstallPath($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @return array
* @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
*/
public static function getRootPackage()
{
$installed = self::getInstalled();
return $installed[0]['root'];
}
/**
* Returns the raw installed.php data for custom implementations
*
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
* @return array[]
* @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}
*/
public static function getRawData()
{
@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
if (null === self::$installed) {
// only require the installed.php file if this file is loaded from its dumped location,
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
if (substr(__DIR__, -8, 1) !== 'C') {
self::$installed = include __DIR__ . '/installed.php';
} else {
self::$installed = array();
}
}
return self::$installed;
}
/**
* Returns the raw data of all installed.php which are currently loaded for custom implementations
*
* @return array[]
* @psalm-return list}>
*/
public static function getAllRawData()
{
return self::getInstalled();
}
/**
* Lets you reload the static array from another file
*
* This is only useful for complex integrations in which a project needs to use
* this class but then also needs to execute another project's autoloader in process,
* and wants to ensure both projects have access to their version of installed.php.
*
* A typical case would be PHPUnit, where it would need to make sure it reads all
* the data it needs from this class, then call reload() with
* `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
* the project in which it runs can then also use this class safely, without
* interference between PHPUnit's dependencies and the project's dependencies.
*
* @param array[] $data A vendor/composer/installed.php data set
* @return void
*
* @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data
*/
public static function reload($data)
{
self::$installed = $data;
self::$installedByVendor = array();
// when using reload, we disable the duplicate protection to ensure that self::$installed data is
// always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
// so we have to assume it does not, and that may result in duplicate data being returned when listing
// all installed packages for example
self::$installedIsLocalDir = false;
}
/**
* @return string
*/
private static function getSelfDir()
{
if (self::$selfDir === null) {
self::$selfDir = strtr(__DIR__, '\\', '/');
}
return self::$selfDir;
}
/**
* @return array[]
* @psalm-return list}>
*/
private static function getInstalled()
{
if (null === self::$canGetVendors) {
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
}
$installed = array();
$copiedLocalDir = false;
if (self::$canGetVendors) {
$selfDir = self::getSelfDir();
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
$vendorDir = strtr($vendorDir, '\\', '/');
if (isset(self::$installedByVendor[$vendorDir])) {
$installed[] = self::$installedByVendor[$vendorDir];
} elseif (is_file($vendorDir.'/composer/installed.php')) {
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */
$required = require $vendorDir.'/composer/installed.php';
self::$installedByVendor[$vendorDir] = $required;
$installed[] = $required;
if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
self::$installed = $required;
self::$installedIsLocalDir = true;
}
}
if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
$copiedLocalDir = true;
}
}
}
if (null === self::$installed) {
// only require the installed.php file if this file is loaded from its dumped location,
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
if (substr(__DIR__, -8, 1) !== 'C') {
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */
$required = require __DIR__ . '/installed.php';
self::$installed = $required;
} else {
self::$installed = array();
}
}
if (self::$installed !== array() && !$copiedLocalDir) {
$installed[] = self::$installed;
}
return $installed;
}
}
icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/composer/LICENSE 0000664 0000000 0000000 00000002056 15112050317 0024146 0 ustar 00root root 0000000 0000000
Copyright (c) Nils Adermann, Jordi Boggiano
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/composer/autoload_classmap.php 0000664 0000000 0000000 00000002660 15112050317 0027346 0 ustar 00root root 0000000 0000000 $vendorDir . '/composer/InstalledVersions.php',
'Datamatrix' => $vendorDir . '/tecnickcom/tcpdf/include/barcodes/datamatrix.php',
'FPDF' => $vendorDir . '/karriere/pdf-merge/tcpi/tcpdi.php',
'FPDF_TPL' => $vendorDir . '/karriere/pdf-merge/tcpi/fpdf_tpl.php',
'PDF417' => $vendorDir . '/tecnickcom/tcpdf/include/barcodes/pdf417.php',
'QRcode' => $vendorDir . '/tecnickcom/tcpdf/include/barcodes/qrcode.php',
'TCPDF' => $vendorDir . '/tecnickcom/tcpdf/tcpdf.php',
'TCPDF2DBarcode' => $vendorDir . '/tecnickcom/tcpdf/tcpdf_barcodes_2d.php',
'TCPDFBarcode' => $vendorDir . '/tecnickcom/tcpdf/tcpdf_barcodes_1d.php',
'TCPDF_COLORS' => $vendorDir . '/tecnickcom/tcpdf/include/tcpdf_colors.php',
'TCPDF_FILTERS' => $vendorDir . '/tecnickcom/tcpdf/include/tcpdf_filters.php',
'TCPDF_FONTS' => $vendorDir . '/tecnickcom/tcpdf/include/tcpdf_fonts.php',
'TCPDF_FONT_DATA' => $vendorDir . '/tecnickcom/tcpdf/include/tcpdf_font_data.php',
'TCPDF_IMAGES' => $vendorDir . '/tecnickcom/tcpdf/include/tcpdf_images.php',
'TCPDF_STATIC' => $vendorDir . '/tecnickcom/tcpdf/include/tcpdf_static.php',
'TCPDI' => $vendorDir . '/karriere/pdf-merge/tcpi/tcpdi.php',
'tcpdi_parser' => $vendorDir . '/karriere/pdf-merge/tcpi/tcpdi_parser.php',
);
icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/composer/autoload_namespaces.php 0000664 0000000 0000000 00000000213 15112050317 0027652 0 ustar 00root root 0000000 0000000 array($vendorDir . '/phrity/websocket/src'),
'Psr\\Log\\' => array($vendorDir . '/psr/log/src'),
'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'),
'Phrity\\Util\\' => array($vendorDir . '/phrity/util-errorhandler/src'),
'Phrity\\Net\\' => array($vendorDir . '/phrity/net-uri/src', $vendorDir . '/phrity/net-stream/src'),
'Phrity\\Http\\' => array($vendorDir . '/phrity/http/src'),
'Phrity\\Comparison\\' => array($vendorDir . '/phrity/comparison/src'),
'Karriere\\PdfMerge\\' => array($vendorDir . '/karriere/pdf-merge/src'),
);
icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/composer/autoload_real.php 0000664 0000000 0000000 00000002161 15112050317 0026462 0 ustar 00root root 0000000 0000000 register(true);
return $loader;
}
}
icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/composer/autoload_static.php 0000664 0000000 0000000 00000007231 15112050317 0027031 0 ustar 00root root 0000000 0000000
array (
'WebSocket\\' => 10,
),
'P' =>
array (
'Psr\\Log\\' => 8,
'Psr\\Http\\Message\\' => 17,
'Phrity\\Util\\' => 12,
'Phrity\\Net\\' => 11,
'Phrity\\Http\\' => 12,
'Phrity\\Comparison\\' => 18,
),
'K' =>
array (
'Karriere\\PdfMerge\\' => 18,
),
);
public static $prefixDirsPsr4 = array (
'WebSocket\\' =>
array (
0 => __DIR__ . '/..' . '/phrity/websocket/src',
),
'Psr\\Log\\' =>
array (
0 => __DIR__ . '/..' . '/psr/log/src',
),
'Psr\\Http\\Message\\' =>
array (
0 => __DIR__ . '/..' . '/psr/http-factory/src',
1 => __DIR__ . '/..' . '/psr/http-message/src',
),
'Phrity\\Util\\' =>
array (
0 => __DIR__ . '/..' . '/phrity/util-errorhandler/src',
),
'Phrity\\Net\\' =>
array (
0 => __DIR__ . '/..' . '/phrity/net-uri/src',
1 => __DIR__ . '/..' . '/phrity/net-stream/src',
),
'Phrity\\Http\\' =>
array (
0 => __DIR__ . '/..' . '/phrity/http/src',
),
'Phrity\\Comparison\\' =>
array (
0 => __DIR__ . '/..' . '/phrity/comparison/src',
),
'Karriere\\PdfMerge\\' =>
array (
0 => __DIR__ . '/..' . '/karriere/pdf-merge/src',
),
);
public static $classMap = array (
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
'Datamatrix' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/barcodes/datamatrix.php',
'FPDF' => __DIR__ . '/..' . '/karriere/pdf-merge/tcpi/tcpdi.php',
'FPDF_TPL' => __DIR__ . '/..' . '/karriere/pdf-merge/tcpi/fpdf_tpl.php',
'PDF417' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/barcodes/pdf417.php',
'QRcode' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/barcodes/qrcode.php',
'TCPDF' => __DIR__ . '/..' . '/tecnickcom/tcpdf/tcpdf.php',
'TCPDF2DBarcode' => __DIR__ . '/..' . '/tecnickcom/tcpdf/tcpdf_barcodes_2d.php',
'TCPDFBarcode' => __DIR__ . '/..' . '/tecnickcom/tcpdf/tcpdf_barcodes_1d.php',
'TCPDF_COLORS' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/tcpdf_colors.php',
'TCPDF_FILTERS' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/tcpdf_filters.php',
'TCPDF_FONTS' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/tcpdf_fonts.php',
'TCPDF_FONT_DATA' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/tcpdf_font_data.php',
'TCPDF_IMAGES' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/tcpdf_images.php',
'TCPDF_STATIC' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/tcpdf_static.php',
'TCPDI' => __DIR__ . '/..' . '/karriere/pdf-merge/tcpi/tcpdi.php',
'tcpdi_parser' => __DIR__ . '/..' . '/karriere/pdf-merge/tcpi/tcpdi_parser.php',
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitff8ca5c94912b5ce3ac82b5c9f2b4776::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitff8ca5c94912b5ce3ac82b5c9f2b4776::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitff8ca5c94912b5ce3ac82b5c9f2b4776::$classMap;
}, null, ClassLoader::class);
}
}
icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/composer/installed.json 0000664 0000000 0000000 00000103100 15112050317 0026003 0 ustar 00root root 0000000 0000000 {
"packages": [
{
"name": "karriere/pdf-merge",
"version": "v3.3.1",
"version_normalized": "3.3.1.0",
"source": {
"type": "git",
"url": "https://github.com/karriereat/pdf-merge.git",
"reference": "d524a9d261ea96b18bbbab685b5710a7a0fe3a6e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/karriereat/pdf-merge/zipball/d524a9d261ea96b18bbbab685b5710a7a0fe3a6e",
"reference": "d524a9d261ea96b18bbbab685b5710a7a0fe3a6e",
"shasum": ""
},
"require": {
"php": "8.1.* | 8.2.* | 8.3.* | 8.4.*",
"tecnickcom/tcpdf": "^6.3"
},
"require-dev": {
"laravel/pint": "^1.5 | ^1.6",
"pestphp/pest": "^1.22",
"phpstan/phpstan": "^1.10"
},
"time": "2025-02-19T11:02:10+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"Karriere\\PdfMerge\\": "src/"
},
"classmap": [
"tcpi/fpdf_tpl.php",
"tcpi/tcpdi.php",
"tcpi/tcpdi_parser.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "Alexander Lentner",
"email": "alexander.lentner@karriere.at",
"role": "Maintainer"
}
],
"description": "A wrapper for the TCPDF class that provides an elegant API for merging PDFs",
"keywords": [
"merge",
"pdf"
],
"support": {
"issues": "https://github.com/karriereat/pdf-merge/issues",
"source": "https://github.com/karriereat/pdf-merge/tree/v3.3.1"
},
"install-path": "../karriere/pdf-merge"
},
{
"name": "phrity/comparison",
"version": "1.4.0",
"version_normalized": "1.4.0.0",
"source": {
"type": "git",
"url": "https://github.com/sirn-se/phrity-comparison.git",
"reference": "aedd44d59db08de7d6c31812d1490c22aab35c92"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sirn-se/phrity-comparison/zipball/aedd44d59db08de7d6c31812d1490c22aab35c92",
"reference": "aedd44d59db08de7d6c31812d1490c22aab35c92",
"shasum": ""
},
"require": {
"php": "^8.1"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.0",
"phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^10.0 | ^11.0 | ^12.0",
"squizlabs/php_codesniffer": "^3.5"
},
"time": "2025-05-26T20:12:39+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"Phrity\\Comparison\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Sören Jensen",
"email": "sirn@sirn.se",
"homepage": "https://phrity.sirn.se"
}
],
"description": "Interfaces and helper trait for comparing objects. Comparator for sort and filter applications.",
"homepage": "https://phrity.sirn.se/comparison",
"keywords": [
"comparable",
"comparator",
"comparison",
"equalable",
"filter",
"sort"
],
"support": {
"issues": "https://github.com/sirn-se/phrity-comparison/issues",
"source": "https://github.com/sirn-se/phrity-comparison/tree/1.4.0"
},
"install-path": "../phrity/comparison"
},
{
"name": "phrity/http",
"version": "1.0.0",
"version_normalized": "1.0.0.0",
"source": {
"type": "git",
"url": "https://github.com/sirn-se/phrity-http.git",
"reference": "536e3e46e6220d171a59599ed1f4da9f6b6244fc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sirn-se/phrity-http/zipball/536e3e46e6220d171a59599ed1f4da9f6b6244fc",
"reference": "536e3e46e6220d171a59599ed1f4da9f6b6244fc",
"shasum": ""
},
"require": {
"php": "^8.1",
"psr/http-factory": "^1.0",
"psr/http-message": "^1.1 | ^2.0"
},
"require-dev": {
"guzzlehttp/psr7": "^2.0",
"phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^10.0 | ^11.0 | ^12.0",
"robiningelbrecht/phpunit-coverage-tools": "^1.9",
"squizlabs/php_codesniffer": "^3.5"
},
"time": "2025-09-07T17:04:26+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"Phrity\\Http\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Sören Jensen",
"email": "sirn@sirn.se",
"homepage": "https://phrity.sirn.se"
}
],
"description": "Utilities and interfaces for handling HTTP.",
"homepage": "https://phrity.sirn.se/http",
"keywords": [
"HTTP Factories",
"http",
"psr-17"
],
"support": {
"issues": "https://github.com/sirn-se/phrity-http/issues",
"source": "https://github.com/sirn-se/phrity-http/tree/1.0.0"
},
"install-path": "../phrity/http"
},
{
"name": "phrity/net-stream",
"version": "2.3.1",
"version_normalized": "2.3.1.0",
"source": {
"type": "git",
"url": "https://github.com/sirn-se/phrity-net-stream.git",
"reference": "c621bb3108a5a02bba64df2e5f0cd7ada02665b5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sirn-se/phrity-net-stream/zipball/c621bb3108a5a02bba64df2e5f0cd7ada02665b5",
"reference": "c621bb3108a5a02bba64df2e5f0cd7ada02665b5",
"shasum": ""
},
"require": {
"php": "^8.1",
"phrity/util-errorhandler": "^1.1",
"psr/http-factory": "^1.0",
"psr/http-message": "^1.1 | ^2.0"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.0",
"phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^10.0 | ^11.0 | ^12.0",
"phrity/net-uri": "^2.0",
"squizlabs/php_codesniffer": "^3.5"
},
"time": "2025-08-08T09:51:04+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"Phrity\\Net\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Sören Jensen",
"email": "sirn@sirn.se",
"homepage": "https://phrity.sirn.se"
}
],
"description": "Socket stream classes implementing PSR-7 Stream and PSR-17 StreamFactory",
"homepage": "https://phrity.sirn.se/net-stream",
"keywords": [
"Socket",
"client",
"psr-17",
"psr-7",
"server",
"stream",
"stream factory"
],
"support": {
"issues": "https://github.com/sirn-se/phrity-net-stream/issues",
"source": "https://github.com/sirn-se/phrity-net-stream/tree/2.3.1"
},
"install-path": "../phrity/net-stream"
},
{
"name": "phrity/net-uri",
"version": "2.2.0",
"version_normalized": "2.2.0.0",
"source": {
"type": "git",
"url": "https://github.com/sirn-se/phrity-net-uri.git",
"reference": "08de4cf07e439c4708f572249659f09198ac99f0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sirn-se/phrity-net-uri/zipball/08de4cf07e439c4708f572249659f09198ac99f0",
"reference": "08de4cf07e439c4708f572249659f09198ac99f0",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"php": "^8.1",
"phrity/comparison": "^1.0",
"psr/http-factory": "^1.0",
"psr/http-message": "^1.1 | ^2.0"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.0",
"phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^10.0 | ^11.0 | ^12.0",
"phrity/util-errorhandler": "^1.1",
"squizlabs/php_codesniffer": "^3.5"
},
"suggest": {
"ext-intl": "Enables IDN conversion for non-ASCII domains"
},
"time": "2025-05-25T13:05:13+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"Phrity\\Net\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Sören Jensen",
"email": "sirn@sirn.se",
"homepage": "https://phrity.sirn.se"
}
],
"description": "PSR-7 Uri and PSR-17 UriFactory implementation",
"homepage": "https://phrity.sirn.se/net-uri",
"keywords": [
"psr-17",
"psr-7",
"uri",
"uri factory"
],
"support": {
"issues": "https://github.com/sirn-se/phrity-net-uri/issues",
"source": "https://github.com/sirn-se/phrity-net-uri/tree/2.2.0"
},
"install-path": "../phrity/net-uri"
},
{
"name": "phrity/util-errorhandler",
"version": "1.2.1",
"version_normalized": "1.2.1.0",
"source": {
"type": "git",
"url": "https://github.com/sirn-se/phrity-util-errorhandler.git",
"reference": "9825f15ef9b4a93252ce53ca8962278832d834da"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sirn-se/phrity-util-errorhandler/zipball/9825f15ef9b4a93252ce53ca8962278832d834da",
"reference": "9825f15ef9b4a93252ce53ca8962278832d834da",
"shasum": ""
},
"require": {
"php": "^8.1"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.0",
"phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^10.0 | ^11.0 | ^12.0",
"squizlabs/php_codesniffer": "^3.5"
},
"time": "2025-08-08T09:48:45+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"Phrity\\Util\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Sören Jensen",
"email": "sirn@sirn.se",
"homepage": "https://phrity.sirn.se"
}
],
"description": "Inline error handler; catch and resolve errors for code block.",
"homepage": "https://phrity.sirn.se/util-errorhandler",
"keywords": [
"error",
"warning"
],
"support": {
"issues": "https://github.com/sirn-se/phrity-util-errorhandler/issues",
"source": "https://github.com/sirn-se/phrity-util-errorhandler/tree/1.2.1"
},
"install-path": "../phrity/util-errorhandler"
},
{
"name": "phrity/websocket",
"version": "3.6.0",
"version_normalized": "3.6.0.0",
"source": {
"type": "git",
"url": "https://github.com/sirn-se/websocket-php.git",
"reference": "3f16b2564a230bbce716cccaff2f6156a60a8798"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sirn-se/websocket-php/zipball/3f16b2564a230bbce716cccaff2f6156a60a8798",
"reference": "3f16b2564a230bbce716cccaff2f6156a60a8798",
"shasum": ""
},
"require": {
"php": "^8.1",
"phrity/http": "^1.0",
"phrity/net-stream": "^2.3",
"phrity/net-uri": "^2.1",
"psr/http-message": "^1.1 | ^2.0",
"psr/log": "^1.0 | ^2.0 | ^3.0"
},
"require-dev": {
"guzzlehttp/psr7": "^2.0",
"php-coveralls/php-coveralls": "^2.0",
"phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^10.0 | ^11.0 | ^12.0",
"phrity/logger-console": "^1.0",
"phrity/net-mock": "^2.3",
"phrity/util-errorhandler": "^1.1",
"robiningelbrecht/phpunit-coverage-tools": "^1.9",
"squizlabs/php_codesniffer": "^3.5"
},
"time": "2025-09-08T16:21:41+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"WebSocket\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"ISC"
],
"authors": [
{
"name": "Fredrik Liljegren"
},
{
"name": "Sören Jensen",
"email": "sirn@sirn.se",
"homepage": "https://phrity.sirn.se"
}
],
"description": "WebSocket client and server",
"homepage": "https://phrity.sirn.se/websocket",
"keywords": [
"client",
"server",
"websocket"
],
"support": {
"issues": "https://github.com/sirn-se/websocket-php/issues",
"source": "https://github.com/sirn-se/websocket-php/tree/3.6.0"
},
"install-path": "../phrity/websocket"
},
{
"name": "psr/http-factory",
"version": "1.1.0",
"version_normalized": "1.1.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-factory.git",
"reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a",
"reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a",
"shasum": ""
},
"require": {
"php": ">=7.1",
"psr/http-message": "^1.0 || ^2.0"
},
"time": "2024-04-15T12:06:14+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Psr\\Http\\Message\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"description": "PSR-17: Common interfaces for PSR-7 HTTP message factories",
"keywords": [
"factory",
"http",
"message",
"psr",
"psr-17",
"psr-7",
"request",
"response"
],
"support": {
"source": "https://github.com/php-fig/http-factory"
},
"install-path": "../psr/http-factory"
},
{
"name": "psr/http-message",
"version": "2.0",
"version_normalized": "2.0.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-message.git",
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71",
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0"
},
"time": "2023-04-04T09:54:51+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Psr\\Http\\Message\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common interface for HTTP messages",
"homepage": "https://github.com/php-fig/http-message",
"keywords": [
"http",
"http-message",
"psr",
"psr-7",
"request",
"response"
],
"support": {
"source": "https://github.com/php-fig/http-message/tree/2.0"
},
"install-path": "../psr/http-message"
},
{
"name": "psr/log",
"version": "3.0.2",
"version_normalized": "3.0.2.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
"reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
"shasum": ""
},
"require": {
"php": ">=8.0.0"
},
"time": "2024-09-11T13:17:53+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.x-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Psr\\Log\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common interface for logging libraries",
"homepage": "https://github.com/php-fig/log",
"keywords": [
"log",
"psr",
"psr-3"
],
"support": {
"source": "https://github.com/php-fig/log/tree/3.0.2"
},
"install-path": "../psr/log"
},
{
"name": "tecnickcom/tcpdf",
"version": "6.10.0",
"version_normalized": "6.10.0.0",
"source": {
"type": "git",
"url": "https://github.com/tecnickcom/TCPDF.git",
"reference": "ca5b6de294512145db96bcbc94e61696599c391d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/ca5b6de294512145db96bcbc94e61696599c391d",
"reference": "ca5b6de294512145db96bcbc94e61696599c391d",
"shasum": ""
},
"require": {
"ext-curl": "*",
"php": ">=7.1.0"
},
"time": "2025-05-27T18:02:28+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"classmap": [
"config",
"include",
"tcpdf.php",
"tcpdf_barcodes_1d.php",
"tcpdf_barcodes_2d.php",
"include/tcpdf_colors.php",
"include/tcpdf_filters.php",
"include/tcpdf_font_data.php",
"include/tcpdf_fonts.php",
"include/tcpdf_images.php",
"include/tcpdf_static.php",
"include/barcodes/datamatrix.php",
"include/barcodes/pdf417.php",
"include/barcodes/qrcode.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0-or-later"
],
"authors": [
{
"name": "Nicola Asuni",
"email": "info@tecnick.com",
"role": "lead"
}
],
"description": "TCPDF is a PHP class for generating PDF documents and barcodes.",
"homepage": "http://www.tcpdf.org/",
"keywords": [
"PDFD32000-2008",
"TCPDF",
"barcodes",
"datamatrix",
"pdf",
"pdf417",
"qrcode"
],
"support": {
"issues": "https://github.com/tecnickcom/TCPDF/issues",
"source": "https://github.com/tecnickcom/TCPDF/tree/6.10.0"
},
"funding": [
{
"url": "https://www.paypal.com/donate/?hosted_button_id=NZUEC5XS8MFBJ",
"type": "custom"
}
],
"install-path": "../tecnickcom/tcpdf"
}
],
"dev": true,
"dev-package-names": []
}
icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/composer/installed.php 0000664 0000000 0000000 00000011144 15112050317 0025627 0 ustar 00root root 0000000 0000000 array(
'name' => '__root__',
'pretty_version' => '1.0.0+no-version-set',
'version' => '1.0.0.0',
'reference' => null,
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev' => true,
),
'versions' => array(
'__root__' => array(
'pretty_version' => '1.0.0+no-version-set',
'version' => '1.0.0.0',
'reference' => null,
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev_requirement' => false,
),
'karriere/pdf-merge' => array(
'pretty_version' => 'v3.3.1',
'version' => '3.3.1.0',
'reference' => 'd524a9d261ea96b18bbbab685b5710a7a0fe3a6e',
'type' => 'library',
'install_path' => __DIR__ . '/../karriere/pdf-merge',
'aliases' => array(),
'dev_requirement' => false,
),
'phrity/comparison' => array(
'pretty_version' => '1.4.0',
'version' => '1.4.0.0',
'reference' => 'aedd44d59db08de7d6c31812d1490c22aab35c92',
'type' => 'library',
'install_path' => __DIR__ . '/../phrity/comparison',
'aliases' => array(),
'dev_requirement' => false,
),
'phrity/http' => array(
'pretty_version' => '1.0.0',
'version' => '1.0.0.0',
'reference' => '536e3e46e6220d171a59599ed1f4da9f6b6244fc',
'type' => 'library',
'install_path' => __DIR__ . '/../phrity/http',
'aliases' => array(),
'dev_requirement' => false,
),
'phrity/net-stream' => array(
'pretty_version' => '2.3.1',
'version' => '2.3.1.0',
'reference' => 'c621bb3108a5a02bba64df2e5f0cd7ada02665b5',
'type' => 'library',
'install_path' => __DIR__ . '/../phrity/net-stream',
'aliases' => array(),
'dev_requirement' => false,
),
'phrity/net-uri' => array(
'pretty_version' => '2.2.0',
'version' => '2.2.0.0',
'reference' => '08de4cf07e439c4708f572249659f09198ac99f0',
'type' => 'library',
'install_path' => __DIR__ . '/../phrity/net-uri',
'aliases' => array(),
'dev_requirement' => false,
),
'phrity/util-errorhandler' => array(
'pretty_version' => '1.2.1',
'version' => '1.2.1.0',
'reference' => '9825f15ef9b4a93252ce53ca8962278832d834da',
'type' => 'library',
'install_path' => __DIR__ . '/../phrity/util-errorhandler',
'aliases' => array(),
'dev_requirement' => false,
),
'phrity/websocket' => array(
'pretty_version' => '3.6.0',
'version' => '3.6.0.0',
'reference' => '3f16b2564a230bbce716cccaff2f6156a60a8798',
'type' => 'library',
'install_path' => __DIR__ . '/../phrity/websocket',
'aliases' => array(),
'dev_requirement' => false,
),
'psr/http-factory' => array(
'pretty_version' => '1.1.0',
'version' => '1.1.0.0',
'reference' => '2b4765fddfe3b508ac62f829e852b1501d3f6e8a',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/http-factory',
'aliases' => array(),
'dev_requirement' => false,
),
'psr/http-message' => array(
'pretty_version' => '2.0',
'version' => '2.0.0.0',
'reference' => '402d35bcb92c70c026d1a6a9883f06b2ead23d71',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/http-message',
'aliases' => array(),
'dev_requirement' => false,
),
'psr/log' => array(
'pretty_version' => '3.0.2',
'version' => '3.0.2.0',
'reference' => 'f16e1d5863e37f8d8c2a01719f5b34baa2b714d3',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/log',
'aliases' => array(),
'dev_requirement' => false,
),
'tecnickcom/tcpdf' => array(
'pretty_version' => '6.10.0',
'version' => '6.10.0.0',
'reference' => 'ca5b6de294512145db96bcbc94e61696599c391d',
'type' => 'library',
'install_path' => __DIR__ . '/../tecnickcom/tcpdf',
'aliases' => array(),
'dev_requirement' => false,
),
),
);
icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/composer/platform_check.php 0000664 0000000 0000000 00000001625 15112050317 0026634 0 ustar 00root root 0000000 0000000 = 80200)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 8.2.0". You are running ' . PHP_VERSION . '.';
}
if ($issues) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
} elseif (!headers_sent()) {
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
}
}
throw new \RuntimeException(
'Composer detected issues in your platform: ' . implode(' ', $issues)
);
}
icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/karriere/ 0000775 0000000 0000000 00000000000 15112050317 0023113 5 ustar 00root root 0000000 0000000 icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/karriere/pdf-merge/ 0000775 0000000 0000000 00000000000 15112050317 0024761 5 ustar 00root root 0000000 0000000 icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/karriere/pdf-merge/.github/ 0000775 0000000 0000000 00000000000 15112050317 0026321 5 ustar 00root root 0000000 0000000 icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/karriere/pdf-merge/.github/workflows/ 0000775 0000000 0000000 00000000000 15112050317 0030356 5 ustar 00root root 0000000 0000000 icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/karriere/pdf-merge/.github/workflows/ci.yml 0000664 0000000 0000000 00000001426 15112050317 0031477 0 ustar 00root root 0000000 0000000 name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
strategy:
fail-fast: true
matrix:
php: [ "8.1", "8.2", "8.3", "8.4" ]
runs-on: ubuntu-latest
name: PHP@${{ matrix.php }}
steps:
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- uses: actions/checkout@v4
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: Lint code
run: composer run-script lint
- name: Analyse code
run: composer run-script analyse
- name: Test code
run: composer run-script test
icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/karriere/pdf-merge/.gitignore 0000664 0000000 0000000 00000000136 15112050317 0026751 0 ustar 00root root 0000000 0000000 vendor/
coverage/
tests/output.pdf
.phpunit.result.cache
composer.lock
coverage.xml
junit.xml
icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/karriere/pdf-merge/CHANGELOG.md 0000664 0000000 0000000 00000003305 15112050317 0026573 0 ustar 00root root 0000000 0000000 # Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [3.3.1] - 2025-02-19
### Added
- `@throws` to PHPDoc for better IDE support
## [3.3.0] - 2025-02-19
### Added
- Method `getFiles()`
## [3.2.0] - 2024-12-05
### Added
- Support for PHP 8.4
### Removed
- Support for PHP 8.0
## [3.1.0] - 2024-02-05
### Added
- Support for PHP 8.3
## [3.0.0] - 2023-03-01
### Added
- Support for PHP 8.2
### Changed
- [BREAKING] Header and footer config with dedicated classes instead of arrays
- Linting to `pint`
- Unit tests to `pest`
### Removed
- Support for PHP 7.4
## [2.1.0] - 2022-12-07
### Added
- Support for merging PDFs with mixed orientations (portrait and landscape)
### Changed
- Default header and footer are removed if header/footer-data is empty
## [2.0.0] - 2022-08-10
### Added
- Support for PHP 8.1
- Ability to get `TCPDF`-instance by calling `(new PdfMerge())->getPdf()`
### Changed
- [BREAKING] `PdfMerge::merge()` now returns `string` instead of `bool`
- `PdfMerge::merge()` now accepts `string $destination` as second parameter
### Removed
- Dropped support for PHP < 7.4
## [1.3.0] - 2021-10-20
### Added
- Support for PHP 8
## [1.2.0] - 2021-09-06
### Added
- Ability to set `tcpdf` footer and header data via PdfMerge constructor
## [1.1.1] - 2020-04-03
### Fixed
- removed unused imagick options
## [1.1.0] - 2020-03-30
### Added
- tcpdf dependency
- tcpdi implementation
### Removed
- fpdf and fpdi dependencies
## [1.0.0] - 2020-03-30
### Added
- Pdf merging implementation based on fpdf & fpdi
icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/karriere/pdf-merge/LICENSE 0000664 0000000 0000000 00000024654 15112050317 0026001 0 ustar 00root root 0000000 0000000 Copyright 2017 karriere.at GmbH
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/karriere/pdf-merge/README.md 0000664 0000000 0000000 00000003516 15112050317 0026245 0 ustar 00root root 0000000 0000000

[](https://packagist.org/packages/karriere/pdf-merge)
# Pdf Merge Solution for PHP
This package is a wrapper for the `TCPDF` class that provides an elegant API for merging PDF files.
## Installation
You can install the package via composer:
```bash
composer require karriere/pdf-merge
```
## Usage
```php
use Karriere\PdfMerge\PdfMerge;
$pdfMerge = new PdfMerge();
$pdfMerge->add('/path/to/file1.pdf');
$pdfMerge->add('/path/to/file2.pdf');
$pdfMerge->merge('/path/to/output.pdf');
```
Please note, that the `merge()`-method will throw a `NoFilesDefinedException` if no files where added.
### Check for file existence
You can check if a file was already added for merging by calling:
```php
$pdfMerge->contains('/path/to/file.pdf');
```
### Configuring header and footer
You can also configure the header of footer of all pages like this:
```php
use Karriere\PdfMerge\PdfMerge;
$pdfMerge = new PdfMerge(
new HeaderConfig(
imagePath: 'header_logo.png',
logoWidthMM: 20,
title: 'Header',
text: 'This is a header text',
textColor: new RGB(200, 200, 200),
lineColor: new RGB(0, 0, 255),
),
new FooterConfig(
textColor: new RGB(100, 100, 100),
lineColor: new RGB(255, 0, 0),
margin: 20,
),
);
```
All config properties have default values, so you don't have to pass them all.
## License
Apache License 2.0 Please see [LICENSE](LICENSE) for more information.
icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/karriere/pdf-merge/UPGRADE.md 0000664 0000000 0000000 00000003313 15112050317 0026372 0 ustar 00root root 0000000 0000000 # Upgrade Guide
## v2 to v3
The only breaking chance in this release is the way a header and/or footer configuration is done.
In version 2 this was done with simple arrays, in v3 dedicated classes were introduced to make the
configuration type safe and bullet proof.
### Header/Footer Configuration
```php
// Before
use Karriere\PdfMerge\PdfMerge;
new PdfMerge([
'ln' => 'header_logo.png',
'lw' => 20,
'ht' => 'title',
'hs' => 'more text',
'tc' => [255, 255, 255],
'lc' => [0, 0, 0].
],
[
'tc' => [255, 255, 255],
'lc' => [0, 0, 0].
]);
// After
use Karriere\PdfMerge\Config\FooterConfig;
use Karriere\PdfMerge\Config\HeaderConfig;
use Karriere\PdfMerge\Config\RGB;
use Karriere\PdfMerge\PdfMerge;
new PdfMerge(
new HeaderConfig(
imagePath: 'header_logo.png',
logoWidthMM: 20,
title: 'Header',
text: 'This is a header text',
textColor: new RGB(200, 200, 200),
lineColor: new RGB(0, 0, 255),
),
new FooterConfig(
textColor: new RGB(100, 100, 100),
lineColor: new RGB(255, 0, 0),
margin: 20,
),
);
```
The above example shows the full feature set of header/footer configuration, but when using named arguments you can
choose a subset of configuration values as well because all other values have defaults in place:
```php
use Karriere\PdfMerge\Config\FooterConfig;
use Karriere\PdfMerge\Config\HeaderConfig;
use Karriere\PdfMerge\Config\RGB;
use Karriere\PdfMerge\PdfMerge;
new PdfMerge(
new HeaderConfig(
imagePath: 'header_logo.png',
text: 'This is a header text',
textColor: new RGB(200, 200, 200),
),
new FooterConfig(
lineColor: new RGB(255, 0, 0),
),
);
```
icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/karriere/pdf-merge/composer.json 0000664 0000000 0000000 00000003012 15112050317 0027477 0 ustar 00root root 0000000 0000000 {
"name": "karriere/pdf-merge",
"description": "A wrapper for the TCPDF class that provides an elegant API for merging PDFs",
"keywords": ["pdf", "merge"],
"license": "Apache-2.0",
"authors": [
{
"name": "Alexander Lentner",
"email": "alexander.lentner@karriere.at",
"role": "Maintainer"
}
],
"require": {
"php": "8.1.* | 8.2.* | 8.3.* | 8.4.*",
"tecnickcom/tcpdf": "^6.3"
},
"require-dev": {
"laravel/pint": "^1.5 | ^1.6",
"pestphp/pest": "^1.22",
"phpstan/phpstan": "^1.10"
},
"autoload": {
"psr-4": {
"Karriere\\PdfMerge\\": "src/"
},
"classmap": [
"tcpi/fpdf_tpl.php",
"tcpi/tcpdi.php",
"tcpi/tcpdi_parser.php"
]
},
"autoload-dev": {
"psr-4": {
"Karriere\\PdfMerge\\Tests\\": "tests"
}
},
"scripts": {
"analyse": "phpstan analyse --memory-limit 512M",
"lint": "pint --test",
"lint:verbose": "pint -v --test",
"fix": "pint",
"test": "vendor/bin/pest",
"coverage": "vendor/bin/pest --coverage --ci --coverage-html coverage --coverage-clover coverage.xml --log-junit junit.xml",
"report": "vendor/bin/pest --coverage",
"report:html": "vendor/bin/pest --coverage --coverage-html coverage"
},
"config": {
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true
}
}
}
icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/karriere/pdf-merge/phpstan.neon 0000664 0000000 0000000 00000000130 15112050317 0027311 0 ustar 00root root 0000000 0000000 parameters:
paths:
- src
level: max
treatPhpDocTypesAsCertain: true
icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/karriere/pdf-merge/phpunit.xml 0000664 0000000 0000000 00000001033 15112050317 0027167 0 ustar 00root root 0000000 0000000
./tests
./src
icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/karriere/pdf-merge/pint.json 0000664 0000000 0000000 00000000135 15112050317 0026625 0 ustar 00root root 0000000 0000000 {
"preset": "psr12",
"rules": {
"concat_space": {
"spacing": "one"
}
}
}
icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/karriere/pdf-merge/src/ 0000775 0000000 0000000 00000000000 15112050317 0025550 5 ustar 00root root 0000000 0000000 icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/karriere/pdf-merge/src/Config/ 0000775 0000000 0000000 00000000000 15112050317 0026755 5 ustar 00root root 0000000 0000000 icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/karriere/pdf-merge/src/Config/FooterConfig.php 0000664 0000000 0000000 00000001321 15112050317 0032047 0 ustar 00root root 0000000 0000000 textColor ?: new RGB();
}
public function lineColor(): RGB
{
return $this->lineColor ?: new RGB();
}
public function margin(): int
{
return $this->margin;
}
}
icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/karriere/pdf-merge/src/Config/HeaderConfig.php 0000664 0000000 0000000 00000002321 15112050317 0032002 0 ustar 00root root 0000000 0000000 imagePath;
}
public function logoWidthMM(): int
{
return $this->logoWidthMM;
}
public function title(): string
{
return $this->title;
}
public function text(): string
{
return $this->text;
}
public function textColor(): RGB
{
return $this->textColor ?: new RGB();
}
public function lineColor(): RGB
{
return $this->lineColor ?: new RGB();
}
}
icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/karriere/pdf-merge/src/Config/RGB.php 0000664 0000000 0000000 00000000477 15112050317 0030110 0 ustar 00root root 0000000 0000000
*/
public function toArray(): array
{
return [$this->red, $this->green, $this->blue];
}
}
icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/karriere/pdf-merge/src/Exceptions/ 0000775 0000000 0000000 00000000000 15112050317 0027671 5 ustar 00root root 0000000 0000000 FileNotFoundException.php 0000664 0000000 0000000 00000000360 15112050317 0034535 0 ustar 00root root 0000000 0000000 icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/karriere/pdf-merge/src/Exceptions
*/
private array $files = [];
private TCPDI $pdf;
/**
* Passed parameters overrides settings for header and footer by calling tcpdf.php methods:
* setHeaderData($ln='', $lw=0, $ht='', $hs='', $tc=array(0,0,0), $lc=array(0,0,0))
* setFooterData($tc=array(0,0,0), $lc=array(0,0,0))
* For more info about tcpdf, please read https://tcpdf.org/docs/
*/
public function __construct(?HeaderConfig $headerConfig = null, ?FooterConfig $footerConfig = null)
{
$this->pdf = new TCPDI();
$this->configureHeaderAndFooter($headerConfig, $footerConfig);
}
public function getPdf(): TCPDI
{
return $this->pdf;
}
/**
* Adds a file to merge
*
* @throws FileNotFoundException
*/
public function add(string $file): void
{
if (!file_exists($file)) {
throw new FileNotFoundException($file);
}
$this->files[] = $file;
}
/**
* Checks if the given file is already registered for merging
*/
public function contains(string $file): bool
{
return in_array($file, $this->files);
}
/**
* Resets the stored files
*/
public function reset(): void
{
$this->files = [];
}
/**
* Generates a merged PDF file from the already stored PDF files
*
* @throws NoFilesDefinedException
*/
public function merge(string $outputFilename, string $destination = 'F'): string
{
if (count($this->files) === 0) {
throw new NoFilesDefinedException();
}
foreach ($this->files as $file) {
$pageCount = $this->pdf->setSourceFile($file);
for ($i = 1; $i <= $pageCount; $i++) {
$pageId = $this->pdf->ImportPage($i);
$size = $this->pdf->getTemplateSize($pageId);
$this->pdf->AddPage('', $size);
$this->pdf->useTemplate($pageId, null, null, 0, 0, true);
}
}
return $this->pdf->Output($outputFilename, $destination);
}
/**
* @return array
*/
public function getFiles(): array
{
return $this->files;
}
private function configureHeaderAndFooter(?HeaderConfig $headerConfig, ?FooterConfig $footerConfig): void
{
if ($headerConfig) {
$this->pdf->setHeaderData(
$headerConfig->imagePath(),
$headerConfig->logoWidthMM(),
$headerConfig->title(),
$headerConfig->text(),
$headerConfig->textColor()->toArray(),
$headerConfig->lineColor()->toArray(),
);
} else {
$this->pdf->setPrintHeader(false);
}
if ($footerConfig) {
$this->pdf->setFooterData($footerConfig->textColor()->toArray(), $footerConfig->lineColor()->toArray());
$this->pdf->setFooterMargin($footerConfig->margin());
} else {
$this->pdf->setPrintFooter(false);
}
}
}
icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/karriere/pdf-merge/tcpi/ 0000775 0000000 0000000 00000000000 15112050317 0025720 5 ustar 00root root 0000000 0000000 icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/karriere/pdf-merge/tcpi/fpdf_tpl.php 0000664 0000000 0000000 00000037040 15112050317 0030233 0 ustar 00root root 0000000 0000000 Error('This method is only usable with FPDF. Use TCPDF methods startTemplate() instead.');
return;
}
if ($this->page <= 0) {
$this->error("You have to add a page to fpdf first!");
}
if ($x == null) {
$x = 0;
}
if ($y == null) {
$y = 0;
}
if ($w == null) {
$w = $this->w;
}
if ($h == null) {
$h = $this->h;
}
// Save settings
$this->tpl++;
$tpl = & $this->tpls[$this->tpl];
$tpl = array(
'o_x' => $this->x,
'o_y' => $this->y,
'o_AutoPageBreak' => $this->AutoPageBreak,
'o_bMargin' => $this->bMargin,
'o_tMargin' => $this->tMargin,
'o_lMargin' => $this->lMargin,
'o_rMargin' => $this->rMargin,
'o_h' => $this->h,
'o_w' => $this->w,
'o_FontFamily' => $this->FontFamily,
'o_FontStyle' => $this->FontStyle,
'o_FontSizePt' => $this->FontSizePt,
'o_FontSize' => $this->FontSize,
'buffer' => '',
'x' => $x,
'y' => $y,
'w' => $w,
'h' => $h
);
$this->SetAutoPageBreak(false);
// Define own high and width to calculate possitions correct
$this->h = $h;
$this->w = $w;
$this->_intpl = true;
$this->SetXY($x + $this->lMargin, $y + $this->tMargin);
$this->SetRightMargin($this->w - $w + $this->rMargin);
if ($this->CurrentFont) {
$fontkey = $this->FontFamily . $this->FontStyle;
$this->_res['tpl'][$this->tpl]['fonts'][$fontkey] = & $this->fonts[$fontkey];
$this->_out(sprintf('BT /F%d %.2f Tf ET', $this->CurrentFont['i'], $this->FontSizePt));
}
return $this->tpl;
}
/**
* End Template
*
* This method ends a template and reset initiated variables on beginTemplate.
*
* @return mixed If a template is opened, the ID is returned. If not a false is returned.
*/
public function endTemplate()
{
if (is_subclass_of($this, 'TCPDF')) {
$args = func_get_args();
return call_user_func_array([TCPDF::class, 'endTemplate'], $args);
}
if ($this->_intpl) {
$this->_intpl = false;
$tpl = & $this->tpls[$this->tpl];
$this->SetXY($tpl['o_x'], $tpl['o_y']);
$this->tMargin = $tpl['o_tMargin'];
$this->lMargin = $tpl['o_lMargin'];
$this->rMargin = $tpl['o_rMargin'];
$this->h = $tpl['o_h'];
$this->w = $tpl['o_w'];
$this->SetAutoPageBreak($tpl['o_AutoPageBreak'], $tpl['o_bMargin']);
$this->FontFamily = $tpl['o_FontFamily'];
$this->FontStyle = $tpl['o_FontStyle'];
$this->FontSizePt = $tpl['o_FontSizePt'];
$this->FontSize = $tpl['o_FontSize'];
$fontkey = $this->FontFamily . $this->FontStyle;
if ($fontkey) {
$this->CurrentFont = & $this->fonts[$fontkey];
}
return $this->tpl;
} else {
return false;
}
}
/**
* Use a Template in current Page or other Template
*
* You can use a template in a page or in another template.
* You can give the used template a new size like you use the Image()-method.
* All parameters are optional. The width or height is calculated automaticaly
* if one is given. If no parameter is given the origin size as defined in
* beginTemplate() is used.
* The calculated or used width and height are returned as an array.
*
* @param int $tplidx A valid template-Id
* @param int $_x The x-position
* @param int $_y The y-position
* @param int $_w The new width of the template
* @param int $_h The new height of the template
* @retrun array The height and width of the template
*/
public function useTemplate($tplidx, $_x = null, $_y = null, $_w = 0, $_h = 0)
{
if ($this->page <= 0) {
$this->error('You have to add a page first!');
}
if (!isset($this->tpls[$tplidx])) {
$this->error('Template does not exist!');
}
if ($this->_intpl) {
$this->_res['tpl'][$this->tpl]['tpls'][$tplidx] = & $this->tpls[$tplidx];
}
$tpl = & $this->tpls[$tplidx];
$w = $tpl['w'];
$h = $tpl['h'];
if ($_x == null) {
$_x = 0;
}
if ($_y == null) {
$_y = 0;
}
$_x += $tpl['x'];
$_y += $tpl['y'];
$wh = $this->getTemplateSize($tplidx, $_w, $_h);
$_w = $wh['w'];
$_h = $wh['h'];
$tData = array(
'x' => $this->x,
'y' => $this->y,
'w' => $_w,
'h' => $_h,
'scaleX' => ($_w / $w),
'scaleY' => ($_h / $h),
'tx' => $_x,
'ty' => ($this->h - $_y - $_h),
'lty' => ($this->h - $_y - $_h) - ($this->h - $h) * ($_h / $h)
);
$this->_out(sprintf('q %.4F 0 0 %.4F %.4F %.4F cm', $tData['scaleX'], $tData['scaleY'], $tData['tx'] * $this->k, $tData['ty'] * $this->k)); // Translate
$this->_out(sprintf('%s%d Do Q', $this->tplprefix, $tplidx));
$this->lastUsedTemplateData = $tData;
return array('w' => $_w, 'h' => $_h);
}
/**
* Get The calculated Size of a Template
*
* If one size is given, this method calculates the other one.
*
* @param int $tplidx A valid template-Id
* @param int $_w The width of the template
* @param int $_h The height of the template
* @return array The height and width of the template
*/
public function getTemplateSize($tplidx, $_w = 0, $_h = 0)
{
if (!isset($this->tpls[$tplidx])) {
return false;
}
$tpl = & $this->tpls[$tplidx];
$w = $tpl['w'];
$h = $tpl['h'];
if ($_w == 0 and $_h == 0) {
$_w = $w;
$_h = $h;
}
if ($_w == 0) {
$_w = $_h * $w / $h;
}
if ($_h == 0) {
$_h = $_w * $h / $w;
}
return array("w" => $_w, "h" => $_h);
}
/**
* See FPDF/TCPDF-Documentation ;-)
*/
public function SetFont($family, $style = '', $size = 0, $fontfile = '', $subset = 'default', $out = true)
{
if (is_subclass_of($this, 'TCPDF')) {
$args = func_get_args();
return call_user_func_array([TCPDF::class, 'SetFont'], $args);
}
parent::SetFont($family, $style, $size);
$fontkey = $this->FontFamily . $this->FontStyle;
if ($this->_intpl) {
$this->_res['tpl'][$this->tpl]['fonts'][$fontkey] = & $this->fonts[$fontkey];
} else {
$this->_res['page'][$this->page]['fonts'][$fontkey] = & $this->fonts[$fontkey];
}
}
/**
* See FPDF/TCPDF-Documentation ;-)
*/
public function Image(
$file,
$x = '',
$y = '',
$w = 0,
$h = 0,
$type = '',
$link = '',
$align = '',
$resize = false,
$dpi = 300,
$palign = '',
$ismask = false,
$imgmask = false,
$border = 0,
$fitbox = false,
$hidden = false,
$fitonpage = false,
$alt = false,
$altimgs = []
) {
if (is_subclass_of($this, 'TCPDF')) {
$args = func_get_args();
return call_user_func_array([TCPDF::class, 'Image'], $args);
}
$ret = parent::Image($file, $x, $y, $w, $h, $type, $link);
if ($this->_intpl) {
$this->_res['tpl'][$this->tpl]['images'][$file] = & $this->images[$file];
} else {
$this->_res['page'][$this->page]['images'][$file] = & $this->images[$file];
}
return $ret;
}
/**
* See FPDF-Documentation ;-)
*
* AddPage is not available when you're "in" a template.
*/
public function AddPage($orientation = '', $format = '', $keepmargins = false, $tocpage = false)
{
if (is_subclass_of($this, 'TCPDF')) {
$args = func_get_args();
return call_user_func_array([TCPDF::class, 'AddPage'], $args);
}
if ($this->_intpl) {
$this->Error('Adding pages in templates isn\'t possible!');
}
parent::AddPage($orientation, $format);
}
/**
* Preserve adding Links in Templates ...won't work
*/
public function Link($x, $y, $w, $h, $link, $spaces = 0)
{
if (is_subclass_of($this, 'TCPDF')) {
$args = func_get_args();
return call_user_func_array([TCPDF::class, 'Link'], $args);
}
if ($this->_intpl) {
$this->Error('Using links in templates aren\'t possible!');
}
parent::Link($x, $y, $w, $h, $link);
}
public function AddLink()
{
if (is_subclass_of($this, 'TCPDF')) {
$args = func_get_args();
return call_user_func_array([TCPDF::class, 'AddLink'], $args);
}
if ($this->_intpl) {
$this->Error('Adding links in templates aren\'t possible!');
}
return parent::AddLink();
}
public function SetLink($link, $y = 0, $page = -1)
{
if (is_subclass_of($this, 'TCPDF')) {
$args = func_get_args();
return call_user_func_array([TCPDF::class, 'SetLink'], $args);
}
if ($this->_intpl) {
$this->Error('Setting links in templates aren\'t possible!');
}
parent::SetLink($link, $y, $page);
}
/**
* Private Method that writes the form xobjects
*/
public function _putformxobjects()
{
$filter = ($this->compress) ? '/Filter /FlateDecode ' : '';
reset($this->tpls);
foreach ($this->tpls as $tplidx => $tpl) {
$p = ($this->compress) ? gzcompress($tpl['buffer']) : $tpl['buffer'];
$this->_newobj();
$this->tpls[$tplidx]['n'] = $this->n;
$this->_out('<<' . $filter . '/Type /XObject');
$this->_out('/Subtype /Form');
$this->_out('/FormType 1');
$this->_out(sprintf(
'/BBox [%.2F %.2F %.2F %.2F]',
// llx
$tpl['x'] * $this->k,
// lly
-$tpl['y'] * $this->k,
// urx
($tpl['w'] + $tpl['x']) * $this->k,
// ury
($tpl['h'] - $tpl['y']) * $this->k
));
if ($tpl['x'] != 0 || $tpl['y'] != 0) {
$this->_out(sprintf(
'/Matrix [1 0 0 1 %.5F %.5F]',
-$tpl['x'] * $this->k * 2,
$tpl['y'] * $this->k * 2
));
}
$this->_out('/Resources ');
$this->_out('<_res['tpl'][$tplidx]['fonts']) && count($this->_res['tpl'][$tplidx]['fonts'])) {
$this->_out('/Font <<');
foreach ($this->_res['tpl'][$tplidx]['fonts'] as $font) {
$this->_out('/F' . $font['i'] . ' ' . $font['n'] . ' 0 R');
}
$this->_out('>>');
}
if (isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images']) ||
isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) {
$this->_out('/XObject <<');
if (isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images'])) {
foreach ($this->_res['tpl'][$tplidx]['images'] as $image) {
$this->_out('/I' . $image['i'] . ' ' . $image['n'] . ' 0 R');
}
}
if (isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) {
foreach ($this->_res['tpl'][$tplidx]['tpls'] as $i => $tpl) {
$this->_out($this->tplprefix . $i . ' ' . $tpl['n'] . ' 0 R');
}
}
$this->_out('>>');
}
$this->_out('>>');
$this->_out('/Length ' . strlen($p) . ' >>');
$this->_putstream($p);
$this->_out('endobj');
}
}
/**
* Overwritten to add _putformxobjects() after _putimages()
*
*/
public function _putimages()
{
parent::_putimages();
$this->_putformxobjects();
}
public function _putxobjectdict()
{
parent::_putxobjectdict();
if (count($this->tpls)) {
foreach ($this->tpls as $tplidx => $tpl) {
$this->_out(sprintf('%s%d %d 0 R', $this->tplprefix, $tplidx, $tpl['n']));
}
}
}
/**
* Private Method
*/
public function _out($s)
{
if ($this->state == 2 && $this->_intpl) {
$this->tpls[$this->tpl]['buffer'] .= $s . "\n";
} else {
parent::_out($s);
}
}
}
icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/karriere/pdf-merge/tcpi/tcpdi.php 0000664 0000000 0000000 00000067430 15112050317 0027546 0 ustar 00root root 0000000 0000000 current_filename = $filename;
if (!isset($this->parsers[$filename])) {
$this->parsers[$filename] = $this->_getPdfParser($filename);
}
$this->current_parser = & $this->parsers[$filename];
$this->setPDFVersion(max($this->getPDFVersion(), $this->current_parser->getPDFVersion()));
return $this->parsers[$filename]->getPageCount();
}
/**
* Set a source-file PDF data
*
* @param string $pdfdata The PDF file content
* @return int number of available pages
*/
public function setSourceData($pdfdata)
{
$filename = uniqid('tcpdi-');
$this->current_filename = $filename;
if (!isset($this->parsers[$filename])) {
$this->parsers[$filename] = new tcpdi_parser($pdfdata, $filename);
}
$this->current_parser = & $this->parsers[$filename];
$this->setPDFVersion(max($this->getPDFVersion(), $this->current_parser->getPDFVersion()));
return $this->parsers[$filename]->getPageCount();
}
/**
* Returns a PDF parser object
*
* @param string $filename
* @return fpdi_pdf_parser
*/
public function _getPdfParser($filename)
{
$data = file_get_contents($filename);
return new tcpdi_parser($data, $filename);
}
/**
* Get the current PDF version
*
* @return string
*/
public function getPDFVersion()
{
return $this->PDFVersion;
}
/**
* Set the PDF version
*
* @return string
*/
public function setPDFVersion($version = '1.3')
{
$this->PDFVersion = $version;
}
/**
* Import a page
*
* @param int $pageno pagenumber
* @return int Index of imported page - to use with fpdf_tpl::useTemplate()
*/
public function importPage($pageno, $boxName = '/CropBox')
{
if ($this->_intpl) {
return $this->error('Please import the desired pages before creating a new template.');
}
$fn = $this->current_filename;
// check if page already imported
$pageKey = $fn . '-' . ((int)$pageno) . $boxName;
if (isset($this->_importedPages[$pageKey])) {
return $this->_importedPages[$pageKey];
}
$parser = & $this->parsers[$fn];
$parser->setPageno($pageno);
if (!in_array($boxName, $parser->availableBoxes)) {
return $this->Error(sprintf('Unknown box: %s', $boxName));
}
$pageboxes = $parser->getPageBoxes($pageno, $this->k);
/**
* MediaBox
* CropBox: Default -> MediaBox
* BleedBox: Default -> CropBox
* TrimBox: Default -> CropBox
* ArtBox: Default -> CropBox
*/
if (!isset($pageboxes[$boxName]) && ($boxName == '/BleedBox' || $boxName == '/TrimBox' || $boxName == '/ArtBox')) {
$boxName = '/CropBox';
}
if (!isset($pageboxes[$boxName]) && $boxName == '/CropBox') {
$boxName = '/MediaBox';
}
if (!isset($pageboxes[$boxName])) {
return false;
}
$this->lastUsedPageBox = $boxName;
$box = $pageboxes[$boxName];
$this->tpl++;
$this->tpls[$this->tpl] = array();
$tpl = & $this->tpls[$this->tpl];
$tpl['parser'] = & $parser;
$tpl['resources'] = $parser->getPageResources();
$tpl['buffer'] = $parser->getContent();
$tpl['box'] = $box;
// To build an array that can be used by PDF_TPL::useTemplate()
$this->tpls[$this->tpl] = array_merge($this->tpls[$this->tpl], $box);
// An imported page will start at 0,0 everytime. Translation will be set in _putformxobjects()
$tpl['x'] = 0;
$tpl['y'] = 0;
// handle rotated pages
$rotation = $parser->getPageRotation($pageno);
$tpl['_rotationAngle'] = 0;
if (isset($rotation[1]) && ($angle = $rotation[1] % 360) != 0) {
$steps = $angle / 90;
$_w = $tpl['w'];
$_h = $tpl['h'];
$tpl['w'] = $steps % 2 == 0 ? $_w : $_h;
$tpl['h'] = $steps % 2 == 0 ? $_h : $_w;
if ($angle < 0) {
$angle += 360;
}
$tpl['_rotationAngle'] = $angle * -1;
}
$this->_importedPages[$pageKey] = $this->tpl;
return $this->tpl;
}
public function setPageFormatFromTemplatePage($pageno, $orientation)
{
$fn = $this->current_filename;
$parser = & $this->parsers[$fn];
$parser->setPageno($pageno);
$boxes = $parser->getPageBoxes($pageno, $this->k);
foreach ($boxes as $name => $box) {
if ($name[0] == '/') {
$boxes[substr($name, 1)] = $box;
unset($boxes[$name]);
}
}
$this->setPageFormat($boxes, $orientation);
}
/* Wrapper for AddPage() which tracks TOC pages to offset annotations later */
public function AddPage($orientation = '', $format = '', $keepmargins = false, $tocpage = false)
{
if ($this->inxobj) {
// we are inside an XObject template
return;
}
parent::AddPage($orientation, $format, $keepmargins, $tocpage);
if ($this->tocpage) {
$this->_numTOCpages++;
}
}
/* Wrapper for AddTOC() which tracks TOC position to offset annotations later */
public function AddTOC($page = '', $numbersfont = '', $filler = '.', $toc_name = 'TOC', $style = '', $color = array(0,0,0))
{
if (!TCPDF_STATIC::empty_string($page)) {
$this->_TOCpagenum = $page;
} else {
$this->_TOCpagenum = $this->page;
}
parent::AddTOC($page, $numbersfont, $filler, $toc_name, $style, $color);
}
public function importAnnotations($pageno)
{
$fn = $this->current_filename;
$parser = & $this->parsers[$fn];
$parser->setPageno($pageno);
$annots = $parser->getPageAnnotations();
if (is_array($annots) && $annots[0] == PDF_TYPE_OBJECT // We got an object
&& is_array($annots[1]) && $annots[1][0] == PDF_TYPE_ARRAY // It's an array
&& is_array($annots[1][1]) && count($annots[1][1] > 1) // It's not empty - there are annotations for this page
) {
if (!isset($this->_obj_stack[$fn])) {
$this->_obj_stack[$fn] = array();
}
$this->_importedAnnots[$this->page] = array();
foreach ($annots[1][1] as $annot) {
$this->importAnnotation($annot);
}
}
}
public function importAnnotation($annotation)
{
$fn = $this->current_filename;
$old_id = $annotation[1];
$value = array(PDF_TYPE_OBJREF, $old_id, 0);
if (!isset($this->_don_obj_stack[$fn][$old_id])) {
$this->_newobj(false, true);
$this->_obj_stack[$fn][$old_id] = array($this->n, $value);
$this->_don_obj_stack[$fn][$old_id] = array($this->n, $value);
}
$objid = $this->_don_obj_stack[$fn][$old_id][0];
$this->_importedAnnots[$this->page][] = $objid;
}
/**
* Get references to page annotations.
* @param $n (int) page number
* @return string
* @protected
* @author Nicola Asuni
* @since 5.0.010 (2010-05-17)
*/
protected function _getannotsrefs($n)
{
if (!empty($this->_numTOCpages) && $n >= $this->_TOCpagenum) {
// Offset page number to account for TOC being inserted before page containing annotations.
$n -= $this->_numTOCpages;
}
if (!(isset($this->_importedAnnots[$n]) or isset($this->PageAnnots[$n]) or ($this->sign and isset($this->signature_data['cert_type'])))) {
return '';
}
$out = ' /Annots [';
if (isset($this->_importedAnnots[$n])) {
foreach ($this->_importedAnnots[$n] as $key => $val) {
$out .= ' ' . $val . ' 0 R';
}
}
if (isset($this->PageAnnots[$n])) {
foreach ($this->PageAnnots[$n] as $key => $val) {
if (!in_array($val['n'], $this->radio_groups)) {
$out .= ' ' . $val['n'] . ' 0 R';
}
}
// add radiobutton groups
if (isset($this->radiobutton_groups[$n])) {
foreach ($this->radiobutton_groups[$n] as $key => $data) {
if (isset($data['n'])) {
$out .= ' ' . $data['n'] . ' 0 R';
}
}
}
}
if ($this->sign and ($n == $this->signature_appearance['page']) and isset($this->signature_data['cert_type'])) {
// set reference for signature object
$out .= ' ' . $this->sig_obj_id . ' 0 R';
}
if (!empty($this->empty_signature_appearance)) {
foreach ($this->empty_signature_appearance as $esa) {
if ($esa['page'] == $n) {
// set reference for empty signature objects
$out .= ' ' . $esa['objid'] . ' 0 R';
}
}
}
$out .= ' ]';
return $out;
}
/**
* Returns the last used page box
*
* @return string
*/
public function getLastUsedPageBox()
{
return $this->lastUsedPageBox;
}
public function useTemplate($tplidx, $_x = null, $_y = null, $_w = 0, $_h = 0, $adjustPageSize = false)
{
if ($adjustPageSize == true && is_null($_x) && is_null($_y)) {
$size = $this->getTemplateSize($tplidx, $_w, $_h);
$orientation = $size['w'] > $size['h'] ? 'L' : 'P';
$size = array($size['w'], $size['h']);
$this->setPageFormat($size, $orientation);
}
$this->_out('q 0 J 1 w 0 j 0 G 0 g'); // reset standard values
$s = parent::useTemplate($tplidx, $_x, $_y, $_w, $_h);
$this->_out('Q');
return $s;
}
/**
* Private method, that rebuilds all needed objects of source files
*/
public function _putimportedobjects()
{
if (is_array($this->parsers) && count($this->parsers) > 0) {
foreach ($this->parsers as $filename => $p) {
$this->current_parser = & $this->parsers[$filename];
if (isset($this->_obj_stack[$filename]) && is_array($this->_obj_stack[$filename])) {
while (($n = key($this->_obj_stack[$filename])) !== null) {
$nObj = $this->current_parser->getObjectVal($this->_obj_stack[$filename][$n][1]);
$this->_newobj($this->_obj_stack[$filename][$n][0]);
if ($nObj[0] == PDF_TYPE_STREAM) {
$this->pdf_write_value($nObj);
} else {
$this->pdf_write_value($nObj[1]);
}
$this->_out('endobj');
$this->_obj_stack[$filename][$n] = null; // free memory
unset($this->_obj_stack[$filename][$n]);
reset($this->_obj_stack[$filename]);
}
}
// We're done with this parser. Clean it up to free a bit of RAM.
$this->current_parser->cleanUp();
unset($this->parsers[$filename]);
}
}
}
/**
* Private Method that writes the form xobjects
*/
public function _putformxobjects()
{
$filter = ($this->compress) ? '/Filter /FlateDecode ' : '';
reset($this->tpls);
foreach ($this->tpls as $tplidx => $tpl) {
$p = ($this->compress) ? gzcompress($tpl['buffer']) : $tpl['buffer'];
$this->_newobj();
$cN = $this->n; // TCPDF/Protection: rem current "n"
$this->tpls[$tplidx]['n'] = $this->n;
$this->_out('<<' . $filter . '/Type /XObject');
$this->_out('/Subtype /Form');
$this->_out('/FormType 1');
$this->_out(sprintf(
'/BBox [%.2F %.2F %.2F %.2F]',
(isset($tpl['box']['llx']) ? $tpl['box']['llx'] : $tpl['x']) * $this->k,
(isset($tpl['box']['lly']) ? $tpl['box']['lly'] : -$tpl['y']) * $this->k,
(isset($tpl['box']['urx']) ? $tpl['box']['urx'] : $tpl['w'] + $tpl['x']) * $this->k,
(isset($tpl['box']['ury']) ? $tpl['box']['ury'] : $tpl['h'] - $tpl['y']) * $this->k
));
$c = 1;
$s = 0;
$tx = 0;
$ty = 0;
if (isset($tpl['box'])) {
$tx = -$tpl['box']['llx'];
$ty = -$tpl['box']['lly'];
if ($tpl['_rotationAngle'] <> 0) {
$angle = $tpl['_rotationAngle'] * M_PI / 180;
$c = cos($angle);
$s = sin($angle);
switch ($tpl['_rotationAngle']) {
case -90:
$tx = -$tpl['box']['lly'];
$ty = $tpl['box']['urx'];
break;
case -180:
$tx = $tpl['box']['urx'];
$ty = $tpl['box']['ury'];
break;
case -270:
$tx = $tpl['box']['ury'];
$ty = -$tpl['box']['llx'];
break;
}
}
} elseif ($tpl['x'] != 0 || $tpl['y'] != 0) {
$tx = -$tpl['x'] * 2;
$ty = $tpl['y'] * 2;
}
$tx *= $this->k;
$ty *= $this->k;
if ($c != 1 || $s != 0 || $tx != 0 || $ty != 0) {
$this->_out(sprintf(
'/Matrix [%.5F %.5F %.5F %.5F %.5F %.5F]',
$c,
$s,
-$s,
$c,
$tx,
$ty
));
}
$this->_out('/Resources ');
if (isset($tpl['resources'])) {
$this->current_parser = & $tpl['parser'];
$this->pdf_write_value($tpl['resources']); // "n" will be changed
} else {
$this->_out('<_res['tpl'][$tplidx]['fonts']) && count($this->_res['tpl'][$tplidx]['fonts'])) {
$this->_out('/Font <<');
foreach ($this->_res['tpl'][$tplidx]['fonts'] as $font) {
$this->_out('/F' . $font['i'] . ' ' . $font['n'] . ' 0 R');
}
$this->_out('>>');
}
if (isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images']) ||
isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) {
$this->_out('/XObject <<');
if (isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images'])) {
foreach ($this->_res['tpl'][$tplidx]['images'] as $image) {
$this->_out('/I' . $image['i'] . ' ' . $image['n'] . ' 0 R');
}
}
if (isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) {
foreach ($this->_res['tpl'][$tplidx]['tpls'] as $i => $tpl) {
$this->_out($this->tplprefix . $i . ' ' . $tpl['n'] . ' 0 R');
}
}
$this->_out('>>');
}
$this->_out('>>');
}
$this->_out('/Group <>');
$nN = $this->n; // TCPDF: rem new "n"
$this->n = $cN; // TCPDF: reset to current "n"
$p = $this->_getrawstream($p);
$this->_out('/Length ' . strlen($p) . ' >>');
$this->_out("stream\n" . $p . "\nendstream");
$this->_out('endobj');
$this->n = $nN; // TCPDF: reset to new "n"
}
$this->_putimportedobjects();
}
/**
* Rewritten to handle existing own defined objects
*/
public function _newobj($obj_id = false, $onlynewobj = false)
{
if (!$obj_id) {
$obj_id = ++$this->n;
}
//Begin a new object
if (!$onlynewobj) {
$this->offsets[$obj_id] = $this->bufferlen;
$this->_out($obj_id . ' 0 obj');
$this->_current_obj_id = $obj_id; // for later use with encryption
}
return $obj_id;
}
/**
* Writes a value
* Needed to rebuild the source document
*
* @param mixed $value A PDF-Value. Structure of values see cases in this method
*/
public function pdf_write_value(&$value)
{
switch ($value[0]) {
case PDF_TYPE_STRING:
if ($this->encrypted) {
$value[1] = $this->_unescape($value[1]);
$value[1] = $this->_encrypt_data($this->_current_obj_id, $value[1]);
$value[1] = TCPDF_STATIC::_escape($value[1]);
}
break;
case PDF_TYPE_STREAM:
if ($this->encrypted) {
$value[2][1] = $this->_encrypt_data($this->_current_obj_id, $value[2][1]);
$value[1][1]['/Length'] = array(
PDF_TYPE_NUMERIC,
strlen($value[2][1])
);
}
break;
case PDF_TYPE_HEX:
if ($this->encrypted) {
$value[1] = $this->hex2str($value[1]);
$value[1] = $this->_encrypt_data($this->_current_obj_id, $value[1]);
// remake hexstring of encrypted string
$value[1] = $this->str2hex($value[1]);
}
break;
}
switch ($value[0]) {
case PDF_TYPE_TOKEN:
$this->_straightOut('/' . $value[1] . ' ');
break;
case PDF_TYPE_NUMERIC:
case PDF_TYPE_REAL:
if (is_float($value[1]) && $value[1] != 0) {
$this->_straightOut(rtrim(rtrim(sprintf('%F', $value[1]), '0'), '.') . ' ');
} else {
$this->_straightOut($value[1] . ' ');
}
break;
case PDF_TYPE_ARRAY:
// An array. Output the proper
// structure and move on.
$this->_straightOut('[');
for ($i = 0; $i < count($value[1]); $i++) {
$this->pdf_write_value($value[1][$i]);
}
$this->_out(']');
break;
case PDF_TYPE_DICTIONARY:
// A dictionary.
$this->_straightOut('<<');
reset($value[1]);
foreach ($value[1] as $k => $v) {
$this->_straightOut($k . ' ');
$this->pdf_write_value($v);
}
$this->_straightOut('>>');
break;
case PDF_TYPE_OBJREF:
// An indirect object reference
// Fill the object stack if needed
$cpfn = & $this->current_parser->uniqueid;
if (!isset($this->_don_obj_stack[$cpfn][$value[1]])) {
$this->_newobj(false, true);
$this->_obj_stack[$cpfn][$value[1]] = array($this->n, $value);
$this->_don_obj_stack[$cpfn][$value[1]] = array($this->n, $value); // Value is maybee obsolete!!!
}
$objid = $this->_don_obj_stack[$cpfn][$value[1]][0];
$this->_out($objid . ' 0 R');
break;
case PDF_TYPE_STRING:
// A string.
$this->_straightOut('(' . $value[1] . ')');
break;
case PDF_TYPE_STREAM:
// A stream. First, output the
// stream dictionary, then the
// stream data itself.
$this->pdf_write_value($value[1]);
$this->_out('stream');
$this->_out($value[2][1]);
$this->_out('endstream');
break;
case PDF_TYPE_HEX:
$this->_straightOut('<' . $value[1] . '>');
break;
case PDF_TYPE_BOOLEAN:
$this->_straightOut($value[1] ? 'true ' : 'false ');
break;
case PDF_TYPE_NULL:
// The null object.
$this->_straightOut('null ');
break;
}
}
/**
* Modified so not each call will add a newline to the output.
*/
public function _straightOut($s)
{
if ($this->state == 2) {
if ($this->inxobj) {
// we are inside an XObject template
$this->xobjects[$this->xobjid]['outdata'] .= $s;
} elseif ((!$this->InFooter) and isset($this->footerlen[$this->page]) and ($this->footerlen[$this->page] > 0)) {
// puts data before page footer
$pagebuff = $this->getPageBuffer($this->page);
$page = substr($pagebuff, 0, -$this->footerlen[$this->page]);
$footer = substr($pagebuff, -$this->footerlen[$this->page]);
$this->setPageBuffer($this->page, $page . $s . $footer);
// update footer position
$this->footerpos[$this->page] += strlen($s);
} else {
// set page data
$this->setPageBuffer($this->page, $s, true);
}
} elseif ($this->state > 0) {
// set general data
$this->setBuffer($s);
}
}
/**
* rewritten to close opened parsers
*
*/
public function _enddoc()
{
parent::_enddoc();
$this->_closeParsers();
}
/**
* close all files opened by parsers
*/
public function _closeParsers()
{
if ($this->state > 2 && is_array($this->parsers) && count($this->parsers) > 0) {
$this->cleanUp();
return true;
}
return false;
}
/**
* Removes cylced references and closes the file handles of the parser objects
*/
public function cleanUp()
{
foreach ($this->parsers as $k => $_) {
$this->parsers[$k]->cleanUp();
$this->parsers[$k] = null;
unset($this->parsers[$k]);
}
}
// Functions from here on are taken from FPDI's fpdi2tcpdf_bridge.php to remove dependence on it
public function _putstream($s, $n = 0)
{
$this->_out($this->_getstream($s, $n));
}
public function _getxobjectdict()
{
$out = parent::_getxobjectdict();
if (count($this->tpls)) {
foreach ($this->tpls as $tplidx => $tpl) {
$out .= sprintf('%s%d %d 0 R', $this->tplprefix, $tplidx, $tpl['n']);
}
}
return $out;
}
/**
* Unescapes a PDF string
*
* @param string $s
* @return string
*/
public function _unescape($s)
{
$out = '';
for ($count = 0, $n = strlen($s); $count < $n; $count++) {
if ($s[$count] != '\\' || $count == $n - 1) {
$out .= $s[$count];
} else {
switch ($s[++$count]) {
case ')':
case '(':
case '\\':
$out .= $s[$count];
break;
case 'f':
$out .= chr(0x0C);
break;
case 'b':
$out .= chr(0x08);
break;
case 't':
$out .= chr(0x09);
break;
case 'r':
$out .= chr(0x0D);
break;
case 'n':
$out .= chr(0x0A);
break;
case "\r":
if ($count != $n - 1 && $s[$count + 1] == "\n") {
$count++;
}
break;
case "\n":
break;
default:
// Octal-Values
if (ord($s[$count]) >= ord('0') &&
ord($s[$count]) <= ord('9')) {
$oct = '' . $s[$count];
if (ord($s[$count + 1]) >= ord('0') &&
ord($s[$count + 1]) <= ord('9')) {
$oct .= $s[++$count];
if (ord($s[$count + 1]) >= ord('0') &&
ord($s[$count + 1]) <= ord('9')) {
$oct .= $s[++$count];
}
}
$out .= chr(octdec($oct));
} else {
$out .= $s[$count];
}
}
}
}
return $out;
}
/**
* Hexadecimal to string
*
* @param string $hex
* @return string
*/
public function hex2str($hex)
{
return pack('H*', str_replace(array("\r", "\n", ' '), '', $hex));
}
/**
* String to hexadecimal
*
* @param string $str
* @return string
*/
public function str2hex($str)
{
return current(unpack('H*', $str));
}
}
icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/karriere/pdf-merge/tcpi/tcpdi_parser.php 0000664 0000000 0000000 00000150524 15112050317 0031117 0 ustar 00root root 0000000 0000000 .
//
// See LICENSE file for more information.
// -------------------------------------------------------------------
//
// Description : This is a PHP class for parsing PDF documents.
//
//============================================================+
/**
* @file
* This is a PHP class for parsing PDF documents.
* @author Paul Nicholls
* @author Nicola Asuni
* @version 1.1
*/
if (!defined('PDF_TYPE_NULL')) {
define('PDF_TYPE_NULL', 0);
}
if (!defined('PDF_TYPE_NUMERIC')) {
define('PDF_TYPE_NUMERIC', 1);
}
if (!defined('PDF_TYPE_TOKEN')) {
define('PDF_TYPE_TOKEN', 2);
}
if (!defined('PDF_TYPE_HEX')) {
define('PDF_TYPE_HEX', 3);
}
if (!defined('PDF_TYPE_STRING')) {
define('PDF_TYPE_STRING', 4);
}
if (!defined('PDF_TYPE_DICTIONARY')) {
define('PDF_TYPE_DICTIONARY', 5);
}
if (!defined('PDF_TYPE_ARRAY')) {
define('PDF_TYPE_ARRAY', 6);
}
if (!defined('PDF_TYPE_OBJDEC')) {
define('PDF_TYPE_OBJDEC', 7);
}
if (!defined('PDF_TYPE_OBJREF')) {
define('PDF_TYPE_OBJREF', 8);
}
if (!defined('PDF_TYPE_OBJECT')) {
define('PDF_TYPE_OBJECT', 9);
}
if (!defined('PDF_TYPE_STREAM')) {
define('PDF_TYPE_STREAM', 10);
}
if (!defined('PDF_TYPE_BOOLEAN')) {
define('PDF_TYPE_BOOLEAN', 11);
}
if (!defined('PDF_TYPE_REAL')) {
define('PDF_TYPE_REAL', 12);
}
/**
* @class tcpdi_parser
* This is a PHP class for parsing PDF documents.
* Based on TCPDF_PARSER, part of the TCPDF project by Nicola Asuni.
* @brief This is a PHP class for parsing PDF documents..
* @version 1.1
* @author Paul Nicholls - github.com/pauln
* @author Nicola Asuni - info@tecnick.com
*/
class tcpdi_parser
{
/**
* Unique parser ID
* @public
*/
public $uniqueid = '';
/**
* Raw content of the PDF document.
* @private
*/
private $pdfdata = '';
/**
* XREF data.
* @protected
*/
protected $xref = array();
/**
* Object streams.
* @protected
*/
protected $objstreams = array();
/**
* Objects in objstreams.
* @protected
*/
protected $objstreamobjs = array();
/**
* List of seen XREF data locations.
* @protected
*/
protected $xref_seen_offsets = array();
/**
* Array of PDF objects.
* @protected
*/
protected $objects = array();
/**
* Array of object offsets.
* @private
*/
private $objoffsets = array();
/**
* Class object for decoding filters.
* @private
*/
private $FilterDecoders;
/**
* Pages
*
* @private array
*/
private $pages;
/**
* Page count
* @private integer
*/
private $page_count;
/**
* actual page number
* @private integer
*/
private $pageno;
/**
* PDF version of the loaded document
* @private string
*/
private $pdfVersion;
/**
* Available BoxTypes
*
* @public array
*/
public $availableBoxes = array('/MediaBox', '/CropBox', '/BleedBox', '/TrimBox', '/ArtBox');
// -----------------------------------------------------------------------------
/**
* Parse a PDF document an return an array of objects.
* @param $data (string) PDF data to parse.
* @public
* @since 1.0.000 (2011-05-24)
*/
public function __construct($data, $uniqueid)
{
if (empty($data)) {
$this->Error('Empty PDF data.');
}
$this->uniqueid = $uniqueid;
$this->pdfdata = $data;
// get length
$pdflen = strlen($this->pdfdata);
// initialize class for decoding filters
$this->FilterDecoders = new TCPDF_FILTERS();
// get xref and trailer data
$this->xref = $this->getXrefData();
$this->findObjectOffsets();
// parse all document objects
$this->objects = array();
/*foreach ($this->xref['xref'] as $obj => $offset) {
if (!isset($this->objects[$obj]) AND ($offset > 0)) {
// decode only objects with positive offset
//$this->objects[$obj] = $this->getIndirectObject($obj, $offset, true);
}
}*/
$this->getPDFVersion();
$this->readPages();
}
/**
* Clean up when done, to free memory etc
*/
public function cleanUp()
{
unset($this->pdfdata);
$this->pdfdata = '';
unset($this->objstreams);
$this->objstreams = array();
unset($this->objects);
$this->objects = array();
unset($this->objstreamobjs);
$this->objstreamobjs = array();
unset($this->xref);
$this->xref = array();
unset($this->objoffsets);
$this->objoffsets = array();
unset($this->pages);
$this->pages = array();
}
/**
* Return an array of parsed PDF document objects.
* @return (array) Array of parsed PDF document objects.
* @public
* @since 1.0.000 (2011-06-26)
*/
public function getParsedData()
{
return array($this->xref, $this->objects, $this->pages);
}
/**
* Get PDF-Version
*
* And reset the PDF Version used in FPDI if needed
* @public
*/
public function getPDFVersion()
{
preg_match('/\d\.\d/', substr($this->pdfdata, 0, 16), $m);
if (isset($m[0])) {
$this->pdfVersion = $m[0];
}
return $this->pdfVersion;
}
/**
* Read all /Page(es)
*
*/
public function readPages()
{
$params = $this->getObjectVal($this->xref['trailer'][1]['/Root']);
$objref = null;
foreach ($params[1][1] as $k => $v) {
if ($k == '/Pages') {
$objref = $v;
break;
}
}
if ($objref == null || $objref[0] !== PDF_TYPE_OBJREF) {
// Offset not found.
return;
}
$dict = $this->getObjectVal($objref);
if ($dict[0] == PDF_TYPE_OBJECT && $dict[1][0] == PDF_TYPE_DICTIONARY) {
// Dict wrapped in an object
$dict = $dict[1];
}
if ($dict[0] !== PDF_TYPE_DICTIONARY) {
return;
}
$this->pages = array();
if (isset($dict[1]['/Kids'])) {
$v = $dict[1]['/Kids'];
if ($v[0] == PDF_TYPE_ARRAY) {
foreach ($v[1] as $ref) {
$page = $this->getObjectVal($ref);
$this->readPage($page);
}
}
}
$this->page_count = count($this->pages);
}
/**
* Read a single /Page element, recursing through /Kids if necessary
*
*/
private function readPage($page)
{
if (isset($page[1][1]['/Kids'])) {
// Nested pages!
foreach ($page[1][1]['/Kids'][1] as $subref) {
$subpage = $this->getObjectVal($subref);
$this->readPage($subpage);
}
} else {
$this->pages[] = $page;
}
}
/**
* Get pagecount from sourcefile
*
* @return int
*/
public function getPageCount()
{
return $this->page_count;
}
/**
* Get Cross-Reference (xref) table and trailer data from PDF document data.
* @param $offset (int) xref offset (if know).
* @param $xref (array) previous xref array (if any).
* @return Array containing xref and trailer data.
* @protected
* @since 1.0.000 (2011-05-24)
*/
protected function getXrefData($offset = 0, $xref = array())
{
if ($offset == 0) {
// find last startxref
if (preg_match('/.*[\r\n]startxref[\s\r\n]+([0-9]+)[\s\r\n]+%%EOF/is', $this->pdfdata, $matches) == 0) {
$this->Error('Unable to find startxref');
}
$startxref = $matches[1];
} else {
if (preg_match('/([0-9]+[\s][0-9]+[\s]obj)/i', $this->pdfdata, $matches, PREG_OFFSET_CAPTURE, $offset)) {
// Cross-Reference Stream object
$startxref = $offset;
} elseif (preg_match('/[\r\n]startxref[\s\r\n]+([0-9]+)[\s\r\n]+%%EOF/i', $this->pdfdata, $matches, PREG_OFFSET_CAPTURE, $offset)) {
// startxref found
$startxref = $matches[1][0];
} else {
$this->Error('Unable to find startxref');
}
}
unset($matches);
// DOMPDF gets the startxref wrong, giving us the linebreak before the xref starts.
$startxref += strspn($this->pdfdata, "\r\n", $startxref);
// check xref position
if (strpos($this->pdfdata, 'xref', $startxref) == $startxref) {
// Cross-Reference
$xref = $this->decodeXref($startxref, $xref);
} else {
// Cross-Reference Stream
$xref = $this->decodeXrefStream($startxref, $xref);
}
if (empty($xref)) {
$this->Error('Unable to find xref');
}
return $xref;
}
/**
* Decode the Cross-Reference section
* @param $startxref (int) Offset at which the xref section starts.
* @param $xref (array) Previous xref array (if any).
* @return Array containing xref and trailer data.
* @protected
* @since 1.0.000 (2011-06-20)
*/
protected function decodeXref($startxref, $xref = array())
{
$this->xref_seen_offsets[] = $startxref;
if (!isset($xref['xref_location'])) {
$xref['xref_location'] = $startxref;
$xref['max_object'] = 0;
}
// extract xref data (object indexes and offsets)
$xoffset = $startxref + 5;
// initialize object number
$obj_num = 0;
$offset = $xoffset;
while (preg_match('/^([0-9]+)[\s]([0-9]+)[\s]?([nf]?)/im', $this->pdfdata, $matches, PREG_OFFSET_CAPTURE, $offset) > 0) {
$offset = (strlen($matches[0][0]) + $matches[0][1]);
if ($matches[3][0] == 'n') {
// create unique object index: [object number]_[generation number]
$gen_num = intval($matches[2][0]);
$index = $obj_num . '_' . $gen_num;
// check if object already exist
if (!isset($xref['xref'][$obj_num][$gen_num])) {
// store object offset position
$xref['xref'][$obj_num][$gen_num] = intval($matches[1][0]);
}
++$obj_num;
$offset += 2;
} elseif ($matches[3][0] == 'f') {
++$obj_num;
$offset += 2;
} else {
// object number (index)
$obj_num = intval($matches[1][0]);
}
}
unset($matches);
$xref['max_object'] = max($xref['max_object'], $obj_num);
// get trailer data
if (preg_match('/trailer[\s]*<<(.*)>>[\s\r\n]+(?:[%].*[\r\n]+)*startxref[\s\r\n]+/isU', $this->pdfdata, $matches, PREG_OFFSET_CAPTURE, $xoffset) > 0) {
$trailer_data = $matches[1][0];
if (!isset($xref['trailer']) or empty($xref['trailer'])) {
// get only the last updated version
$xref['trailer'] = array();
$xref['trailer'][0] = PDF_TYPE_DICTIONARY;
$xref['trailer'][1] = array();
// parse trailer_data
if (preg_match('/Size[\s]+([0-9]+)/i', $trailer_data, $matches) > 0) {
$xref['trailer'][1]['/Size'] = array(PDF_TYPE_NUMERIC, intval($matches[1]));
}
if (preg_match('/Root[\s]+([0-9]+)[\s]+([0-9]+)[\s]+R/i', $trailer_data, $matches) > 0) {
$xref['trailer'][1]['/Root'] = array(PDF_TYPE_OBJREF, intval($matches[1]), intval($matches[2]));
}
if (preg_match('/Encrypt[\s]+([0-9]+)[\s]+([0-9]+)[\s]+R/i', $trailer_data, $matches) > 0) {
$xref['trailer'][1]['/Encrypt'] = array(PDF_TYPE_OBJREF, intval($matches[1]), intval($matches[2]));
}
if (preg_match('/Info[\s]+([0-9]+)[\s]+([0-9]+)[\s]+R/i', $trailer_data, $matches) > 0) {
$xref['trailer'][1]['/Info'] = array(PDF_TYPE_OBJREF, intval($matches[1]), intval($matches[2]));
}
if (preg_match('/ID[\s]*[\[][\s]*[<]([^>]*)[>][\s]*[<]([^>]*)[>]/i', $trailer_data, $matches) > 0) {
$xref['trailer'][1]['/ID'] = array(PDF_TYPE_ARRAY, array());
$xref['trailer'][1]['/ID'][1][0] = array(PDF_TYPE_HEX, $matches[1]);
$xref['trailer'][1]['/ID'][1][1] = array(PDF_TYPE_HEX, $matches[2]);
}
}
if (preg_match('/Prev[\s]+([0-9]+)/i', $trailer_data, $matches) > 0) {
// get previous xref
$prevoffset = intval($matches[1]);
if (!in_array($prevoffset, $this->xref_seen_offsets)) {
$this->xref_seen_offsets[] = $prevoffset;
$xref = $this->getXrefData($prevoffset, $xref);
}
}
unset($matches);
} else {
$this->Error('Unable to find trailer');
}
return $xref;
}
/**
* Decode the Cross-Reference Stream section
* @param $startxref (int) Offset at which the xref section starts.
* @param $xref (array) Previous xref array (if any).
* @return Array containing xref and trailer data.
* @protected
* @since 1.0.003 (2013-03-16)
*/
protected function decodeXrefStream($startxref, $xref = array())
{
// try to read Cross-Reference Stream
list($xrefobj, $unused) = $this->getRawObject($startxref);
$xrefcrs = $this->getIndirectObject($xrefobj[1], $startxref, true);
if (!isset($xref['xref_location'])) {
$xref['xref_location'] = $startxref;
$xref['max_object'] = 0;
}
if (!isset($xref['xref'])) {
$xref['xref'] = array();
}
if (!isset($xref['trailer']) or empty($xref['trailer'])) {
// get only the last updated version
$xref['trailer'] = array();
$xref['trailer'][0] = PDF_TYPE_DICTIONARY;
$xref['trailer'][1] = array();
$filltrailer = true;
} else {
$filltrailer = false;
}
$valid_crs = false;
$sarr = $xrefcrs[0][1];
$keys = array_keys($sarr);
$columns = 1; // Default as per PDF 32000-1:2008.
$predictor = 1; // Default as per PDF 32000-1:2008.
foreach ($keys as $k => $key) {
$v = $sarr[$key];
if (($key == '/Type') and ($v[0] == PDF_TYPE_TOKEN and ($v[1] == 'XRef'))) {
$valid_crs = true;
} elseif (($key == '/Index') and ($v[0] == PDF_TYPE_ARRAY and count($v[1]) >= 2)) {
// first object number in the subsection
$index_first = intval($v[1][0][1]);
// number of entries in the subsection
$index_entries = intval($v[1][1][1]);
} elseif (($key == '/Prev') and ($v[0] == PDF_TYPE_NUMERIC)) {
// get previous xref offset
$prevxref = intval($v[1]);
} elseif (($key == '/W') and ($v[0] == PDF_TYPE_ARRAY)) {
// number of bytes (in the decoded stream) of the corresponding field
$wb = array();
$wb[0] = intval($v[1][0][1]);
$wb[1] = intval($v[1][1][1]);
$wb[2] = intval($v[1][2][1]);
} elseif (($key == '/DecodeParms') and ($v[0] == PDF_TYPE_DICTIONARY)) {
$decpar = $v[1];
foreach ($decpar as $kdc => $vdc) {
if (($kdc == '/Columns') and ($vdc[0] == PDF_TYPE_NUMERIC)) {
$columns = intval($vdc[1]);
} elseif (($kdc == '/Predictor') and ($vdc[0] == PDF_TYPE_NUMERIC)) {
$predictor = intval($vdc[1]);
}
}
} elseif ($filltrailer) {
switch ($key) {
case '/Size':
case '/Root':
case '/Info':
case '/ID':
$xref['trailer'][1][$key] = $v;
break;
default:
break;
}
}
}
// decode data
$obj_num = 0;
if ($valid_crs and isset($xrefcrs[1][3][0])) {
// number of bytes in a row
$rowlen = ($columns + 1);
// convert the stream into an array of integers
$sdata = unpack('C*', $xrefcrs[1][3][0]);
// split the rows
$sdata = array_chunk($sdata, $rowlen);
// initialize decoded array
$ddata = array();
// initialize first row with zeros
$prev_row = array_fill(0, $rowlen, 0);
// for each row apply PNG unpredictor
foreach ($sdata as $k => $row) {
// initialize new row
$ddata[$k] = array();
// get PNG predictor value
if (empty($predictor)) {
$predictor = (10 + $row[0]);
}
// for each byte on the row
for ($i = 1; $i <= $columns; ++$i) {
if (!isset($row[$i])) {
// No more data in this row - we're done here.
break;
}
// new index
$j = ($i - 1);
$row_up = $prev_row[$j];
if ($i == 1) {
$row_left = 0;
$row_upleft = 0;
} else {
$row_left = $row[($i - 1)];
$row_upleft = $prev_row[($j - 1)];
}
switch ($predictor) {
case 1: // No prediction (equivalent to PNG None)
case 10: { // PNG prediction (on encoding, PNG None on all rows)
$ddata[$k][$j] = $row[$i];
break;
}
case 11: { // PNG prediction (on encoding, PNG Sub on all rows)
$ddata[$k][$j] = (($row[$i] + $row_left) & 0xff);
break;
}
case 12: { // PNG prediction (on encoding, PNG Up on all rows)
$ddata[$k][$j] = (($row[$i] + $row_up) & 0xff);
break;
}
case 13: { // PNG prediction (on encoding, PNG Average on all rows)
$ddata[$k][$j] = (($row[$i] + (($row_left + $row_up) / 2)) & 0xff);
break;
}
case 14: { // PNG prediction (on encoding, PNG Paeth on all rows)
// initial estimate
$p = ($row_left + $row_up - $row_upleft);
// distances
$pa = abs($p - $row_left);
$pb = abs($p - $row_up);
$pc = abs($p - $row_upleft);
$pmin = min($pa, $pb, $pc);
// return minumum distance
switch ($pmin) {
case $pa: {
$ddata[$k][$j] = (($row[$i] + $row_left) & 0xff);
break;
}
case $pb: {
$ddata[$k][$j] = (($row[$i] + $row_up) & 0xff);
break;
}
case $pc: {
$ddata[$k][$j] = (($row[$i] + $row_upleft) & 0xff);
break;
}
}
break;
}
default: { // PNG prediction (on encoding, PNG optimum)
$this->Error("Unknown PNG predictor $predictor");
break;
}
}
}
$prev_row = $ddata[$k];
} // end for each row
// complete decoding
unset($sdata);
$sdata = array();
// for every row
foreach ($ddata as $k => $row) {
// initialize new row
$sdata[$k] = array(0, 0, 0);
if ($wb[0] == 0) {
// default type field
$sdata[$k][0] = 1;
}
$i = 0; // count bytes on the row
// for every column
for ($c = 0; $c < 3; ++$c) {
// for every byte on the column
for ($b = 0; $b < $wb[$c]; ++$b) {
if (isset($row[$i])) {
$sdata[$k][$c] += ($row[$i] << (($wb[$c] - 1 - $b) * 8));
}
++$i;
}
}
}
unset($ddata);
// fill xref
if (isset($index_first)) {
$obj_num = $index_first;
} else {
$obj_num = 0;
}
foreach ($sdata as $k => $row) {
switch ($row[0]) {
case 0: { // (f) linked list of free objects
++$obj_num;
break;
}
case 1: { // (n) objects that are in use but are not compressed
// create unique object index: [object number]_[generation number]
$index = $obj_num . '_' . $row[2];
// check if object already exist
if (!isset($xref['xref'][$obj_num][$row[2]])) {
// store object offset position
$xref['xref'][$obj_num][$row[2]] = $row[1];
}
++$obj_num;
break;
}
case 2: { // compressed objects
// $row[1] = object number of the object stream in which this object is stored
// $row[2] = index of this object within the object stream
/*$index = $row[1].'_0_'.$row[2];
$xref['xref'][$row[1]][0][$row[2]] = -1;*/
break;
}
default: { // null objects
break;
}
}
}
} // end decoding data
$xref['max_object'] = max($xref['max_object'], $obj_num);
if (isset($prevxref)) {
// get previous xref
$xref = $this->getXrefData($prevxref, $xref);
}
return $xref;
}
/**
* Get raw stream data
* @param $offset (int) Stream offset.
* @param $length (int) Stream length.
* @return string Steam content
* @protected
*/
protected function getRawStream($offset, $length)
{
$offset += strspn($this->pdfdata, "\x00\x09\x0a\x0c\x0d\x20", $offset);
$offset += 6; // "stream"
$offset += strspn($this->pdfdata, "\x20", $offset);
$offset += strspn($this->pdfdata, "\r\n", $offset);
$obj = array();
$obj[] = PDF_TYPE_STREAM;
$obj[] = substr($this->pdfdata, $offset, $length);
return array($obj, $offset + $length);
}
/**
* Get object type, raw value and offset to next object
* @param $offset (int) Object offset.
* @return array containing object type, raw value and offset to next object
* @protected
* @since 1.0.000 (2011-06-20)
*/
protected function getRawObject($offset = 0, $data = null)
{
if ($data == null) {
$data = & $this->pdfdata;
}
$objtype = ''; // object type to be returned
$objval = ''; // object value to be returned
// skip initial white space chars: \x00 null (NUL), \x09 horizontal tab (HT), \x0A line feed (LF), \x0C form feed (FF), \x0D carriage return (CR), \x20 space (SP)
while (strspn($data[$offset], "\x00\x09\x0a\x0c\x0d\x20") == 1) {
$offset++;
}
// get first char
$char = $data[$offset];
// get object type
switch ($char) {
case '%': { // \x25 PERCENT SIGN
// skip comment and search for next token
$next = strcspn($data, "\r\n", $offset);
if ($next > 0) {
$offset += $next;
list($obj, $unused) = $this->getRawObject($offset, $data);
return $obj;
}
break;
}
case '/': { // \x2F SOLIDUS
// name object
$objtype = PDF_TYPE_TOKEN;
++$offset;
$length = strcspn($data, "\x00\x09\x0a\x0c\x0d\x20\x28\x29\x3c\x3e\x5b\x5d\x7b\x7d\x2f\x25", $offset);
$objval = substr($data, $offset, $length);
$offset += $length;
break;
}
case '(': // \x28 LEFT PARENTHESIS
case ')': { // \x29 RIGHT PARENTHESIS
// literal string object
$objtype = PDF_TYPE_STRING;
++$offset;
$strpos = $offset;
if ($char == '(') {
$open_bracket = 1;
while ($open_bracket > 0) {
if (!isset($data[$strpos])) {
break;
}
$ch = $data[$strpos];
switch ($ch) {
case '\\': { // REVERSE SOLIDUS (5Ch) (Backslash)
// skip next character
++$strpos;
break;
}
case '(': { // LEFT PARENHESIS (28h)
++$open_bracket;
break;
}
case ')': { // RIGHT PARENTHESIS (29h)
--$open_bracket;
break;
}
}
++$strpos;
}
$objval = substr($data, $offset, ($strpos - $offset - 1));
$offset = $strpos;
}
break;
}
case '[': // \x5B LEFT SQUARE BRACKET
case ']': { // \x5D RIGHT SQUARE BRACKET
// array object
$objtype = PDF_TYPE_ARRAY;
++$offset;
if ($char == '[') {
// get array content
$objval = array();
do {
// get element
list($element, $offset) = $this->getRawObject($offset, $data);
$objval[] = $element;
} while ($element[0] !== ']');
// remove closing delimiter
array_pop($objval);
} else {
$objtype = ']';
}
break;
}
case '<': // \x3C LESS-THAN SIGN
case '>': { // \x3E GREATER-THAN SIGN
if (isset($data[($offset + 1)]) and ($data[($offset + 1)] == $char)) {
// dictionary object
$objtype = PDF_TYPE_DICTIONARY;
if ($char == '<') {
list($objval, $offset) = $this->getDictValue($offset, $data);
} else {
$objtype = '>>';
$offset += 2;
}
} else {
// hexadecimal string object
$objtype = PDF_TYPE_HEX;
++$offset;
// The "Panose" entry in the FontDescriptor Style dict seems to have hex bytes separated by spaces.
if (($char == '<') and (preg_match('/^([0-9A-Fa-f ]+)[>]/iU', substr($data, $offset), $matches) == 1)) {
$objval = $matches[1];
$offset += strlen($matches[0]);
unset($matches);
}
}
break;
}
default: {
$frag = $data[$offset] . @$data[$offset + 1] . @$data[$offset + 2] . @$data[$offset + 3];
switch ($frag) {
case 'endo':
// indirect object
$objtype = 'endobj';
$offset += 6;
break;
case 'stre':
// Streams should always be indirect objects, and thus processed by getRawStream().
// If we get here, treat it as a null object as something has gone wrong.
case 'null':
// null object
$objtype = PDF_TYPE_NULL;
$offset += 4;
$objval = 'null';
break;
case 'true':
// boolean true object
$objtype = PDF_TYPE_BOOLEAN;
$offset += 4;
$objval = true;
break;
case 'fals':
// boolean false object
$objtype = PDF_TYPE_BOOLEAN;
$offset += 5;
$objval = false;
break;
case 'ends':
// end stream object
$objtype = 'endstream';
$offset += 9;
break;
default:
if (preg_match('/^([0-9]+)[\s]+([0-9]+)[\s]+([Robj]{1,3})/i', substr($data, $offset, 33), $matches) == 1) {
if ($matches[3] == 'R') {
// indirect object reference
$objtype = PDF_TYPE_OBJREF;
$offset += strlen($matches[0]);
$objval = array(intval($matches[1]), intval($matches[2]));
} elseif ($matches[3] == 'obj') {
// object start
$objtype = PDF_TYPE_OBJECT;
$objval = intval($matches[1]) . '_' . intval($matches[2]);
$offset += strlen($matches[0]);
}
} elseif (($numlen = strspn($data, '+-.0123456789', $offset)) > 0) {
// numeric object
$objval = substr($data, $offset, $numlen);
$objtype = (intval($objval) != $objval) ? PDF_TYPE_REAL : PDF_TYPE_NUMERIC;
$offset += $numlen;
}
unset($matches);
break;
}
break;
}
}
$obj = array();
$obj[] = $objtype;
if ($objtype == PDF_TYPE_OBJREF && is_array($objval)) {
foreach ($objval as $val) {
$obj[] = $val;
}
} else {
$obj[] = $objval;
}
return array($obj, $offset);
}
private function getDictValue($offset, &$data)
{
$objval = array();
// Extract dict from data.
$i = 1;
$dict = '';
$offset += 2;
do {
if ($data[$offset] == '>' && $data[$offset + 1] == '>') {
$i--;
$dict .= '>>';
$offset += 2;
} elseif ($data[$offset] == '<' && $data[$offset + 1] == '<') {
$i++;
$dict .= '<<';
$offset += 2;
} else {
$dict .= $data[$offset];
$offset++;
}
} while ($i > 0);
// Now that we have just the dict, parse it.
$dictoffset = 0;
do {
// Get dict element.
list($key, $eloffset) = $this->getRawObject($dictoffset, $dict);
if ($key[0] == '>>') {
break;
}
list($element, $dictoffset) = $this->getRawObject($eloffset, $dict);
$objval['/' . $key[1]] = $element;
unset($key);
unset($element);
} while (true);
return array($objval, $offset);
}
/**
* Get content of indirect object.
* @param $obj_ref (string) Object number and generation number separated by underscore character.
* @param $offset (int) Object offset.
* @param $decoding (boolean) If true decode streams.
* @return array containing object data.
* @protected
* @since 1.0.000 (2011-05-24)
*/
protected function getIndirectObject($obj_ref, $offset = 0, $decoding = true)
{
$obj = explode('_', $obj_ref);
if (($obj === false) or (count($obj) != 2)) {
$this->Error('Invalid object reference: ' . $obj);
return;
}
$objref = $obj[0] . ' ' . $obj[1] . ' obj';
if (strpos($this->pdfdata, $objref, $offset) != $offset) {
// an indirect reference to an undefined object shall be considered a reference to the null object
return array('null', 'null', $offset);
}
// starting position of object content
$offset += strlen($objref);
// get array of object content
$objdata = array();
$i = 0; // object main index
do {
if (($i > 0) and (isset($objdata[($i - 1)][0])) and ($objdata[($i - 1)][0] == PDF_TYPE_DICTIONARY) and array_key_exists('/Length', $objdata[($i - 1)][1])) {
// Stream - get using /Length in stream's dict
$lengthobj = $objdata[($i - 1)][1]['/Length'];
if ($lengthobj[0] === PDF_TYPE_OBJREF) {
$lengthobj = $this->getObjectVal($lengthobj);
if ($lengthobj[0] === PDF_TYPE_OBJECT) {
$lengthobj = $lengthobj[1];
}
}
$streamlength = $lengthobj[1];
list($element, $offset) = $this->getRawStream($offset, $streamlength);
} else {
// get element
list($element, $offset) = $this->getRawObject($offset);
}
// decode stream using stream's dictionary information
if ($decoding and ($element[0] == PDF_TYPE_STREAM) and (isset($objdata[($i - 1)][0])) and ($objdata[($i - 1)][0] == PDF_TYPE_DICTIONARY)) {
$element[3] = $this->decodeStream($objdata[($i - 1)][1], $element[1]);
}
$objdata[$i] = $element;
++$i;
} while ($element[0] != 'endobj');
// remove closing delimiter
array_pop($objdata);
// return raw object content
return $objdata;
}
/**
* Get the content of object, resolving indect object reference if necessary.
* @param $obj (string) Object value.
* @return array containing object data.
* @public
* @since 1.0.000 (2011-06-26)
*/
public function getObjectVal($obj)
{
if ($obj[0] == PDF_TYPE_OBJREF) {
if (strpos($obj[1], '_') !== false) {
$key = explode('_', $obj[1]);
} else {
$key = array($obj[1], $obj[2]);
}
$ret = array(0 => PDF_TYPE_OBJECT, 'obj' => $key[0], 'gen' => $key[1]);
// reference to indirect object
$object = null;
if (isset($this->objects[$key[0]][$key[1]])) {
// this object has been already parsed
$object = $this->objects[$key[0]][$key[1]];
} elseif (($offset = $this->findObjectOffset($key)) !== false) {
// parse new object
$this->objects[$key[0]][$key[1]] = $this->getIndirectObject($key[0] . '_' . $key[1], $offset, false);
$object = $this->objects[$key[0]][$key[1]];
} elseif (($key[1] == 0) && isset($this->objstreamobjs[$key[0]])) {
// Object is in an object stream
$streaminfo = $this->objstreamobjs[$key[0]];
$objs = $streaminfo[0];
if (!isset($this->objstreams[$objs[0]][$objs[1]])) {
// Fetch and decode object stream
$offset = $this->findObjectOffset($objs);
;
$objstream = $this->getObjectVal(array(PDF_TYPE_OBJREF, $objs[0], $objs[1]));
$decoded = $this->decodeStream($objstream[1][1], $objstream[2][1]);
$this->objstreams[$objs[0]][$objs[1]] = $decoded[0]; // Store just the data, in case we need more from this objstream
// Free memory
unset($objstream);
unset($decoded);
}
$this->objects[$key[0]][$key[1]] = $this->getRawObject($streaminfo[1], $this->objstreams[$objs[0]][$objs[1]]);
$object = $this->objects[$key[0]][$key[1]];
}
if (!is_null($object)) {
$ret[1] = $object[0];
if (isset($object[1][0]) && $object[1][0] == PDF_TYPE_STREAM) {
$ret[0] = PDF_TYPE_STREAM;
$ret[2] = $object[1];
}
return $ret;
}
}
return $obj;
}
/**
* Extract object stream to find out what it contains.
*
*/
public function extractObjectStream($key)
{
$objref = array(PDF_TYPE_OBJREF, $key[0], $key[1]);
$obj = $this->getObjectVal($objref);
if ($obj[0] !== PDF_TYPE_STREAM || !isset($obj[1][1]['/First'][1])) {
// Not a valid object stream dictionary - skip it.
return;
}
$stream = $this->decodeStream($obj[1][1], $obj[2][1]);// Decode object stream, as we need the first bit
$first = intval($obj[1][1]['/First'][1]);
$ints = preg_split('/\s/', substr($stream[0], 0, $first)); // Get list of object / offset pairs
for ($j = 1; $j < count($ints); $j++) {
if (($j % 2) == 1) {
$this->objstreamobjs[$ints[$j - 1]] = array($key, $ints[$j] + $first);
}
}
// Free memory - we may not need this at all.
unset($obj);
unset($stream);
}
/**
* Find all object offsets. Saves having to scour the file multiple times.
* @private
*/
private function findObjectOffsets()
{
$this->objoffsets = array();
if (preg_match_all('/(*ANYCRLF)^[\s]*([0-9]+)[\s]+([0-9]+)[\s]+obj/im', $this->pdfdata, $matches, PREG_OFFSET_CAPTURE) >= 1) {
$i = 0;
$laststreamend = 0;
foreach ($matches[0] as $match) {
$offset = $match[1] + strspn($match[0], "\x00\x09\x0a\x0c\x0d\x20");
if ($offset < $laststreamend) {
// Contained within another stream, skip it.
continue;
}
$this->objoffsets[trim($match[0])] = $offset;
$dictoffset = $match[1] + strlen($match[0]);
$dictfrag = substr($this->pdfdata, $dictoffset, 256);
if (preg_match('|^\s+<<[^>]+/Length\s+(\d+)|', $dictfrag, $lengthmatch, PREG_OFFSET_CAPTURE) == 1) {
$laststreamend += intval($lengthmatch[1][0]);
}
if (preg_match('|^\s+<<[^>]+/ObjStm|', $dictfrag, $objstm) == 1) {
$this->extractObjectStream(array($matches[1][$i][0], $matches[2][$i][0]));
}
$i++;
}
}
unset($lengthmatch);
unset($dictfrag);
unset($matches);
}
/**
* Get offset of an object. Checks xref first, then offsets found by scouring the file.
* @param $key (array) Object key to find (obj, gen).
* @return int Offset of the object in $this->pdfdata.
* @private
*/
private function findObjectOffset($key)
{
$objref = $key[0] . ' ' . $key[1] . ' obj';
if (isset($this->xref['xref'][$key[0]][$key[1]])) {
$offset = $this->xref['xref'][$key[0]][$key[1]];
if (strpos($this->pdfdata, $objref, $offset) === $offset) {
// Offset is in xref table and matches actual position in file
//echo "Offset in XREF is correct, returning
";
return $this->xref['xref'][$key[0]][$key[1]];
}
}
if (array_key_exists($objref, $this->objoffsets)) {
//echo "Offset found in internal reftable
";
return $this->objoffsets[$objref];
}
return false;
}
/**
* Decode the specified stream.
* @param $sdic (array) Stream's dictionary array.
* @param $stream (string) Stream to decode.
* @return array containing decoded stream data and remaining filters.
* @protected
* @since 1.0.000 (2011-06-22)
*/
protected function decodeStream($sdic, $stream)
{
// get stream lenght and filters
$slength = strlen($stream);
if ($slength <= 0) {
return array('', array());
}
$filters = array();
foreach ($sdic as $k => $v) {
if ($v[0] == PDF_TYPE_TOKEN) {
if (($k == '/Length') and ($v[0] == PDF_TYPE_NUMERIC)) {
// get declared stream lenght
$declength = intval($v[1]);
if ($declength < $slength) {
$stream = substr($stream, 0, $declength);
$slength = $declength;
}
} elseif ($k == '/Filter') {
if ($v[0] == PDF_TYPE_TOKEN) {
// single filter
$filters[] = $v[1];
} elseif ($v[0] == PDF_TYPE_ARRAY) {
// array of filters
foreach ($v[1] as $flt) {
if ($flt[0] == PDF_TYPE_TOKEN) {
$filters[] = $flt[1];
}
}
}
}
}
}
// decode the stream
$remaining_filters = array();
foreach ($filters as $filter) {
if (in_array($filter, $this->FilterDecoders->getAvailableFilters())) {
$stream = $this->FilterDecoders->decodeFilter($filter, $stream);
} else {
// add missing filter to array
$remaining_filters[] = $filter;
}
}
return array($stream, $remaining_filters);
}
/**
* Set pageno
*
* @param int $pageno Pagenumber to use
*/
public function setPageno($pageno)
{
$pageno = ((int) $pageno) - 1;
if ($pageno < 0 || $pageno >= $this->getPageCount()) {
$this->error("Pagenumber is wrong! (Requested $pageno, max " . $this->getPageCount() . ")");
}
$this->pageno = $pageno;
}
/**
* Get page-resources from current page
*
* @return array
*/
public function getPageResources()
{
return $this->_getPageResources($this->pages[$this->pageno]);
}
/**
* Get page-resources from /Page
*
* @param array $obj Array of pdf-data
*/
private function _getPageResources($obj) // $obj = /Page
{
$obj = $this->getObjectVal($obj);
// If the current object has a resources
// dictionary associated with it, we use
// it. Otherwise, we move back to its
// parent object.
if (isset($obj[1][1]['/Resources'])) {
$res = $obj[1][1]['/Resources'];
if ($res[0] == PDF_TYPE_OBJECT) {
return $res[1];
}
return $res;
} else {
if (!isset($obj[1][1]['/Parent'])) {
return false;
} else {
$res = $this->_getPageResources($obj[1][1]['/Parent']);
if ($res[0] == PDF_TYPE_OBJECT) {
return $res[1];
}
return $res;
}
}
}
/**
* Get annotations from current page
*
* @return array
*/
public function getPageAnnotations()
{
return $this->_getPageAnnotations($this->pages[$this->pageno]);
}
/**
* Get annotations from /Page
*
* @param array $obj Array of pdf-data
*/
private function _getPageAnnotations($obj) // $obj = /Page
{
$obj = $this->getObjectVal($obj);
// If the current object has an annotations
// dictionary associated with it, we use
// it. Otherwise, we move back to its
// parent object.
if (isset($obj[1][1]['/Annots'])) {
$annots = $obj[1][1]['/Annots'];
} else {
if (!isset($obj[1][1]['/Parent'])) {
return false;
} else {
$annots = $this->_getPageAnnotations($obj[1][1]['/Parent']);
}
}
if ($annots[0] == PDF_TYPE_OBJREF) {
return $this->getObjectVal($annots);
}
return $annots;
}
/**
* Get content of current page
*
* If more /Contents is an array, the streams are concated
*
* @return string
*/
public function getContent()
{
$buffer = '';
if (isset($this->pages[$this->pageno][1][1]['/Contents'])) {
$contents = $this->_getPageContent($this->pages[$this->pageno][1][1]['/Contents']);
foreach ($contents as $tmp_content) {
$buffer .= $this->_rebuildContentStream($tmp_content) . ' ';
}
}
return $buffer;
}
/**
* Resolve all content-objects
*
* @param array $content_ref
* @return array
*/
private function _getPageContent($content_ref)
{
$contents = array();
if ($content_ref[0] == PDF_TYPE_OBJREF) {
$content = $this->getObjectVal($content_ref);
if ($content[1][0] == PDF_TYPE_ARRAY) {
$contents = $this->_getPageContent($content[1]);
} else {
$contents[] = $content;
}
} elseif ($content_ref[0] == PDF_TYPE_ARRAY) {
foreach ($content_ref[1] as $tmp_content_ref) {
$contents = array_merge($contents, $this->_getPageContent($tmp_content_ref));
}
}
return $contents;
}
/**
* Rebuild content-streams
*
* @param array $obj
* @return string
*/
private function _rebuildContentStream($obj)
{
$filters = array();
if (isset($obj[1][1]['/Filter'])) {
$_filter = $obj[1][1]['/Filter'];
if ($_filter[0] == PDF_TYPE_OBJREF) {
$tmpFilter = $this->getObjectVal($_filter);
$_filter = $tmpFilter[1];
}
if ($_filter[0] == PDF_TYPE_TOKEN) {
$filters[] = $_filter;
} elseif ($_filter[0] == PDF_TYPE_ARRAY) {
$filters = $_filter[1];
}
}
$stream = $obj[2][1];
foreach ($filters as $_filter) {
$stream = $this->FilterDecoders->decodeFilter($_filter[1], $stream);
}
return $stream;
}
/**
* Get a Box from a page
* Arrayformat is same as used by fpdf_tpl
*
* @param array $page a /Page
* @param string $box_index Type of Box @see $availableBoxes
* @param float Scale factor from user space units to points
* @return array
*/
public function getPageBox($page, $box_index, $k)
{
$page = $this->getObjectVal($page);
$box = null;
if (isset($page[1][1][$box_index])) {
$box = & $page[1][1][$box_index];
}
if (!is_null($box) && $box[0] == PDF_TYPE_OBJREF) {
$tmp_box = $this->getObjectVal($box);
$box = $tmp_box[1];
}
if (!is_null($box) && $box[0] == PDF_TYPE_ARRAY) {
$b = & $box[1];
return array('x' => $b[0][1] / $k,
'y' => $b[1][1] / $k,
'w' => abs($b[0][1] - $b[2][1]) / $k,
'h' => abs($b[1][1] - $b[3][1]) / $k,
'llx' => min($b[0][1], $b[2][1]) / $k,
'lly' => min($b[1][1], $b[3][1]) / $k,
'urx' => max($b[0][1], $b[2][1]) / $k,
'ury' => max($b[1][1], $b[3][1]) / $k,
);
} elseif (!isset($page[1][1]['/Parent'])) {
return false;
} else {
return $this->getPageBox($this->getObjectVal($page[1][1]['/Parent']), $box_index, $k);
}
}
/**
* Get all page boxes by page no
*
* @param int The page number
* @param float Scale factor from user space units to points
* @return array
*/
public function getPageBoxes($pageno, $k)
{
return $this->_getPageBoxes($this->pages[$pageno - 1], $k);
}
/**
* Get all boxes from /Page
*
* @param array a /Page
* @return array
*/
private function _getPageBoxes($page, $k)
{
$boxes = array();
foreach ($this->availableBoxes as $box) {
if ($_box = $this->getPageBox($page, $box, $k)) {
$boxes[$box] = $_box;
}
}
return $boxes;
}
/**
* Get the page rotation by pageno
*
* @param integer $pageno
* @return array
*/
public function getPageRotation($pageno)
{
return $this->_getPageRotation($this->pages[$pageno - 1]);
}
private function _getPageRotation($obj) // $obj = /Page
{
$obj = $this->getObjectVal($obj);
if (isset($obj[1][1]['/Rotate'])) {
$res = $this->getObjectVal($obj[1][1]['/Rotate']);
if ($res[0] == PDF_TYPE_OBJECT) {
return $res[1];
}
return $res;
} else {
if (!isset($obj[1][1]['/Parent'])) {
return false;
} else {
$res = $this->_getPageRotation($obj[1][1]['/Parent']);
if (is_array($res) && $res[0] == PDF_TYPE_OBJECT) {
return $res[1];
}
return $res;
}
}
}
/**
* This method is automatically called in case of fatal error; it simply outputs the message and halts the execution.
* @param $msg (string) The error message
* @public
* @since 1.0.000 (2011-05-23)
*/
public function Error($msg)
{
// exit program and print error
die("TCPDI_PARSER ERROR [{$this->uniqueid}]: " . $msg);
}
} // END OF TCPDF_PARSER CLASS
icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/karriere/pdf-merge/tests/ 0000775 0000000 0000000 00000000000 15112050317 0026123 5 ustar 00root root 0000000 0000000 icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/karriere/pdf-merge/tests/PdfMergeTest.php 0000664 0000000 0000000 00000006323 15112050317 0031171 0 ustar 00root root 0000000 0000000 pdfMerge = new PdfMerge();
$this->dummyFile = __DIR__ . '/files/dummy.pdf';
$this->outputFile = __DIR__ . '/output.pdf';
});
it('returns PDF instance', function () {
expect($this->pdfMerge)->getPdf()->toBeInstanceOf(TCPDI::class);
});
it('throws exception when trying to add not existing page', function () {
($this->pdfMerge)->add('/foo.pdf');
})->throws(FileNotFoundException::class);
it('checks if file was already added', function () {
expect($this->pdfMerge)->contains($this->dummyFile)->toBeFalse();
$this->pdfMerge->add($this->dummyFile);
expect($this->pdfMerge)->contains($this->dummyFile)->toBeTrue();
});
it('resets files to merge', function () {
$this->pdfMerge->add($this->dummyFile);
$this->pdfMerge->reset();
expect($this->pdfMerge)->contains($this->dummyFile)->toBeFalse();
});
it('generates merged file', function () {
$this->pdfMerge->add($this->dummyFile);
$this->pdfMerge->add($this->dummyFile);
expect($this->pdfMerge)->merge($this->outputFile)->toBeEmptyString();
expect($this->outputFile)->toEqualPDF(__DIR__ . '/files/expected/output.pdf');
});
it('merges portrait and landscape files', function () {
$this->pdfMerge->add($this->dummyFile);
$this->pdfMerge->add(__DIR__ . '/files/dummy_landscape.pdf');
expect($this->pdfMerge)->merge($this->outputFile)->toBeEmptyString();
expect($this->outputFile)->toEqualPDF(__DIR__ . '/files/expected/output_mixed_orientation.pdf');
});
it('adds header to merged PDF', function () {
copy(__DIR__ . '/files/header_logo.jpg', K_PATH_IMAGES . 'header_logo.png');
$pdfMerge = new PdfMerge(new HeaderConfig(imagePath: 'header_logo.png', logoWidthMM: 20, title: 'Test'));
$pdfMerge->add($this->dummyFile);
$pdfMerge->add($this->dummyFile);
expect($pdfMerge)->merge($this->outputFile)->toBeEmptyString();
expect($this->outputFile)->toEqualPDF(__DIR__ . '/files/expected/output_with_header.pdf');
});
it('adds full header and full footer to merged PDF', function () {
copy(__DIR__ . '/files/header_logo.jpg', K_PATH_IMAGES . 'header_logo.png');
$pdfMerge = new PdfMerge(
new HeaderConfig(
imagePath: 'header_logo.png',
logoWidthMM: 20,
title: 'Header',
text: 'This is a header text',
textColor: new RGB(200, 200, 200),
lineColor: new RGB(0, 0, 255),
),
new FooterConfig(
textColor: new RGB(100, 100, 100),
lineColor: new RGB(255, 0, 0),
margin: 20,
),
);
$pdfMerge->add($this->dummyFile);
$pdfMerge->add($this->dummyFile);
expect($pdfMerge)->merge($this->outputFile)->toBeEmptyString();
expect($this->outputFile)->toEqualPDF(__DIR__ . '/files/expected/output_with_header_and_footer.pdf');
});
it('throws exception when no files were added', function () {
$this->pdfMerge->merge('/foo.pdf');
})->throws(NoFilesDefinedException::class);
icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/karriere/pdf-merge/tests/Pest.php 0000664 0000000 0000000 00000001251 15112050317 0027546 0 ustar 00root root 0000000 0000000 extend('toEqualPDF', function (string $expected) {
if (filesize($expected) !== filesize($this->value)) {
throw new Exception('The file size of the PDF does not equal the file size from the expected output.');
}
$pdf = new TCPDI();
$expectedPageCount = $pdf->setSourceFile($expected);
$actualPageCount = $pdf->setSourceFile($this->value);
if ($expectedPageCount !== $actualPageCount) {
throw new Exception('The page count of the PDF does not equal the page count from the expected output.');
}
return $this;
});
expect()->extend('toBeEmptyString', function () {
return expect($this->value)->toEqual('');
});
icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/karriere/pdf-merge/tests/files/ 0000775 0000000 0000000 00000000000 15112050317 0027225 5 ustar 00root root 0000000 0000000 icingaweb2-module-pdfexport-0.12.0+dfsg/vendor/karriere/pdf-merge/tests/files/dummy.pdf 0000664 0000000 0000000 00000037663 15112050317 0031072 0 ustar 00root root 0000000 0000000 %PDF-1.3
%
4 0 obj
<< /Length 5 0 R /Filter /FlateDecode >>
stream
xj&j옇75nQ܈KSRpY?ݏ?O۟^~LWWc?[ѽ~sxqenˣ/w//⾺?%?Ęy'{?ѓ=tvMiӔ/~>/x7_oeݽg𖢡GX/\R螭34r;4RKһX
"\"/Ie*v`,#
n{2=t%VW*H%N㶑t:
Dɯ tGjDz[DdaF*BLnR=%z)oޅ:'0IgM\ w unsk'YAF}tç^g=E
y4j"[AE7
";y4z~
!(xY'[rg 3X"9zG5aN8*OI\cZg %0QohL'5ovhÀMqeqa@oQ.Ea
'ז!!~}6$g du[tXR"oRV
8kaMqjSA!YHPj kt!3bY|f2S+)JQR5:DF\t-{7瀯2X6W0H+Ƅ{Q@hbgoJqD^;AZBBg;p^NfNEBWH= rl")Ltcb
L P
JHRiE[!ZZ*`9qpF,h@=,E61O!Xº/"L[ڕuSI8!o0$*B\SORok2Q/XSHUH$.m^G"O}"nG$Ts 0Ԉ\-k0&=-$=\'V_
h
9Qu1Rfq23 Y"8ƅa^\UMcYUl@0pFVMExF[TxDJ&7 x+P ˅x8hzP?;S_6Ӆ&m
'ŨD]+{PXn)fxeZ*Yr S냙BTm" DE.e+@F:S0DkQP֙%1[PxglTbR'7G9|W79PA
kbRB ZrKț*"84Bx>F^^9r%\Vq:CPFcA!RJضڛxD5
LAsru279Zs!NM?v=DB_ /ΨkNP:Q`b*@|mjHA zC)ɣGzP)(FT9Û2˅B@p