Closed (fixed)
Project:
Commerce Billy
Version:
7.x-1.x-dev
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
7 Jun 2013 at 09:52 UTC
Updated:
20 Apr 2016 at 10:56 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mh86 commentedYep, some documentation is still missing, as always ;-)
Concerning your PDF invoices, there is a Views field "Link to invoice PDF file" that you can use.
Furthermore the URL is invoice-pdf/[order-id]
Comment #2
mh86 commentedI added some more usage instructions to the project page. Not much, but still something!
Comment #3
sportel commentedThanks,
I found it. But, when trying to download or view the pdf, I get an (drupal) error: The website encountered an unexpected error. Please try again later.
I'm using this url: www.mydomain.com/subdomain/invoice-pdf/[order-id]
where "subdomain" is the folder where drupal is installed in. Is this correct?
Where is the DOMPDF library expected to be found? I've put it in sites/all/libraries/dompdf/
Thanks,
Mike.
Comment #4
mh86 commentedPath and configuration seems to be correct.
Can you check your logs if there is more information about the error (usually there is).
Comment #5
sportel commentedYou're right. These are all the errors in the log when I try to access the pdf (first error on the bottom, the last error on the top):
DOMPDF_Exception: Unable to find a suitable font replacement for: 'arial, sans-serif' in Style->get_font_family() (regel 805 van /usr/home/deb16445/domains/mikesportel.nl/public_html/fase/sites/all/libraries/dompdf/include/style.cls.php).
Warning: Invalid argument supplied for foreach() in Font_Metrics::get_font() (regel 168 van /usr/home/deb16445/domains/mikesportel.nl/public_html/fase/sites/all/libraries/dompdf/include/font_metrics.cls.php).
Notice: Undefined index: serif in Font_Metrics::get_font() (regel 168 van /usr/home/deb16445/domains/mikesportel.nl/public_html/fase/sites/all/libraries/dompdf/include/font_metrics.cls.php).
Notice: Undefined index: #markup in commerce_billy_pdf_commerce_customer_profile_view() (regel 126 van /usr/home/deb16445/domains/mikesportel.nl/public_html/fase/sites/all/modules/commerce_billy/modules/commerce_billy_pdf/commerce_billy_pdf.module).
Notice: Undefined offset: 0 in commerce_billy_pdf_commerce_customer_profile_view() (regel 126 van /usr/home/deb16445/domains/mikesportel.nl/public_html/fase/sites/all/modules/commerce_billy/modules/commerce_billy_pdf/commerce_billy_pdf.module).
Notice: Undefined index: field_customer_firstname in commerce_billy_pdf_commerce_customer_profile_view() (regel 126 van /usr/home/deb16445/domains/mikesportel.nl/public_html/fase/sites/all/modules/commerce_billy/modules/commerce_billy_pdf/commerce_billy_pdf.module).
Notice: Undefined index: field_customer_lastname in commerce_billy_pdf_commerce_customer_profile_view() (regel 126 van /usr/home/deb16445/domains/mikesportel.nl/public_html/fase/sites/all/modules/commerce_billy/modules/commerce_billy_pdf/commerce_billy_pdf.module).
Notice: Undefined index: #markup in commerce_billy_pdf_commerce_customer_profile_view() (regel 126 van /usr/home/deb16445/domains/mikesportel.nl/public_html/fase/sites/all/modules/commerce_billy/modules/commerce_billy_pdf/commerce_billy_pdf.module).
Notice: Undefined offset: 0 in commerce_billy_pdf_commerce_customer_profile_view() (regel 126 van /usr/home/deb16445/domains/mikesportel.nl/public_html/fase/sites/all/modules/commerce_billy/modules/commerce_billy_pdf/commerce_billy_pdf.module).
Notice: Undefined index: field_customer_firstname in commerce_billy_pdf_commerce_customer_profile_view() (regel 126 van /usr/home/deb16445/domains/mikesportel.nl/public_html/fase/sites/all/modules/commerce_billy/modules/commerce_billy_pdf/commerce_billy_pdf.module).
Notice: Undefined index: field_customer_lastname in commerce_billy_pdf_commerce_customer_profile_view() (regel 126 van /usr/home/deb16445/domains/mikesportel.nl/public_html/fase/sites/all/modules/commerce_billy/modules/commerce_billy_pdf/commerce_billy_pdf.module).
I hope it helps.
Mike.
Comment #6
mh86 commentedThe main issue here seems to be
Seems like the font could still be not found.
The dompdf lib is located in my libraries folder "libraries/dompdf" (e.g. libraries/dompdf/dompdf.php)
The fonts are copied into the public dir "files/fonts" (e.g. files/fonts/Courier.afm).
Is this the same for you?
I'll fix the other notices later on.
Comment #7
sportel commentedOk, I've copied the fonts dir to the files dir. Now I can download the pdf.
But isn't more logical to keep the fonts dir in the dompdf/lib/ dir, because it's already there when the dompdf library is downloaded?
I'll test Billy some more and give some feedback soon. Thanks,
Mike.
Comment #8
mh86 commentedIt's because dompdf needs write access to its font directory.
Comment #9
mh86 commentedFixed the notices from #5, added better exception handler and a bit more documentation.
Comment #10
okaysuper commentedDuring installation I found another issue related to dompdf install:
Some files are missing in the github version while the last beta version on googlecode contains all the necessary files :
https://code.google.com/p/dompdf/downloads/list
The google version works fine if you uncompress it directly on the server but won't uncompress locally.
Once this done the module works perfectly as expected.
This has been previously solved on stackoverflow but I thought it might save people some time.
Herve
Comment #11
selfirian commentedIt might be a good idea to mention that you need to copy the fonts directory to the files folder. It's a small thing but I was a bit confused by the instructions on the project page.
Comment #12
lsolesen commentedThis issue has gone a little astray, and it seems there is an answer - and the project page contains sufficient information to get the module going.
Comment #14
joe huggansThis is the solution that worked for me
Go to https://github.com/PhenX/php-font-lib and download the library.
Create the dompdf/lib/php-font-lib/classes/ directory.
In the zip file, take the contents of the src/FontLib/ folder and paste that into your newly created directory.
Comment #15
nchase commentedwith the font folder in place I get:
Comment #16
nchase commentedok,
get the latest version of dompdf from github and follow #14
Works perfect! Thx Joeuk for pointing the missing php-font-lib out!
Comment #17
tadesign commentedPost #14 fixed any problems I had with PDF's not generating with no obvious error, thank you joeuk!
Comment #18
JulienF commentedYes the dompdf archive from git comes without the php-font-lib files which causes a fatal error.
Here is a zip that works for me.
putting it here also allows me to reference it from a Makefile :-)
Cheers,
Comment #19
silkogelman commentedComment #20
cockers commentedThanks JulienF, your zip file (#18) worked for me. This was driving me a little crazy, thanks again!
Comment #21
feldmarv commentedGreat! Thanks JulienF #18 worked also for me
Comment #22
Chetna_Negi commentedGreat, thank you JulienF. Your solution fixed my problem, which was seeming near to impossible to me because of the required versions of dompdf and php-font-lib was getting tough to find.
Big thanks :)