Posted: July 16, 2019 at 7:10 am
|
When i or a customer try’s to download the PDF invoice the site redirect to the home page, and the PDF will not download/generated. Last versions WP and EE 4 plugins. |
Hi, May I ask does the Invoice render in html when you initially click the link (just doesn’t convert to PDF?) |
|
|
Hi, |
|
i think i missunderstood. It shows the invoice in html but the “download PDF” button does not convert or download or do anything. |
You could contact your host to see if they have a mod security rule that gets tripped when you try to download the PDF. If there’s no mod security then it may help to check the html in the invoice to see if there’s any invalid html. Sometimes if there’s invalid HTML in the invoice, then the dompdf converter cannot render the PDF. May I ask is there an event on the site that I could register for as a test so I can check the invoice? |
|
|
This reply has been marked as private. |
Hi, I checked the html within the invoice and there is some invalid html there and that invalid html would cause the PDF converter to fail. What you can do is go to Event Espresso > Messages > Default Message Templates then click to edit the Invoice and switch to Text view. What you’ll look for are closing paragraph tags, |
|
This reply has been marked as private. | |
|
thanks a lot. but there is no </p>. i did not change anything in this Template, it is the standard configuration. <div class=”print_button_div noPrint”> <h3>Transaktions-ID: <span>[TXN_ID]</span></h3> <h2>Rechnungsadresse:</h2> <h2>Bestellungen</h2> <tr class=”total_tr odd”> * steuerpflichtige Positionen <h2>Zahlungen</h2> |
You could check to see if another plugin or a theme function is adding those whenever there is a line break. If you deactivate all other plugins and switch to the default theme does the invoice convert to PDF as expected? |
|
Your invoice template was setup using Event Espresso decaf, so your image URL’s are incorrect (note the broken image next to “Name der Veranstaltung” as an example). You can edit the template manually and change all references to That will regenerate the Invoice template based on the current directory in use by EE. Next, go to Event Espresso -> Messages -> Settings -> PDF. First, make sure it’s enabled and that the Invoice (and Receipt) message types are not in the ‘Inactive message types’ section. If they are not, then drag the Invoice message type from Active to Inactive, wait a few seconds and drag it back. That basically confirms that the settings are in sync with EE. Now retest the PDF button, does it work? Have you checked in your servers error logs to confirm if there’s an error being thrown when EE tries to generate the PDF? |
|
|
thank you for reply, i did it all, i have deactivated all plugins, reset the Template and test it again, same result. but i found the issue. i deleted the logo |
Enable WP_Debug using this code: https://eventespresso.com/wiki/troubleshooting-checklist/#wpdebug In your Note, you’ll have something like |
|
|
ok, now its done. |
Hmmm, no errors logged. If you check your servers error logs can you see anything there? |
|
|
yes but there is nothing, too. i checked the sourcecode from the html invoice. there i found a under Event Espresso -> Messages -> Messages activity May it help to give you access to the wordpress server? |
Hi, I think there may be some confusion about what the source code is and isn’t. This is the source code, and as you’ll note, there are no https://github.com/eventespresso/event-espresso-core/blob/master/core/libraries/messages/defaults/default/html_invoice_content.template.php#L14 |
|
|
i mean html, the same place you send me the screenshot on https://slack-files…. :
here i can see the in Event Espresso i cant see any |
Correct, so something is adding those p tags and what ever that something is it needs to stop doing that. Have you checked to see if another plugin or a theme function is adding those whenever there is a line break? If you deactivate all other plugins and switch to the default theme does the invoice convert to PDF as expected? |
|
|
see my answer before. i have deactivated all plugins, themes, reset the Template and test it again. same result. |
You mentioned deactivating plugins, but did you temporarily switch to another theme? If what I suspect is happening, is happening, then something on your site is converting line breaks to closing paragraph tags. So a workaround would be to go into text mode of the editor and remove any line breaks where tags are added. For example, right after the [INVOICE_LOGO], you could move the next line’s contents up so it’s on the same line with [INVOICE_LOGO]. |
|
|
but when i delete only this [INVOICE_LOGO] in the editor then i can download the pdf, so this means the |
|
and yes i switched to a default theme |
Actually, no, the [INVOICE_LOGO] shortcode does not include a closing p tag. You can check the source code and see there’s no Something else on your site is adding the stray closing p tags, it’s not coming from Event Espresso. |
|
|
hmmmm….may it help to give you access to my wordpress server? |
Not really, the shortcode works fine for everyone else, so this appears to be a config issue. The one thing that sometimes causes issues with One thing you can try, is to enable WP_DEBUG site wide so that it displays all errors rather than logging them, that may give a hint to the issue. To do that remove the code I gave you earlier from your Then post here. |
|
|
now i found the cause. the .png picture it self was the problem. when i use an other .png picture it works. only with this one not. maybe because it is one with transparent Background or something else is in this picture wich make it happend. thats why the shortcode works fine for everyone else. |
I downloaded the PNG used on the Invoice which caused the failure and set it as the Invoice logo on one of my test sites. The PDF generated correctly on that site, so it is something on the server preventing the PDF from generating. As there are no errors logged at all, we can’t say what it is but at a guess, it could be a missing PHP module or something your host is doing with the request for the image, hotlink protection maybe (that’s a bit of a log shot thought). |
|
The support post ‘Invoice PDF download does not work’ 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.