Error in pdf image using dompdf

I need to display a logo on every page of the generated PDF file. Although it works fine on the local system, it throws the following exception on the server:

Fatal error: Uncaught exception 'PDFlibException' with message 'Handle parameter or option of type 'image' has bad value 0' in /var/www/dev/subdomains/rfqms/httpdocs/sprintnineteen/system/plugins/dompdf/include/pdflib_adapter.cls.php:664 Stack trace: #0 /var/www/dev/subdomains/rfqms/httpdocs/sprintnineteen/system/plugins/dompdf/include/pdflib_adapter.cls.php(664): PDFlib->fit_image(0, 30, 746, 'boxsize={86 43}...') #1 /var/www/dev/subdomains/rfqms/httpdocs/sprintnineteen/system/plugins/dompdf/include/php_evaluator.cls.php(66) : eval()'d code(16): PDFLib_Adapter->image('http://rfqms.de...', 'jpg', 30, 3, 86.4, 43.2) #2 /var/www/dev/subdomains/rfqms/httpdocs/sprintnineteen/system/plugins/dompdf/include/php_evaluator.cls.php(66): eval() #3 /var/www/dev/subdomains/rfqms/httpdocs/sprintnineteen/system/plugins/dompdf/include/php_evaluator.cls.php(70): PHP_Evaluator->evaluate('??//$base_img_u...') #4 /var/www/dev/subdomains/rfqms/httpdocs/sprintnineteen/system/plugins/dompdf/include/renderer.cls.php(180): PHP_Evaluator->render(O in /var/www/dev/subdomains/rfqms/httpdocs/sprintnineteen/system/plugins/dompdf/include/pdflib_adapter.cls.php on line 664 

After some analysis, I found that in local mode, it uses cpdf_adapter.cls.php for the image, where, like on the server, it uses pdflib_adapter.cls.php for the image.

I even tried for all types of images according to:

 pdfLib tutorial Version 8.0.2 ---page # 166--- Inline images are only supported for imagetype=ccitt, jpeg, and raw. For other image types the inline option will silently be ignored. 

So what is the problem that leads to this exception?

Additional Information:

  • local PHP version 5.3.0
  • PHP server version 5.2.16
  • dompdf version 0.5.2
  • DOMPDF_TEMP_DIR has r / w / e permission
  • the local machine is Windows Vista.
  • server server - linux
0
image pdf dompdf
source share
1 answer

At some point, an error occurred in dompdf related to adding images via PDFLib. I am not sure if the problem has been fixed or not for the upcoming version 0.6.0. The support group has a related topic . Take a look at my last post there for job information if you want to continue using PDFLib.

Another option is to tell dompdf to use CPDF. In dompdf_config.inc.php set DOMPDF_PDF_BACKEND to "CPDF" instead of "auto" or "PDFLib".

+4
source share

All Articles