Support

Home Forums Event Espresso Premium PDF Invoice by default is poorly formatted

PDF Invoice by default is poorly formatted

Posted: November 4, 2014 at 8:48 am


Greg Brailsford

November 4, 2014 at 8:48 am

Hi,

There seems to be an issue with your PDF invoice. The formatting is quite unprofessional and unpolished. All text is flushed against the left border of the page rather than having a normal margin as one would expect.

The logo does not display, despite it being properly set in the Invoice payment method options screen (and it shows on that screen so we know it took it fine).

Totals are not flush right as they are on every invoice I’ve ever seen.

Changing the CSS style sheet to any of the 7 options provided has absolutely no effect. They all come out plain with the unpolished formatting as outlined above.

So my question is: Is there a bug in my install that is causing this or is this really the way it’s supposed to look? Because if this is the way it’s supposed to look, that isn’t cool at all.


Lorenzo Orlando Caum

  • Support Staff

November 4, 2014 at 10:13 am

Hi Greg,

Could you let us know the version of Event Espresso that you are using so we can share some feedback?


Lorenzo


Greg Brailsford

November 4, 2014 at 10:15 am

4.4.4


Tony

  • Support Staff

November 4, 2014 at 11:14 am

The default Invoice template should look something like this – http://take.ms/BSSoM

I notice the site is using SSL, how are you securing the pages?

If using a plugin can you tell me which one and also if you are securing all pages?


Greg Brailsford

November 4, 2014 at 1:20 pm

OK yeah – our invoice looks nothing like that. Could very well be an SSL issue – thought this would be our first incompatibility with the plugin we use:

It’s called WordPress HTTPS (https://wordpress.org/plugins/wordpress-https/). It’s the most popular one for the task.


Lorenzo Orlando Caum

  • Support Staff

November 4, 2014 at 2:01 pm

Hi,

Could you share some screenshots of your WP HTTPS settings?

We’ve tested the current version of Event Espresso 4.4.4 along with the current version of WP HTTPS and it works:

http://cl.ly/image/2T2V1z161C0P

I’ve also tested with the force SSL settings (only changes made to WP HTTPS) for the registration checkout page and the thank you page.

You can upload these screenshots to a free service like Getcloudapp.com or Tinygrab.com and then link to them here.

Thanks


Lorenzo


Greg Brailsford

November 4, 2014 at 9:46 pm

I can’t share screenshots of the website on a public forum because of NDA but the WP HTTPS settings are at default. SSL Host is set to the pre-filled domain name of the site. Force SSL Exclusively is checked. Everything else is unchecked and at default.

The Order confirmation page is formatted correctly and looks fine. But clicking ‘Download PDF’ produces the train wreck I described. Not sure that should even be related to HTTPS since the system is creating the file before it transmits it, thus rendering https/http irrelevant.


Sidney Harrell

November 5, 2014 at 10:31 am

There could be a problem with the CSS files not being included due to a problem with the ssl connection. It could also be a permissions issue with the css files, or a php security setting. Do you have any apache, php, or WP logging enabled that you can view?


Greg Brailsford

November 5, 2014 at 10:45 am

Absolutely. We’re on an nginx server, for what it’s worth. Here is the PHP log when we attempt an invoice download:

11/5/2014 10:04:07 AM – www: PHP Warning: getimagesize(http://www.[redacted].com/wp-content/uploads/Black-on-white-field-logo.png): failed to open stream: no suitable wrapper could be found in /var/www/[redacted].com/wp-content/plugins/event-espresso-core-reg/modules/gateways/Invoice/lib/Invoice.class.php on line 237

11/5/2014 10:04:07 AM – www: PHP Warning: getimagesize(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /var/www/[redacted].com/wp-content/plugins/event-espresso-core-reg/modules/gateways/Invoice/lib/Invoice.class.php on line 237

11/5/2014 10:04:07 AM – www: PHP Warning: getimagesize(http://www.[redacted].com/wp-content/uploads/Black-on-white-field-logo.png): failed to open stream: no suitable wrapper could be found in /var/www/[redacted].com/wp-content/plugins/event-espresso-core-reg/modules/gateways/Invoice/lib/Invoice.class.php on line 237

11/5/2014 10:04:07 AM – www: PHP Warning: getimagesize(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /var/www/[redacted].com/wp-content/plugins/event-espresso-core-reg/modules/gateways/Invoice/lib/Invoice.class.php on line 237

11/5/2014 10:04:07 AM – www: PHP Warning: getimagesize(http://www.[redacted].com/wp-content/uploads/Black-on-white-field-logo.png): failed to open stream: no suitable wrapper could be found in /var/www/[redacted].com/wp-content/plugins/event-espresso-core-reg/modules/gateways/Invoice/lib/Invoice.class.php on line 237

11/5/2014 10:04:07 AM – www: PHP Warning: getimagesize(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /var/www/[redacted].com/wp-content/plugins/event-espresso-core-reg/modules/gateways/Invoice/lib/Invoice.class.php on line 237

—-

I hope that helps your diagnosis.


Lorenzo Orlando Caum

  • Support Staff

November 5, 2014 at 10:53 am

Hi Greg,

Is fopen enabled on the server?

http://php.net/manual/en/function.fopen.php


Lorenzo


Greg Brailsford

November 5, 2014 at 11:02 am

We use a managed hosting service so they do everything for us. Is that exactly what I should ask them, “Is fopen enabled? And if not can you enable it?” If so I’ll get it done.


Greg Brailsford

November 5, 2014 at 12:04 pm

I spoke to my web hosting company, and they responded:

You will want to verify with the plugin author that it does not require the exec() / exec.php or url_fopen functions, as both of those have been disabled on Synthesis hosting for security reasons.

We do support CURL as an alternative to url_fopen. Your plugin author should know if they are using these functions or not.


Tony

  • Support Staff

November 5, 2014 at 1:42 pm

The DOMPDF library (which Event Espresso uses to generate the PDF’s) uses url_fopen functions and needs allow_url_fopen set to on in order to function correctly.

I tested disabling fopen on a live server and see exactly the same issue with invoices as you do in that no styles are applied.


Greg Brailsford

November 5, 2014 at 2:03 pm

OK – so I guess we have two options then:

1) Is there alternate way to make it work? If so, let’s do that.
2) If not, how can I hide the PDF download option? My client definitely doesn’t want to offer an embarassing-looking PDF and would prefer none at all.

Our host is very well-known and one of the best at WP managed hosting. If they have it disabled for security, there’s probably a good reason why.


Lorenzo Orlando Caum

  • Support Staff

November 5, 2014 at 2:58 pm

Hi,

I have a proof of concept for a workaround that shifts the PDF generation to another service. Do you have a staging site available for this host?

I don’t need to see the live site, rather I need temporary access to a WP site on your host that has fopen disabled to confirm.

If this is available, then please share a temporary SFTP and temporary WP-admin login via this link:

https://eventespresso.com/send-login-details/


Lorenzo


Lorenzo Orlando Caum

  • Support Staff

November 5, 2014 at 3:55 pm

Hi,

There are two options available:

1) The link can be hidden from the thank you page but this is wrapped in a div which will also remove surrounding information such as the instructions for the invoice (e.g. please mail payment to this address).

2) You can try the Event Espresso 4.5 pre-release and follow these steps:

https://gist.github.com/lorenzocaum/96f47b234b5e40fb30c4

It launches the invoice in a browser window instead of downloading it immediately. Additionally, it uses a third-party service called PrintFriendly instead of DOMPDF which needs fopen.


Lorenzo


Greg Brailsford

November 5, 2014 at 8:38 pm

Lorenzo,

I take it that your proof of concept from your prior message is bundled into 4.5? If so, I’d be happy to try it…here’s the thing: the last time I tried installing a pre-release onto a site that already had a regular release and installed them as two distinct plugins and caused all sorts of license issues culminating with Garth having to reset my license. So if there’s a way to install this pre-release where it simply replaces the existing version, I’m all for it. Let me know. Otherwise if there is code I can modify or file(s) I can replace to engage the new PDF methodology, I can do that too.

Greg


Lorenzo Orlando Caum

  • Support Staff

November 6, 2014 at 8:41 am

Hi,

You’ll need the 4.5 pre-release as that has a template for the invoice that is managed through the WordPress dashboard.

Also, you should not update by overwriting files, rather remove the prior version or relocate it one step above the wp-content/plugins folder and then install the pre-release.

Other option for 4.4.4

The other option is to hide the div that holds the invoice link by linking its class to display:none. However, this will also remove the invoice payment instructions.


Lorenzo


Greg Brailsford

November 6, 2014 at 10:12 am

Lorenzo,

OK – I followed your instructions, migrated my 4.4 data to 4.5. At first glance, everything seems to have migrated fine. I went through the registration process, downloaded the PDF – and unfortunately, it looks exactly the same.

Is the PDF download supposed to work correctly now or does the pre-release simply give an option to remove the PDF Download button by editing the invoice?


Josh

  • Support Staff

November 6, 2014 at 10:55 am

The Pre-release gives you the ability to remove the PDF download button by editing the invoice. In 4.5, you can edit the invoices and receipts in the same manner as Email message templates, right from the WordPress admin.


Greg Brailsford

November 6, 2014 at 1:30 pm

I see and was able to do that. Perfect! Thanks.

The support post ‘PDF Invoice by default is poorly formatted’ 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.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  Greg Brailsford 5 years, 1 month ago ago

Topic Tags

Tagged: 

Notifications

This topic is: resolved
Do NOT follow this link or you will be banned from the site!