uawdijnntqw1x1x1
IP : 216.73.216.8
Hostname : toronto-dev2
Kernel : Linux toronto-dev2 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
srv
/
users
/
craft4
/
apps
/
craft4-newsite-space
/
vendor
/
iio
/
libmergepdf
/
src
/
Driver
/
.
/
TcpdiDriver.php
/
/
<?php declare(strict_types = 1); namespace iio\libmergepdf\Driver; use iio\libmergepdf\Exception; use iio\libmergepdf\Source\SourceInterface; final class TcpdiDriver implements DriverInterface { /** * @var \TCPDI */ private $tcpdi; public function __construct(\TCPDI $tcpdi = null) { $this->tcpdi = $tcpdi ?: new \TCPDI; } public function merge(SourceInterface ...$sources): string { $sourceName = ''; try { $tcpdi = clone $this->tcpdi; foreach ($sources as $source) { $sourceName = $source->getName(); $pageCount = $tcpdi->setSourceData($source->getContents()); $pageNumbers = $source->getPages()->getPageNumbers() ?: range(1, $pageCount); foreach ($pageNumbers as $pageNr) { $template = $tcpdi->importPage($pageNr); $size = $tcpdi->getTemplateSize($template); $tcpdi->SetPrintHeader(false); $tcpdi->SetPrintFooter(false); $tcpdi->AddPage( $size['w'] > $size['h'] ? 'L' : 'P', [$size['w'], $size['h']] ); $tcpdi->useTemplate($template); } } return $tcpdi->Output('', 'S'); } catch (\Exception $e) { throw new Exception("'{$e->getMessage()}' in '$sourceName'", 0, $e); } } }
/srv/users/craft4/apps/craft4-newsite-space/vendor/iio/libmergepdf/src/Driver/./TcpdiDriver.php