I'm using TCPDF with Drupal's print module to generate PDF of articles, & ending up with following error message when I click the link to generate PDF:
TCPDF ERROR: [Image] Unable to get image: http://localhost/pathToDrupal/themes/bartik/logo.png
The Image exists in the location specified. I tried applying:
allow_url_fopen = On; allow_url_include = On;
in php.ini
but that could not resolve the problem.
Please care to help :(
Any error stating 'TCPDF' means that there was a problem with the generation of the PDF file.
$tcpdf = new TCPDF_TCPDF(); $img = file_get_contents(Mage::getBaseDir('media') . '/dhl/logo. jpg'); $PDF_HEADER_LOGO = $tcpdf->Image('@' . $img);//any image file.
Apparently the "fopen"-wrappers are not used by TCPDF.
If you supply the URL of an image, TCPDF tries to download it with cURL into the "cache"-directory where your TCPDF-installation is stored (you have to check what the K_PATH_CACHE
-constant contains to be sure).
So I guess you have to have write permissions in this directory that the magic works. Also you need cURL enabled.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With