Support

Home Forums Event Espresso Premium Blank PDF

Blank PDF

Posted: September 25, 2017 at 9:32 am

Viewing 27 reply threads


foots

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
2) Checked server for errors – only one found for a different plugin. I’ve disabled the plugin and still no joy.
3) Validated the html with W3C and received an error for Duplicate ID total_currency. I changed the ID to total_currency-1 and no joy.
4) Went into Messages > Settings > PDF I don’t have any message types to select on this screen, is that correct?

Many thanks.


Josh

  • Support Staff

September 25, 2017 at 1:55 pm

That’s actually correct, as it explains:

This messenger is not currently used with any message types for templates but merely adds to the shortcodes available for templates on other messenger and message types.

You’ll find the Invoice message type under HTML settings.

Can you check to see if your web server meets the requirements listed here?


foots

September 26, 2017 at 2:10 am

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.


Tony

  • Support Staff

September 26, 2017 at 2:50 am

Can you link me to an event I use to run a registration?

I tried on a few but they require login.


foots

September 26, 2017 at 3:20 am

Hi Tony,

Thanks for taking a look, I’ve removed the login for this event: http://aspconference.org.uk/events/asp-conference-2018/


Tony

  • Support Staff

September 26, 2017 at 3:28 am

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/

  • This reply was modified 7 years ago by Tony.


foots

September 26, 2017 at 5:04 am

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.


Tony

  • Support Staff

September 26, 2017 at 5:12 am

Can you enable WP_Debug on the site so I can see if there are any errors within the PDF?


foots

September 26, 2017 at 5:15 am

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.


foots

September 26, 2017 at 5:16 am

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


Tony

  • Support Staff

September 26, 2017 at 5:33 am

When I click ‘Download PDF’ the browser downloads the pdf to disk. Is there an option to open the PDF in a new tab?

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.


foots

September 26, 2017 at 8:04 am

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.
I also regenerated the invoice from the Registrations menu and no luck.

Many thanks.


Josh

  • Support Staff

September 26, 2017 at 4:02 pm

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?


foots

September 27, 2017 at 4:45 am

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.


foots

September 27, 2017 at 4:50 am

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/
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: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.


Tony

  • Support Staff

September 27, 2017 at 5:28 am

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?


foots

September 27, 2017 at 5:34 am

Hi Tony,

This is what I get in the Espresso Maintenance window:

allow_url_fopen
global_value 1
local_value 1
access 4

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.


Tony

  • Support Staff

September 27, 2017 at 5:40 am

allow_url_fopen
global_value 1
local_value 1
access 4

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

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.

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?


foots

September 27, 2017 at 6:58 am

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.
You can check the PHP settings here: — removed —

Unfortunately, the PDF function hasn’t worked at any point thus far.

Many thanks.

  • This reply was modified 7 years ago by Tony.


foots

September 28, 2017 at 1:51 am

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/
when selecting PDF it adds all the data on the page.

Does this help to find where the issue may be?

Many thanks.


Tony

  • Support Staff

September 28, 2017 at 1:58 am

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?

  • This reply was modified 7 years ago by Tony.


foots

September 28, 2017 at 4:15 am

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.


foots

September 29, 2017 at 1:35 am

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.


Tony

  • Support Staff

September 29, 2017 at 2:27 am

Within that file you have multiple hooks available:

AHEE__EE_Html_Messenger_main_wrapper_template_head

AHEE__EE_Html_Messenger_main_wrapper_template_header

AHEE__EE_Html_Messenger_main_wrapper_template_before_main_body

Are all fired before the body output, you likely want to use AHEE__EE_Html_Messenger_main_wrapper_template_head

For example:

function custom_ee_html_wrapper_template_head( $message_type, $page_title, $base_css, $print_css, $main_css, $main_body ) {
    //your custom output
}
add_action( 'AHEE__EE_Html_Messenger_main_wrapper_template_head', 'custom_ee_html_wrapper_template_head', 10, 6 );

Then add the custom function to a Custom Functions Plugin on the site.


foots

September 29, 2017 at 2:36 am

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&gt;

Many thanks.


Tony

  • Support Staff

September 29, 2017 at 2:46 am

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:

function custom_ee_html_wrapper_template_head( $message_type, $page_title, $base_css, $print_css, $main_css, $main_body ) {
   echo '<script type="text/javascript" src="https://cdn.printfriendly.com/printfriendly.js"></script>';
}
add_action( 'AHEE__EE_Html_Messenger_main_wrapper_template_head', 'custom_ee_html_wrapper_template_head', 10, 6 );


foots

September 29, 2017 at 2:50 am

Ah my mistake, had a typo in there.

Thanks for your help with this one Tony, I will mark it resolved.


Tony

  • Support Staff

September 29, 2017 at 2:56 am

You’re most welcome 🙂

I’m glad it working for you.

Viewing 27 reply threads

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.

Event Espresso