I am unable to find any detailed documentation for enabling the PDF option. I have tried TCPDf and dompdf, none worked for me.
I have copied the downloaded files to the sites/all/libraries/dompdf folder, but when I login to the site I get the following error:
Warning: require_once(/home/site/public_html/sites/all/libraries/dompdf-0.6.1/lib/php-font-lib/classes/Font.php) [function.require-once]: failed to open stream: No such file or directory in require_once() (line 332 of /home/site/public_html/sites/all/libraries/dompdf-0.6.1/dompdf_config.inc.php).
and when I click on the PDF icon or when I go to Configuration of Drupal [/admin/config], I get the following error:
Fatal error: require_once() [function.require]: Failed opening required '/home/site/public_html/sites/all/libraries/dompdf-0.6.1/lib/php-font-lib/classes/Font.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/site/public_html/sites/all/libraries/dompdf-0.6.1/dompdf_config.inc.php on line 332
What am I missing?
Can someone tell me how to configure the PDF option please or how to make one of the PDF external downloads work? thanks!
Comments
Comment #1
vako commentedComment #2
vako commentedSOLUTION:
In
dompdf_config.inc.php, change line 332 to point to the actual location of your Font.php file.mine was
/php-font-lib/src/FontLibThere is no CLASSES folder that was mentioned there.
Comment #3
drupalstewy commentedHi,
I downloaded DOMPDF from github. https://github.com/dompdf/dompdf, v 0.6.1.
If I copy the extracted folder in libaries, the Font.php file is not in /dompdf/lib/... but in /dompdf/www
So how can I point to it in dompdf_config.inc.php, line 332?
(Sorry, I'm a noob in php)
Comment #4
reign85 commentedhttp://stackoverflow.com/questions/13431905/php-font-lib-must-either-be-...
This will help you
Comment #5
rcodinaThanks for the info. Another option is to manually download https://github.com/PhenX/php-font-lib and put it to dompdf/lib/php-font-lib
Comment #6
vako commentedI hope these latest changes will be documented in the installation readme file of the module.
Comment #7
jcnventuraComment #9
chris dartI finally got mine to work.
Of course, I had a problem with the output being unreadable because it was covered with boxes with "X"es in them, but I posted that under a different issue queue.
Comment #10
ferriol commentedI've made it work the dompdf 0.6.1 version. With #2 or copying /php-font-lib/src/FontLib in a new /php-font-lib/classes
But when I add a font-face in my stylesheet I have blank pages cause a
PHP message: PHP Fatal error: Class 'Font' not found in /var/www/.../modules/print/lib/dompdf-0.6.1/include/font_metrics.cls.php on line 346"
I solved installing php-font-lib 0.2.2 it seems that dompdf-0.6.1 is not compatible with releases of php-font-lib greater of 0.2.2, may be the next release. At this moment doesn't exist yet
Yes, dompdf is complicated to install. But its free software, and that's great ! It make as free as in freedom.
Comment #11
rcodinaComment #12
wafer commentedI am working on a view that render pdf,every thing is fine,I have tried to show a watermark but it's only showing on first page.I am using dompdf 0.6 with Drupal 7 print module,is it possible to add header and footer template with that watermark on every pages.
I have attached a pdf,which I need to customize.
Your solicited advice is needed.Please.
Comment #13
davidreedernst commentedFrom what I can tell, this problem has gotten worse. The documentation says:
I wish that it would say where I should expect to find dompdf_config.inc.php, but wherever that was, I'm pretty sure it's not there anymore. I've downloaded the latest (as of 2016-02-16) versions of the following from github: dompdf, php-font-lib, & php-svg-lib. I'm using v 7.x-2.0 of the print module. I've used
findon the command line to search for this file, and I don't see it anywhere. My best guess is that it used to be part of the dompdf package, but it was removed along the way, and the drupal print module documentation hasn't been updated to reflect this fact.Of course, if it were there, I still wouldn't know what it means "to use it". Was it supposed to autoload? Do i need to copy/link to it from some other place? The documentation should be more clear about this too.
As it stands now, I've tried moving the dompdf folder all over, including a version number per Chris Dart's comment, and the print module still says "No PDF generation tool found!". Any guidance would be appreciated.
Comment #14
mrchristophy commentedSame problem here - the instructions don't have any relation to the contents of dompdf.
EDIT: Download this version of dompdf and it seems to work: https://github.com/dompdf/dompdf/releases/tag/v0.6.1
Comment #15
vertikal.dk commented#10 is right as of writing this.
Look to the right and "download zip" at
https://github.com/dompdf/dompdf/archive/v0.6.1.zip
https://github.com/PhenX/php-font-lib/tree/0.2.2
First unpack dompdf at /sites/all/libraries/dompdf-0.6.1/
Then place everything in phpfontlib in /home/site/public_html/sites/all/libraries/dompdf-0.6.1/lib/php-font-lib/
/home/site/public_html/sites/all/libraries/dompdf-0.6.1/lib/php-font-lib/classes/Font.php should then be accessible and it should work.
If you're still having trouble check the permission in the folder.
http://www.linux.org/threads/file-permissions-chmod.4094/
Comment #16
retiredpro commented#15's post by vertikal.dk's worked for me. Thank you everyone for figuring this out.
Comment #17
hockey2112 commentedThank you, #15!
Comment #18
BartNijs commented#15 did it for me as well. These easy steps should be added to the documentation.
Comment #19
FranCarstens commented#15 worked for me as well. Just remember to actually enable the print_pdf_dompdf module.
Comment #20
adamps commentedNote that dompdf 0.6.1 as mentioned in #15 has security vulnerabilities so you should use 0.6.2 instead. Don't use 0.7.0 as it is not yet compatible with this module.
Comment #21
heddnNote, do to security advisories before 6.2, and the recent launch of the 7 branch, you might want to head over to #2818589: Support dompdf version 0.7 move that issue along.
Comment #22
jcnventuraI've updated the INSTALL.txt for dompdf slightly, but it's clear that this is caused by downloading the source release of the dompdf library.. Please make sure to download full builds from https://github.com/dompdf/dompdf/releases
Comment #24
madjr commentedAlso don't forget that after downloading dompdf libraries, go back to the modules admin page and enable the print module companion: "dompdf library handler" module.