• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Error generating document: Failed to generate PDF: Unable to load css file

Rar9

Regular Pleskian
I´m using php 7.1 for my Drupal 8.35 site and get error when trying to print with DOMPDF.

I get this error Error generating the document:

Drupal\entity_print\PrintEngineException: Failed to generate PDF: Unable to load css file https://<domain>/sites/default/files/css/css_47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU.css?ov8un6 in Drupal\entity_print\Plugin\EntityPrint\PrintEngine\DomPdf->send() (line 156 of /var/www/vhosts/<domain>/httpdocs/modules/entity_print/src/Plugin/EntityPrint/PrintEngine/DomPdf.php).

but the give CSS file exists but is empty

Permissions are 777

DomPdf.php Line 156 is in RED below:

/**
* {@inheritdoc}
*/
public function send($filename, $force_download = TRUE) {
$this->doRender();

// Dompdf doesn't have a return value for send so just check the error
// global it provides.
if ($errors = $this->getError()) {
throw new PrintEngineException(sprintf('Failed to generate PDF: %s', $errors));
}

// The Dompdf library internally adds the .pdf extension so we remove it
// from our filename here.
$filename = preg_replace('/\.pdf$/i', '', $filename);

// If the filename received here is NULL, force open in the browser
// otherwise attempt to have it downloaded.
$this->dompdf->stream($filename, ['Attachment' => $force_download]);
}


I have the feeling that something is misconfigured, but I´m running out of ideas.

Anyone have some ideas how to debug this?
 
Back
Top