TypeError
Argument 2 passed to ProjectPdfContent::getPdfProjectPage() must be an instance of Page, bool given, called in /var/www/vhosts/e-plus.at/httpdocs/site/plugins/PdfGenerator/ProjectPdfContent.php on line 13 TypeError thrown with message "Argument 2 passed to ProjectPdfContent::getPdfProjectPage() must be an instance of Page, bool given, called in /var/www/vhosts/e-plus.at/httpdocs/site/plugins/PdfGenerator/ProjectPdfContent.php on line 13" Stacktrace: #6 TypeError in /var/www/vhosts/e-plus.at/httpdocs/site/plugins/PdfGenerator/ProjectPdfContent.php:16 #5 ProjectPdfContent:getPdfProjectPage in /var/www/vhosts/e-plus.at/httpdocs/site/plugins/PdfGenerator/ProjectPdfContent.php:13 #4 ProjectPdfContent:getProjectContentPdf in /var/www/vhosts/e-plus.at/httpdocs/site/plugins/PdfGenerator/PdfGenerator.php:20 #3 createProjectPdf in /var/www/vhosts/e-plus.at/httpdocs/site/config/config.php:42 #2 Kirby:{closure} in /var/www/vhosts/e-plus.at/httpdocs/kirby/vendor/getkirby/toolkit/helpers.php:282 #1 call in /var/www/vhosts/e-plus.at/httpdocs/kirby/kirby.php:743 #0 Kirby:launch in /var/www/vhosts/e-plus.at/httpdocs/index.php:16
Stack frames (7)
6
TypeError
/
var
/
www
/
vhosts
/
e-plus.at
/
httpdocs
/
site
/
plugins
/
PdfGenerator
/
ProjectPdfContent.php
16
5
ProjectPdfContent
getPdfProjectPage
/
var
/
www
/
vhosts
/
e-plus.at
/
httpdocs
/
site
/
plugins
/
PdfGenerator
/
ProjectPdfContent.php
13
4
ProjectPdfContent
getProjectContentPdf
/
var
/
www
/
vhosts
/
e-plus.at
/
httpdocs
/
site
/
plugins
/
PdfGenerator
/
PdfGenerator.php
20
3
createProjectPdf
/
var
/
www
/
vhosts
/
e-plus.at
/
httpdocs
/
site
/
config
/
config.php
42
2
Kirby
{closure}
/
vendor
/
getkirby
/
toolkit
/
helpers.php
282
1
call
/
kirby.php
743
0
Kirby
launch
/
var
/
www
/
vhosts
/
e-plus.at
/
httpdocs
/
index.php
16
/
var
/
www
/
vhosts
/
e-plus.at
/
httpdocs
/
site
/
plugins
/
PdfGenerator
/
ProjectPdfContent.php
<?php
 
class ProjectPdfContent
{
    public function getProjectContentPdf(TCPDF $pdf, $id)
    {
        $project_page = page($id);
 
        $pdf_configurator = new DefaultPdfConfigurator;
        $pdf_configurator->formatPdf($pdf);
 
        $pdf->setPrintFooter(true);
        $this->getPdfProjectPage($pdf, $project_page);
    }
 
    private function getPdfProjectPage(TCPDF $pdf, page $project_page)
    {
        $logo = $_SERVER['DOCUMENT_ROOT'] . '/assets/images/logo.png'; // ration 3,2238
        $teaser = thumb($project_page->image($project_page->teaser_image()), ['width' => 1400, 'height' => 700, 'crop' => true])->root();
 
        // get infos about the project
        $project_data = $this->getProjectData($project_page);
 
        // add a page
        $pdf->AddPage();
        $pdf->SetFont('lato_b', 'B', 12);
 
        // Logo
        $logo_height = 15;
        $pdf->Image($logo,
                    15,
                    15,
                    $logo_height * 3.2238,
                    $logo_height,
                    'PNG',
                    '',
                    '',
                    true,
                    300,
                    '',
/
var
/
www
/
vhosts
/
e-plus.at
/
httpdocs
/
site
/
plugins
/
PdfGenerator
/
ProjectPdfContent.php
<?php
 
class ProjectPdfContent
{
    public function getProjectContentPdf(TCPDF $pdf, $id)
    {
        $project_page = page($id);
 
        $pdf_configurator = new DefaultPdfConfigurator;
        $pdf_configurator->formatPdf($pdf);
 
        $pdf->setPrintFooter(true);
        $this->getPdfProjectPage($pdf, $project_page);
    }
 
    private function getPdfProjectPage(TCPDF $pdf, page $project_page)
    {
        $logo = $_SERVER['DOCUMENT_ROOT'] . '/assets/images/logo.png'; // ration 3,2238
        $teaser = thumb($project_page->image($project_page->teaser_image()), ['width' => 1400, 'height' => 700, 'crop' => true])->root();
 
        // get infos about the project
        $project_data = $this->getProjectData($project_page);
 
        // add a page
        $pdf->AddPage();
        $pdf->SetFont('lato_b', 'B', 12);
 
        // Logo
        $logo_height = 15;
        $pdf->Image($logo,
                    15,
                    15,
                    $logo_height * 3.2238,
                    $logo_height,
                    'PNG',
                    '',
                    '',
                    true,
                    300,
                    '',
/
var
/
www
/
vhosts
/
e-plus.at
/
httpdocs
/
site
/
plugins
/
PdfGenerator
/
PdfGenerator.php
<?php
 
require 'tcpdf/tcpdf.php';
require 'EplusPDF.php';
require 'DefaultPdfConfigurator.php';
require 'DefaultPdfContent.php';
require 'ProjectPdfContent.php';
require 'BrochurePdfContent.php';
 
/**
 * Function to get a Project PDF
 * @param $id
 */
function createProjectPdf($id)
{
    // create new PDF document
    $pdf = new EplusPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
 
    $project_pdf_content = new ProjectPdfContent();
    $project_pdf_content->getProjectContentPdf($pdf, $id);
 
    //Close and output PDF document
    $pdf->Output($id . '.pdf', 'D');
}
 
/**
 * Function to get a brochure PDF
 *
 * @param $id
 */
function createBrochurePdf($id)
{
    $pdf = new EplusPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
 
    $brocure_pdf_content = new BrochurePdfContent();
    $brocure_pdf_content->getBrochureContentPdf($pdf, $id);
 
    $pdf->Output($id . '.pdf', 'D');
}
 
/
var
/
www
/
vhosts
/
e-plus.at
/
httpdocs
/
site
/
config
/
config.php
Kirby Configuration
---------------------------------------
 
By default you don't have to configure anything to
make Kirby work. For more fine-grained configuration
of the system, please check out http://getkirby.com/docs/advanced/options
 
*/
c::set('panel.install', true);
c::set('debug', true);
 
c::set('krb_html_min', false);
c::set('krb_js_async', true);
 
c::set('routes',
       [
           [
               'pattern' => 'pdf/projekte/(:all)',
               'action' => function ($id) {
                   createProjectPdf($id);
               }
           ],
           [
 
               'pattern' => 'pdf/broschueren/(:all)',
               'action' => function ($id) {
                   createBrochurePdf($id);
               }
 
           ]
       ]);
 
/
var
/
www
/
vhosts
/
e-plus.at
/
httpdocs
/
kirby
/
vendor
/
getkirby
/
toolkit
/
helpers.php
 
/**
 * Facepalm typo alias
 * @see csrf()
 */
function csfr() {
  return call('csrf', func_get_args());
}
 
/**
 * Shortcut for call_user_func_array with a better handling of arguments
 *
 * @param mixed $function
 * @param mixed $arguments
 * @return mixed
 */
function call($function, $arguments = array()) {
  if(!is_callable($function)) return false;
  if(!is_array($arguments)) $arguments = array($arguments);
  return call_user_func_array($function, $arguments);
}
 
/**
 * Parses yaml structured text
 *
 * @param $string
 * @return array
 */
function yaml($string) {
  return yaml::decode($string);
}
 
/**
 * Simple email sender helper
 *
 * @param array $params
 * @return Email
 */
function email($params = array()) {
  return new Email($params);
/
var
/
www
/
vhosts
/
e-plus.at
/
httpdocs
/
kirby
/
kirby.php
 
    // load all plugins
    $this->plugins();
 
    // start the router
    $this->router = new Router($this->routes());
    $this->route  = $this->router->run(trim($this->path(), '/'));
 
    // check for a valid route
    if(is_null($this->route)) {
      header::status('500');
      header::type('json');
      die(json_encode(array(
        'status'  => 'error',
        'message' => 'Invalid route or request method'
      )));
    }
 
    // call the router action with all arguments from the pattern
    $response = call($this->route->action(), $this->route->arguments());
 
    // load all language variables
    // this can only be loaded once the router action has been called
    // otherwise the current language is not yet available
    $this->localize();
 
    // build the response
    $this->response = $this->component('response')->make($response);
 
    // store the current language in the session
    if(
        $this->option('language.detect') &&
        $this->site()->multilang() &&
        $this->site()->language()
      ) {
      s::set('kirby_language', $this->site()->language()->code());
    }
 
    return $this->response;
 
/
var
/
www
/
vhosts
/
e-plus.at
/
httpdocs
/
index.php
<?php
 
define('DS', DIRECTORY_SEPARATOR);
 
// load kirby
require(__DIR__ . DS . 'kirby' . DS . 'bootstrap.php');
 
// check for a custom site.php
if(file_exists(__DIR__ . DS . 'site.php')) {
  require(__DIR__ . DS . 'site.php');
} else {
  $kirby = kirby();
}
 
// render
echo $kirby->launch();

Environment & details:

Key Value
Kirby Toolkit v2.5.13
Kirby CMS v2.5.13
empty
empty
empty
empty
empty
Key Value
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
PP_CUSTOM_PHP_INI /var/www/vhosts/system/e-plus.at/etc/php.ini
PP_CUSTOM_PHP_CGI_INDEX plesk-php73-fastcgi
SCRIPT_NAME /index.php
REQUEST_URI /pdf/projekte/projekte/kreistag-barnim-eberswalde
QUERY_STRING
REQUEST_METHOD GET
SERVER_PROTOCOL HTTP/1.0
GATEWAY_INTERFACE CGI/1.1
REDIRECT_URL /pdf/projekte/projekte/kreistag-barnim-eberswalde
REMOTE_PORT 59368
SCRIPT_FILENAME /var/www/vhosts/e-plus.at/httpdocs/index.php
SERVER_ADMIN root@localhost
CONTEXT_DOCUMENT_ROOT /var/www/vhosts/e-plus.at/httpdocs
CONTEXT_PREFIX
REQUEST_SCHEME https
DOCUMENT_ROOT /var/www/vhosts/e-plus.at/httpdocs/
REMOTE_ADDR 54.198.45.0
SERVER_PORT 443
SERVER_ADDR 86.111.38.33
SERVER_NAME www.e-plus.at
SERVER_SOFTWARE Apache
SERVER_SIGNATURE
HTTP_REFERER http://www.e-plus.at/pdf/projekte/projekte/kreistag-barnim-eberswalde
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
HTTP_CONNECTION close
HTTP_X_ACCEL_INTERNAL /internal-nginx-static-location
HTTP_X_REAL_IP 54.198.45.0
HTTP_HOST www.e-plus.at
HTTPS on
PASSENGER_DOWNLOAD_NATIVE_SUPPORT_BINARY 0
PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY 0
PERL5LIB /usr/share/awstats/lib:/usr/share/awstats/plugins
SCRIPT_URI https://www.e-plus.at/pdf/projekte/projekte/kreistag-barnim-eberswalde
SCRIPT_URL /pdf/projekte/projekte/kreistag-barnim-eberswalde
UNIQUE_ID ZgYBfcX6tatYB14szIQtFgAAAA0
REDIRECT_STATUS 200
REDIRECT_HTTPS on
REDIRECT_PASSENGER_DOWNLOAD_NATIVE_SUPPORT_BINARY 0
REDIRECT_PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY 0
REDIRECT_PERL5LIB /usr/share/awstats/lib:/usr/share/awstats/plugins
REDIRECT_SCRIPT_URI https://www.e-plus.at/pdf/projekte/projekte/kreistag-barnim-eberswalde
REDIRECT_SCRIPT_URL /pdf/projekte/projekte/kreistag-barnim-eberswalde
REDIRECT_UNIQUE_ID ZgYBfcX6tatYB14szIQtFgAAAA0
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711669629.8706
REQUEST_TIME 1711669629
empty
0. Whoops\Handler\PrettyPageHandler