Posted: September 25, 2017 at 9:32 am
|
Hi, When I click the PDF button, I get a new tab with a blank PDF. I have searched the forum for a solution and I’ve tried the following: 1) Reset template and tried the PDF button Many thanks. |
That’s actually correct, as it explains:
You’ll find the Invoice message type under HTML settings. Can you check to see if your web server meets the requirements listed here? |
|
|
Hi Josh, I’ve checked and the web server we use meets the requirements on the list. I’m not getting any errors when generating the PDF or any javascript errors. Many thanks. |
Can you link me to an event I use to run a registration? I tried on a few but they require login. |
|
|
Hi Tony, Thanks for taking a look, I’ve removed the login for this event: http://aspconference.org.uk/events/asp-conference-2018/ |
Unfortunately, the caching used on your site is preventing registrations (caching is usually disabled when logged in so will likely have been unnoticed so far). Can you follow the steps here to exclude the EE critical pages from caching: https://eventespresso.com/wiki/setup-nocache-exclusion-rules-event-espresso/
|
|
|
Hi Tony, I’ve followed the guide and added all the Espresso pages to the exclusion list and cleared the cache. Added a new order and I’m still getting a blank PDF. |
Can you enable WP_Debug on the site so I can see if there are any errors within the PDF? |
|
|
All I get is the following error on the receipt/invoice page: Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; sidebar_generator has a deprecated constructor in /home/sites/aspconference.org.uk/public_html/wp-content/themes/nimva/functions/plugin/multiple_sidebars.php on line 29 When I click ‘Download PDF’ the browser downloads the pdf to disk. Is there an option to open the PDF in a new tab? Many thanks. |
|
I get a warning in Chrome when I have clicked the ‘Download PDF’ button: Resource interpreted as Document but transferred with MIME type application/pdf: “http://aspconference.org.uk/?ee=msg_url_trigger&snd_msgr=pdf&gen_msgr=html&message_type=invoice&context=purchaser&token=1-5f566bdbe3a0d5da0004a9b8804886e6&GRP_ID=7&id=0”. |
That depends on your browser settings, mine opens in a new tab as Chrome is set up automatically open PDF’s. You can disable WP_Debug again now, thank you. If you try with the default EE template does it work then? If you have edited the default template on your site, you don’t need to reset your templates to test the original. Create a custom Invoice template, edit that and then click ‘Reset Templates’ within that version. That will set the custom template back the EE default one, assign that custom template to the event and reload the invoice from the Event Espresso -> Registrations menu. Does the PDF work then? Note – be careful when resetting the template, make sure you editing the custom template, the reset button will remove all changes to the current template and there is no backup. |
|
|
Hi Tony, I’ve deleted the custom templates and reset them. I’ve put in a new order but I still get blank PDF, the only difference is that there are 3 pages instead than 2. Many thanks. |
I wonder if there are any other plugins activated on the site that also use the DOMPDF class, and possibly there’s a conflict? There’s a check within Event Espresso to not use the bundled DOMPDF class which avoids a fatal error in case there’s another plugin that loads the same class. Are there any other plugins on your site that have a feature that makes a PDF? If so, can you try temporarily deactivating them? |
|
|
Hi Josh, I’ve gone through the plugins isntalled on the site and none of them except espresso have a pdf function or use DOMPDF. I generated an invoice at 11:35am, then I downloaded the PDF. I then checked the server log for errors and got the following: aspconference.org.uk [Wed Sep 27 11:35:05 2017] [error] [client 62.232.214.6:54164] AH01215: PHP Fatal error: Uncaught EventEspresso\\core\\exceptions\\InvalidSessionDataException: The session data is missing, invalid, or corrupted. in /home/sites/aspconference.org.uk/public_html/wp-content/plugins/event-espresso-core-reg/core/EE_Session.core.php:607: /home/sites/aspconference.org.uk/public_html/wp-admin/admin-ajax.php aspconference.org.uk [Wed Sep 27 11:35:05 2017] [error] [client 62.232.214.6:54164] AH01215: #0 /home/sites/aspconference.org.uk/public_html/wp-content/plugins/event-espresso-core-reg/core/EE_Session.core.php(484): EE_Session->_retrieve_session_data(): /home/sites/aspconference.org.uk/public_html/wp-admin/admin-ajax.php aspconference.org.uk [Wed Sep 27 11:35:05 2017] [error] [client 62.232.214.6:54164] AH01215: Stack trace:: /home/sites/aspconference.org.uk/public_html/wp-admin/admin-ajax.php aspconference.org.uk [Wed Sep 27 11:35:05 2017] [error] [client 62.232.214.6:54164] AH01215: #3 /home/sites/aspconference.org.uk/public_html/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(”, Array): /home/sites/aspconference.org.uk/public_html/wp-admin/admin-ajax.php aspconference.org.uk [Wed Sep 27 11:35:05 2017] [error] [client 62.232.214.6:54164] AH01215: #1 /home/sites/aspconference.org.uk/public_html/wp-content/plugins/event-espresso-core-reg/core/EE_Session.core.php(214): EE_Session->_espresso_session(): /home/sites/aspconference.org.uk/public_html/wp-admin/admin-ajax.php aspconference.org.uk [Wed Sep 27 11:35:05 2017] [error] [client 62.232.214.6:54164] AH01215: #5 /home/sites/aspconference.org.uk/public_html/wp-content/plugins/event-espresso-core-reg/core/EE_System.core.php(945): do_ in /home/sites/aspconference.org.uk/public_html/wp-content/plugins/event-espresso-core-reg/core/EE_Session.core.php on line 607: /home/sites/aspconference.org.uk/public_html/wp-admin/admin-ajax.php aspconference.org.uk [Wed Sep 27 11:35:05 2017] [error] [client 62.232.214.6:54164] AH01215: #4 /home/sites/aspconference.org.uk/public_html/wp-includes/plugin.php(453): WP_Hook->do_action(Array): /home/sites/aspconference.org.uk/public_html/wp-admin/admin-ajax.php aspconference.org.uk [Wed Sep 27 11:35:05 2017] [error] [client 62.232.214.6:54164] AH01215: #2 /home/sites/aspconference.org.uk/public_html/wp-includes/class-wp-hook.php(298): EE_Session->open_session(”): /home/sites/aspconference.org.uk/public_html/wp-admin/admin-ajax.php aspconference.org.uk [Wed Sep 27 11:35:58 2017] [error] [client 81.137.244.67:42284] AH01215: HTTP request failed, unexpected end of socket!<br />: /home/sites/aspconference.org.uk/public_html/index.php aspconference.org.uk [Wed Sep 27 11:35:58 2017] [error] [client 81.137.244.67:42284] AH01215: in /home/sites/aspconference.org.uk/public_html/wp-content/plugins/specify-image-dimensions/specify-image-dimensions.php on line 61: /home/sites/aspconference.org.uk/public_html/index.php aspconference.org.uk [Wed Sep 27 11:35:58 2017] [error] [client 81.137.244.67:42284] AH01215: HTTP request failed, unexpected end of socket!<br />: /home/sites/aspconference.org.uk/public_html/index.php aspconference.org.uk [Wed Sep 27 11:35:58 2017] [error] [client 81.137.244.67:42284] AH01215: HTTP request failed, unexpected end of socket!<br />: /home/sites/aspconference.org.uk/public_html/index.php aspconference.org.uk [Wed Sep 27 11:35:58 2017] [error] [client 81.137.244.67:42284] AH01215: HTTP request failed! HTTP/1.0 403 Forbidden\r: /home/sites/aspconference.org.uk/public_html/index.php aspconference.org.uk [Wed Sep 27 11:37:06 2017] [error] [client 62.232.214.6:50590] AH01215: PHP Fatal error: Uncaught EventEspresso\\core\\exceptions\\InvalidSessionDataException: The session data is missing, invalid, or corrupted. in /home/sites/aspconference.org.uk/public_html/wp-content/plugins/event-espresso-core-reg/core/EE_Session.core.php:607: /home/sites/aspconference.org.uk/public_html/wp-admin/admin-ajax.php aspconference.org.uk [Wed Sep 27 11:37:06 2017] [error] [client 62.232.214.6:50590] AH01215: Stack trace:: /home/sites/aspconference.org.uk/public_html/wp-admin/admin-ajax.php aspconference.org.uk [Wed Sep 27 11:37:06 2017] [error] [client 62.232.214.6:50590] AH01215: #0 /home/sites/aspconference.org.uk/public_html/wp-content/plugins/event-espresso-core-reg/core/EE_Session.core.php(484): EE_Session->_retrieve_session_data(): /home/sites/aspconference.org.uk/public_html/wp-admin/admin-ajax.php aspconference.org.uk [Wed Sep 27 11:37:06 2017] [error] [client 62.232.214.6:50590] AH01215: #1 /home/sites/aspconference.org.uk/public_html/wp-content/plugins/event-espresso-core-reg/core/EE_Session.core.php(214): EE_Session->_espresso_session(): /home/sites/aspconference.org.uk/public_html/wp-admin/admin-ajax.php aspconference.org.uk [Wed Sep 27 11:37:06 2017] [error] [client 62.232.214.6:50590] AH01215: #3 /home/sites/aspconference.org.uk/public_html/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(”, Array): /home/sites/aspconference.org.uk/public_html/wp-admin/admin-ajax.php aspconference.org.uk [Wed Sep 27 11:37:06 2017] [error] [client 62.232.214.6:50590] AH01215: #2 /home/sites/aspconference.org.uk/public_html/wp-includes/class-wp-hook.php(298): EE_Session->open_session(”): /home/sites/aspconference.org.uk/public_html/wp-admin/admin-ajax.php aspconference.org.uk [Wed Sep 27 11:37:06 2017] [error] [client 62.232.214.6:50590] AH01215: #4 /home/sites/aspconference.org.uk/public_html/wp-includes/plugin.php(453): WP_Hook->do_action(Array): /home/sites/aspconference.org.uk/public_html/wp-admin/admin-ajax.php aspconference.org.uk [Wed Sep 27 11:37:06 2017] [error] [client 62.232.214.6:50590] AH01215: #5 /home/sites/aspconference.org.uk/public_html/wp-content/plugins/event-espresso-core-reg/core/EE_System.core.php(945): do_ in /home/sites/aspconference.org.uk/public_html/wp-content/plugins/event-espresso-core-reg/core/EE_Session.core.php on line 607: /home/sites/aspconference.org.uk/public_html/wp-admin/admin-ajax.php Many thanks. |
|
I ran another test to isolate the errors and this is what I get: aspconference.org.uk [Wed Sep 27 11:47:09 2017] [error] [client 62.232.214.6:45660] AH01215: Stack trace:: /home/sites/aspconference.org.uk/public_html/wp-admin/admin-ajax.php aspconference.org.uk [Wed Sep 27 11:47:09 2017] [error] [client 62.232.214.6:45660] AH01215: PHP Fatal error: Uncaught EventEspresso\\core\\exceptions\\InvalidSessionDataException: The session data is missing, invalid, or corrupted. in /home/sites/aspconference.org.uk/public_html/wp-content/plugins/event-espresso-core-reg/core/EE_Session.core.php:607: /home/sites/aspconference.org.uk/public_html/wp-admin/admin-ajax.php aspconference.org.uk [Wed Sep 27 11:47:09 2017] [error] [client 62.232.214.6:45660] AH01215: #2 /home/sites/aspconference.org.uk/public_html/wp-includes/class-wp-hook.php(298): EE_Session->open_session(”): /home/sites/aspconference.org.uk/public_html/wp-admin/admin-ajax.php aspconference.org.uk [Wed Sep 27 11:47:09 2017] [error] [client 62.232.214.6:45660] AH01215: #0 /home/sites/aspconference.org.uk/public_html/wp-content/plugins/ aspconference.org.uk [Wed Sep 27 11:47:09 2017] [error] [client 62.232.214.6:45660] AH01215: #1 /home/sites/aspconference.org.uk/public_html/wp-content/plugins/event-espresso-core-reg/core/EE_Session.core.php(214): EE_Session->_espresso_session(): /home/sites/aspconference.org.uk/public_html/wp-admin/admin-ajax.php aspconference.org.uk [Wed Sep 27 11:47:09 2017] [error] [client 62.232.214.6:45660] AH01215: #4 /home/sites/aspconference.org.uk/public_html/wp-includes/plugin.php(453): WP_Hook->do_action(Array): /home/sites/aspconference.org.uk/public_html/wp-admin/admin-ajax.php aspconference.org.uk [Wed Sep 27 11:47:09 2017] [error] [client 62.232.214.6:45660] AH01215: #3 /home/sites/aspconference.org.uk/public_html/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(”, Array): /home/sites/aspconference.org.uk/public_html/wp-admin/admin-ajax.php aspconference.org.uk [Wed Sep 27 11:47:09 2017] [error] [client 62.232.214.6:45660] AH01215: #5 /home/sites/aspconference.org.uk/public_html/wp-content/plugins/event-espresso-core-reg/core/EE_System.core.php(945): do_ in /home/sites/aspconference.org.uk/public_html/wp-content/plugins/event-espresso-core-reg/core/EE_Session.core.php on line 607: /home/sites/aspconference.org.uk/public_html/wp-admin/admin-ajax.php Many thanks. |
There’s no ajax request with the PDF so that’s not causing the problem with the PDF’s but something is either altering or clearing sessions on your site. Is allow_url_fopen enabled on your server? You should be able to find that within Event Espresso -> Maintenance -> System Information and search for ‘allow_url_fopen’. Something is causing DOMPFP to fail on your server, the content of the PDF is actually there – http://take.ms/zsJDO Have PDF’s previously worked on that server? |
|
|
Hi Tony, This is what I get in the Espresso Maintenance window: allow_url_fopen I have used Booster for Woocommerce on this server and that generates PDFs and all worked correctly. I’m not sure if it used DOMPDF. Many thanks. |
That’s enabled but I think there is more going on, within the content of the PDF it shows it can’t find the image file for your logo (see the top of my screenshot) and the URL is valid. That usually happens when allow_url_fopen is disabled or the request is blocked, with DOMPDF all styles, font etc for the PDF’s are called in the same way images are so it’s likely a clue as to why the PDF is blank (although not a very helpful one).
Sorry, I meant if the EE PDF’s previously worked or have they always been like the above. Can you check with your hosts and have them confirm if the requests are hitting some form of security on the server, a mod_sec rule for example. Which PHP version are you running? |
|
|
Hi Tony, I’ve spoken with our provider and they confirmed that allow_url_open is enabled and that there aren’t any security settings stopping requests. The site is set to PHP 7, I did revert back to 5.6 for testing but no joy. Unfortunately, the PDF function hasn’t worked at any point thus far. Many thanks.
|
|
Hi Tony, I thought about Josh’s comment regarding another PDF plugin possibly causing issues so I’ve installed a plugin to print pages and posts to PDF. The PDF function is working and content is being added to the PDF. You can see the print button on this page: http://aspconference.org.uk/registration/ Does this help to find where the issue may be? Many thanks. |
No, as that plugin doesn’t appear to be using DOMPDF. Which plugin is it? Your site is currently using 4.9.45, can you update to the latest version (currently 4.9.46.p)? I’m assuming you haven’t modified any of EE’s files and don’t have any custom code running to modify EE templates etc?
|
|
|
Hi Tony, I’ve updated the plugins and still same result. I’ve not modified the standard files. Does the receipt/invoice page use a template I can integrate the new PDF plugin into? Just need to add some php to add button, then I should be able to use that function to output a PDF. Many thanks. |
|
Hi Tony, I’ve integrated the Free Print plugin with the receipt and invoice template. I can generate PDFs using the other system. Could you tell me if there’s a way of adding the javascript to the template so that it won’t be lost when the plugin is updated? The file I edited was: Espresso > Core > libraries > messages > defaults > html_main__wrapper.php Many thanks. |
Within that file you have multiple hooks available:
Are all fired before the body output, you likely want to use For example:
Then add the custom function to a Custom Functions Plugin on the site. |
|
|
Hi Tony, I tried that but got a blank page. I need to insert the link below into the template header: <script type=”text/javascript” src=”https://cdn.printfriendly.com/printfriendly.js”></script> Many thanks. |
If you’re getting a blank page you’re likely getting a fatal error, can you post your code to a gist or pastebin so I can view what you are doing? This works for me:
|
|
|
Ah my mistake, had a typo in there. Thanks for your help with this one Tony, I will mark it resolved. |
You’re most welcome 🙂 I’m glad it working for you. |
|
The support post ‘Blank PDF’ 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.