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

ferriol created an issue. See original summary.

vegansupreme’s picture

Have you placed the file fpdf_tpl.php in your sites/all/libraries/fpdi folder?

ferriol’s picture

Yes.

/var/www/html/drupal/sites/all/libraries/fpdi$ ls -l
total 96
-rw-r--r-- 1 www-data www-data  4117 nov 29 21:31 FPDF_TPL-1.2.3.zip
-rw-r--r-- 1 www-data www-data 15830 mai 27  2013 fpdf_tpl.php
-rw-r--r-- 1 www-data www-data  5242 mar 18  2013 fpdi2tcpdf_bridge.php
-rw-r--r-- 1 www-data www-data 12332 mar 18  2013 fpdi_pdf_parser.php
-rw-r--r-- 1 www-data www-data 19089 mar 18  2013 fpdi.php
-rw-r--r-- 1 www-data www-data  2890 mar 18  2013 pdf_context.php
-rw-r--r-- 1 www-data www-data 23753 mar 18  2013 pdf_parser.php
vegansupreme’s picture

hmm. 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.

ferriol’s picture

I 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 !

vegansupreme’s picture

Status: Active » Closed (works as designed)

Thanks for the followup! I should update the documentation. Those recommendations are probably about 3 years old.

FireHawkX’s picture

Sorry 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!