Posted: March 20, 2019 at 5:19 am
We have a problem with our invoices & receipts. Whilst we can see them correctly in the backend, when the pdf’s are downloaded, the pdf’s are either blank or not displayed correctly. Do you know what could be causing this? |
|
Hi there, Can you link me to a test Invoice/Receipt I can download to view this, please? My first guess would be allow_url_fopen is disabled on your server and you’ll need to contact your host to have them enable it for the PDF’s to function correctly, however we’ll need to see the PDF to know for sure. |
|
This reply has been marked as private. | |
That’s strange. Have you edited the invoice template at all? If you go to Event Espresso -> Maintenance -> System information Search for allow_url_fopen, what values do you have there? |
|
Below are the settings: allow_url_fopen |
|
Have you edited the invoice template at all? |
|
This reply has been marked as private. | |
It’s a custom invoice that we are using |
|
This reply has been marked as private. | |
Its possible, that when adding the details they’ve broken then HTML within the Invoice and thats causing issues with DOMPDF (which is used to generated the PDF’s) as its much less forgiving of invalid HTML.
Ok, so to clarify, when you say it’s a custom invoice, have you edited the template under ‘Default Message Templates’, or have you created a custom Invoice template within EE and now use that? If you go to Event Espresso -> Messages -> Custom Message Templates (tab at the top) can you see your custom Invoice template there?
They are not stored on the site and are generated on the fly when you click download. |
|
Having a close look at your HTML version of the Invoice the HTML is invalid. For example, there’s a closing p tag at the end of this text:
But there’s no opening tag at the beginning of it. That’s the kind of error that causes DOMPDF to fail. The date course dates UL has no LI’s around the date list, again that’ll cause problems. I suspect the issue is due to invalid HTML, the way to check would be to test the default EE invoice template, but how you do that (without losing your customizations) depends on how you’ve edited the template. If you let me know if you are using a default or custom template I can guide you on how to confirm the above, then you can work on correcting the HTML in your template it that’s the case. |
|
Thanks for getting back to me. We’ve create a custom inovice which we are now using. The Default message is has not been used or edited. I got to Event Espresso -> Messages -> Custom Message to edit the invoice template |
|
Thanks Tony – I’d appreciate your help! As i mentioned we are using a custom template. |
|
Ok, go to Event Espresso -> Messages -> Default message templates -> Invoice -> Edit Purchaser. In the address bar you’ll see To confirm, you’ve not edited the default invoice template at all?
|
|
It’s id=16 |
|
That’s the ID used for the Invoice you sent me earlier, meaning it’s not using a custom template but using the default? |
|
Apologies, I misread your reply. The custom invoice id is 16 but the default invoice it is 14 |
|
Ok, have you disabled that template? It will say something like:
At the top next to a toggle, if so, please click the toggle to temporarily enable it. |
|
I’ve just done this |
|
Default template has also been edited, so testing on that is no good unless you reset it. To cause the least amount of disruption, create a new custom template from the default one. Once you’ve created it, edit it and click the ‘Reset Templates’ button on that new custom template. Then let me know the ID of that new custom template. (Note you can disable the default one now if needed) |
|
Just checking – when I go to reset the new custom template, i get the following warning…. Are you sure you want to reset the html invoice message templates? Remember continuing will reset the templates for all contexts in this messenger and message type group. |
|
No, it effects all of the contexts for the current template you are editing. So, just to confirm, you should have a NEW custom invoice template and be editing that new template. Clicking on the reset templates button within the editor for that template, affects all contexts for THAT template (Invoice only has one context, so it’s simple in that clicking to reset on an invoice template, resets that invoice template that you can see back to the default)
As long as your editing the custom template yes. The worst that can happen is your invoice is reset to default and you need to re-apply your customizations again, but tbh, it’s likely you’re going to need to fix the template anyway as its invalid. |
|
Thanks for clarifying – i’ve reset it now. The new template id is 34 |
|
Is that template active? |
|
This reply has been marked as private. | |
I’ve been working on the new template. Something odd is going on. I’ve reset the “New invoice template” and have tested it out wihtout changing anything but the pdf is still blank. |
|
This reply has been marked as private. | |
I’m often getting Network errors when trying to download the PDF, no idea why but that might be another clue. Try removing the |
|
The support post ‘Receipt & invoice PDF viewing issues’ 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.