Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I just installed Views PDF, as explained in docs and as explained in README in the module directory.
When I edit a display view PDF Page this message appears.
Warning: Declaration of FPDF::_putstream($s) should be compatible with TCPDF::_putstream($s, $n = 0) in require_once() (line 22 of /var/www/html/drupal/sites/all/modules/views_pdf/views_pdf_template.php).
Warning: Declaration of FPDF_TPL::SetFont($family, $style = '', $size = 0) should be compatible with TCPDF::SetFont($family, $style = '', $size = NULL, $fontfile = '', $subset = 'default', $out = true) in require_once() (line 27 of /var/www/html/drupal/sites/all/libraries/fpdi/fpdi.php).
I've installed
FPDI 1.4.4
FPDF_TPL 1.2.3
TCPDF 6.0.20
Comments
Comment #2
vegansupreme CreditAttribution: vegansupreme commentedHave you placed the file
fpdf_tpl.php
in your sites/all/libraries/fpdi folder?Comment #3
ferriol CreditAttribution: ferriol commentedYes.
Comment #4
vegansupreme CreditAttribution: vegansupreme commentedhmm. Maybe try a newer version of FPDI?
I know these are the supported versions, but they seem to work for some, but not for everyone. I'm using some fairly new versions on my sites without issue. There's a package with FPDI-FPDF combined.
https://packagist.org/packages/setasign/fpdi-fpdf
There have been some other issues relating to this problem.
Here's a patch for the libraries, but I'm not sure which version.
https://www.drupal.org/node/2530472#comment-10183098
If you can get it working please report back with what works. I've been unable to duplicate these errors. Maybe we can update the recommended versions in the docs.
Comment #5
ferriol CreditAttribution: ferriol commentedI installed the last release of FPDI, 1.6.1. And the warnings disappear.
I think it's important to mention that I use PHP 7.
Thanks !
Comment #6
vegansupreme CreditAttribution: vegansupreme commentedThanks for the followup! I should update the documentation. Those recommendations are probably about 3 years old.
Comment #7
FireHawkX CreditAttribution: FireHawkX commentedSorry for replying in this old thread... but after trying out a bunch of printing module, pdf view was the only one that actually worked properly to enable me to do what i needed.
FPDI 1.6.2 works with latest version and fixes the warnings for that library.
I am however getting a bunch of errors with TCPDF that I have yet to figure out how to fix :
Deprecated function: The each() function is deprecated.
This message will be suppressed on further calls in TCPDF->getHtmlDomArray()
(line 16543 of C:\drupal\sites\all\libraries\tcpdf\tcpdf.php).
Deprecated function: The each() function is deprecated.
This message will be suppressed on further calls in TCPDF->getHtmlDomArray()
(line 16406 of C:\drupal\sites\all\libraries\tcpdf\tcpdf.php).
Deprecated function: Function create_function() is deprecated in TCPDF->deletePage()
(line 20997 of C:\drupal\sites\all\libraries\tcpdf\tcpdf.php).
Any suggestion on which version of TCPDF I could grab?
I tried the latest one from github but everything breaks down...
Edit : I just tried 6.0.099 and it had the same errors, then tried 6.2.9 and this one only had 1 warning remaining (but it broke other things in my pdf view)
Thank you very much for your time and have a nice day!