Hi,

First of all: the description on your module-page is very promising. I've been waiting for a nice invoice module that is simple.
I've installed the module and all dependencies an d am testing. Where can I find the invoices that are created? And the pdf's?

Thanks,

Mike.

CommentFileSizeAuthor
#18 dompdf-0.6.1.zip6.54 MBJulienF

Comments

mh86’s picture

Yep, 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]

mh86’s picture

I added some more usage instructions to the project page. Not much, but still something!

sportel’s picture

Thanks,

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.

mh86’s picture

Path and configuration seems to be correct.
Can you check your logs if there is more information about the error (usually there is).

sportel’s picture

You'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.

mh86’s picture

The main issue here seems to be

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

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.

sportel’s picture

Ok, 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.

mh86’s picture

It's because dompdf needs write access to its font directory.

mh86’s picture

Fixed the notices from #5, added better exception handler and a bit more documentation.

okaysuper’s picture

During 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

selfirian’s picture

Issue summary: View changes

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

lsolesen’s picture

Status: Active » Fixed

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

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

joe huggans’s picture

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

nchase’s picture

with the font folder in place I get:

Notice: Undefined index: serif in Font_Metrics::get_font() (line 168 of /sites/all/libraries/dompdf/include/font_metrics.cls.php).
Warning: Invalid argument supplied for foreach() in Font_Metrics::get_font() (line 168 of /sites/all/libraries/dompdf/include/font_metrics.cls.php).
Error generating PDF invoice. Please contact the website administrator.
nchase’s picture

ok,
get the latest version of dompdf from github and follow #14
Works perfect! Thx Joeuk for pointing the missing php-font-lib out!

tadesign’s picture

Post #14 fixed any problems I had with PDF's not generating with no obvious error, thank you joeuk!

JulienF’s picture

StatusFileSize
new6.54 MB

Yes 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,

silkogelman’s picture

cockers’s picture

Thanks JulienF, your zip file (#18) worked for me. This was driving me a little crazy, thanks again!

feldmarv’s picture

Great! Thanks JulienF #18 worked also for me

Chetna_Negi’s picture

Great, 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 :)