Support

Home Forums Event Espresso Premium PDF Invoice no longer styled

PDF Invoice no longer styled

Posted: October 3, 2021 at 1:41 pm


dhb_akademie

October 3, 2021 at 1:41 pm

Hi Josh and team,
we are recently facing the issue that the PDF for invoices is no longer styled. This feature used to work fine and has recently stopped working. The invoice preview works fine in any browser, with a dedicated CSS file being called for the styling of the invoice.
We have come across some posts on the support forums that are talking about the file being called as an “external” file and as such not being pulled into dompdf.
To verify this, can you provide some guidance on how and where we could debug this on our own (i.e. call points / files where data is being handed over to dompdf etc.)? Would attempt this first before needing further support from you.

Thanks for any pointers,

Frank


dhb_akademie

October 3, 2021 at 1:41 pm

Hi Josh and team,
we are recently facing the issue that the PDF for invoices is no longer styled. This feature used to work fine and has recently stopped working. The invoice preview works fine in any browser, with a dedicated CSS file being called for the styling of the invoice.
We have come across some posts on the support forums that are talking about the file being called as an “external” file and as such not being pulled into dompdf.
To verify this, can you provide some guidance on how and where we could debug this on our own (i.e. call points / files where data is being handed over to dompdf etc.)? Would attempt this first before needing further support from you.

Thanks for any pointers,

Frank


dhb_akademie

October 3, 2021 at 1:42 pm

Duplicate can be closed.


dhb_akademie

October 3, 2021 at 1:47 pm

Odd, sorry, this shows up twice and is marked as spam, when unfortunately it is not.

Original message got deleted as well:

Hi Josh & team,
we are recently facing the issue that our PDF invoices are no longer styled. The HTML preview works fine. A dedicated CSS file is being pulled in via filter “FHEE__EE_Messages_Template_Pack__get_variation” and as said works for the HTML preview. The PDF invoices used to work in the past as well and have only recently stopped working, without us having made any changes to the server setup.

We have read some posts on here that state that images and other files are seen as “external” files based on the way dompdf builds the PDF. In order to debug this, can you give us any pointers on where to check in the code before the data is handed over to dompdf (files, classes, call-points, etc.)? We want to ensure that the server setup is ok.

Thanks for any pointers,
Frank


Tony

  • Support Staff

October 4, 2021 at 5:05 am

Hi Frank,

DOMPDF is called \event-espresso-core-reg\core\libraries\messages\messenger\EE_Pdf_messenger.class.php but you wont find very much useful there.

The main thing you need to confirm for DOMPDF is that allow_url_fopen is enabled on the server and that the appropriate wrappers are allowed. That’s what it uses to load images and styles within the PDF.

Do you have a logo set within your invoice? If so, is that loading?

If you enable WP_DEBUG on the site and generate a PDF, any errors/notice? I recommend using this snippet:

https://eventespresso.com/wiki/troubleshooting-checklist/#wpdebug

That enables logging in a debug.log file within /wp-content/ so you can view it easier (remember to disable that logging and remove the file when finished).

The invoice preview works fine in any browser, with a dedicated CSS file being called for the styling of the invoice.

The fact that it works in the browser leads me to believe this is an issue with allow_url_fopen and not your custom code, but if you comment out the filter above to stop your custom code hooking in and then generate PDF then, is that unstyled?

Have you recently changed PHP versions?

Any other plugin that generate PDF’s on the site? EE checks if DOMPDF has already been defined before including the version within EE, if another plugin is loading it before EE then you may be using a different version than EE is expecting, although normally you’ll get an error if that happens.


dhb_akademie

October 4, 2021 at 11:48 am

Hi Tony,
thanks for the quick turnaround.

1. Yes we have a logo set up to be included in our invoice. This is getting displayed in the PDF without problems.

2. No errors with WP_DEBUG enabled. PDF gets generated fine.

3. allow_url_fopen was my check as well (based on the other posts on the support forums). But the fact that the logo is getting displayed, is the part that is confusing me.

4. Haven’t done any code changes nor PHP updates since this change occured.


Tony

  • Support Staff

October 4, 2021 at 1:52 pm

Did you try commenting out the snippet hooking in with the custom CSS to see if the default styles work?

Can you send me the snippet you are using so I can see if anything stands out there? I’ll add it to a local site to confirm (seems unlikely to be the snippet, but worth a check).

You can add it to a Gist or Pastebin for me to view.


kcsagency

October 7, 2021 at 10:27 am

Hey, I just wanted to chime in here as I’m having the same problem. No updates or changes done to the system and from the 21st of september, where it was still generating a styled pdf, on to the 23rd of september it changed to non-styled pdfs only.

This is really odd. Checked allow_url_fopen, it’s enabled, also WP_DEBUG doesn’t generate any errors at all.

Need this fixed, it’s plain ugly. Any ideas?


Tony

  • Support Staff

October 7, 2021 at 11:46 am

‘Something’ has changed be it on the server, the site (another plugin updated DOMPDF and is loading before Event Espresso for example) or within Event Espresso but we haven’t pushed an update recently and I’m assuming by ‘no updates or changes’ that you haven’t updated Event Espresso recently either.

Are you also using custom CSS for the PDF’s or just the default templates/styles?

Can you link me to an invoice for a test registration so I can take a look? Or an event I can add a test registration to myself.


dhb_akademie

October 10, 2021 at 8:47 am

Hi Tony,
I added the snippet as a Gist:
https://gist.github.com/dhbit/100be66896d4016ebb659306fb1b9b54

Regarding the URL can you let me know how I can send you a PM?

Thanks!


Tony

  • Support Staff

October 11, 2021 at 2:51 am

We don’t use PM’s but you can add it as a private reply (check the checkbox to make your reply private when adding) or send it via email to support[at]eventespresso.com and I’ll take a look.

Note if sending via email please include a reference to this thread in the email so I know what that email relates to.

The support post ‘PDF Invoice no longer styled’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso