Support

Home Forums Event Espresso Premium download pdf / receipt doesn't have layout

download pdf / receipt doesn't have layout

Posted: September 12, 2016 at 4:21 am

Viewing 17 reply threads


mark tollenaere

September 12, 2016 at 4:21 am

hi,
the pdf generated after clicking ‘download pdf’ has no lay-out

Example:
http://schoolvoorrelaties.mmdev.be/wp-content/uploads/2016/09/School-Voor-Relaties-Receipt-for-Transaction_-252-2.pdf

  • This reply was modified 8 years ago by Tony.
  • This reply was modified 8 years ago by Tony. Reason: Merged


mark tollenaere

September 12, 2016 at 4:21 am

hi,
the pdf generated after clicking ‘download pdf’ has no lay-out


mark tollenaere

September 12, 2016 at 4:24 am

also some string are not translated, although there is a translation available in the translation file (PO)

example
http://schoolvoorrelaties.mmdev.be/wp-content/uploads/2016/09/School-Voor-Relaties-Receipt-for-Transaction_-252-2.pdf

thanks!


Tony

  • Support Staff

September 12, 2016 at 6:31 am

Hi Mark,

Can you check with your hosting provide if allow_url_fopen has been disabled on your server?

DOMPDF requires allow_url_fopen is enabled to pull in the styles and images for the PDF, your PDF’s have no images or styling applied so it looks like the server has the above disabled.

also some string are not translated, although there is a translation available in the translation file (PO)

Message templates are generate and saved to the database when you first activate EE, if the MO (not PO) file is in place when that happened the translations will be applied at the time of generating the template.

As the template is then saved to the database the translations are not applied on the fly if you change them later. To do that you need to force EE to regenerate the message again by ‘resetting’ the template whilst the translation is in place.

To do that you go to:

Event Espresso -> Messages -> Default message templates -> Receipt.

Edit the template and look within the side bar, you’ll see a ‘Reset Templates’ button in the sidebar. You will lose any customization’s made to the template but EE will regenerate it and apply any translations you had added.

Not you may also need to the same with the Invoice template.


mark tollenaere

September 12, 2016 at 7:01 am

Ok thanks,
I managed to get the translation!

but the allow_url_fopen was enabled,
so that couldn’t be the problem for the pdf lay-out problem…

could it be something else?

tnx!
Lieven


Tony

  • Support Staff

September 12, 2016 at 8:11 am

Can you enable WP_Debug on the server and add a link here I can use to download the Receipt and Invoice please?

Check your servers error logs for any errors when downloading the pdf. Get_image_size () errors for example.


mark tollenaere

September 12, 2016 at 9:42 am

Hi Tony,

Ok, I’ll ask a collegue to do that tomorrow (that’s not my cup of tea)
although I read somewhere about ithemes security blocking allow_url_fopen. So I disabled it, and activated it again. (the .htaccess stuff is a lot less I think)
now the invoice pdf is generated correctly
but the receipt is causing this:
Fatal error: Uncaught exception ‘DOMPDF_Exception’ with message ‘Frame not found in cellmap’ in /usr/www/users/mmadmin/schoolvoorrelaties/wp-content/plugins/event-espresso-core-reg/core/third_party_libs/dompdf/include/cellmap.cls.php:212 Stack trace: #0 /usr/www/users/mmadmin/schoolvoorrelaties/wp-content/plugins/event-espresso-core-reg/core/third_party_libs/dompdf/include/table_cell_renderer.cls.php(51): Cellmap->get_spanned_cells(Object(Table_Cell_Frame_Decorator)) #1 /usr/www/users/mmadmin/schoolvoorrelaties/wp-content/plugins/event-espresso-core-reg/core/third_party_libs/dompdf/include/renderer.cls.php(283): Table_Cell_Renderer->render(Object(Table_Cell_Frame_Decorator)) #2 /usr/www/users/mmadmin/schoolvoorrelaties/wp-content/plugins/event-espresso-core-reg/core/third_party_libs/dompdf/include/renderer.cls.php(117): Renderer->_render_frame(‘table-cell’, Object(Table_Cell_Frame_Decorator)) #3 /usr/www/users/mmadmin/schoolvoorrelaties/wp-content/plugins/event-espresso-core-reg/core/third_party_libs/dompdf/include/render in /usr/www/users/mmadmin/schoolvoorrelaties/wp-content/plugins/event-espresso-core-reg/core/third_party_libs/dompdf/include/cellmap.cls.php on line 212

thanks
Lieven


Tony

  • Support Staff

September 12, 2016 at 1:32 pm

Fatal error: Uncaught exception ‘DOMPDF_Exception’ with message ‘Frame not found in cellmap’

That happens when you have invalid HTML within your template, have you modified the template at all?


mark tollenaere

September 13, 2016 at 1:41 am

Ok thanks
by elimination I found it was the colspan=”2″ in

<tr class=”item”>
<td>[LINE_ITEM_NAME][LINE_ITEM_TAXABLE_*]</td>
<td colspan=”2″>[LINE_ITEM_DESCRIPTION]
<p class=”ticket-note”>Dit ticket kan eenmaal worden gebruikt om [TKT_USES_* schema=ieder] van de data/tijden hieronder.</p>
</td>
<td class=”item_c”>[LINE_ITEM_QUANTITY]</td>
<td class=”item_c”>[LINE_ITEM_AMOUNT]</td>
<td class=”item_r”>[LINE_ITEM_TOTAL]</td>
</tr>

removed it and added a <td></td>… looks ok in html –> a bit weird in the pdf

is there a way to make this colspan=”2″ work again?

thanks
Lieven


Tony

  • Support Staff

September 13, 2016 at 5:32 am

is there a way to make this colspan=”2″ work again?

colspan="2" should work fine.

However looking at the example posted it looks like you have different formated ”

colspan=”2″

Note the and its likely the formatted quotation marks breaking DOMPDF.


mark tollenaere

September 15, 2016 at 5:07 am

strange…
tried different ” ‘ … copy pasting… still keeps having trouble when I add this colspan=”2″

<tr class=”item”>
<td>[LINE_ITEM_NAME][LINE_ITEM_TAXABLE_*]</td>
<td colspan=”2″>[LINE_ITEM_DESCRIPTION]
<p class=”ticket-note”>Dit ticket kan eenmaal worden gebruikt op [TKT_USES_* schema=ieder] van de data/tijden hieronder.</p>
</td>
<td class=”item_c”>[LINE_ITEM_QUANTITY]</td>
<td class=”item_c”>[LINE_ITEM_AMOUNT]</td>
<td class=”item_r”>[LINE_ITEM_TOTAL]</td>
</tr>


Tony

  • Support Staff

September 15, 2016 at 5:31 am

Why have you removed the classes from the elements?

You could try:

<td class="item_I" colspan="2">[LINE_ITEM_DESCRIPTION]</td>

DOMPDF is much more strict (read fussy) on what it allows within the HTML structure, you’ll need to follow the current template and find what works for your customizations.


mark tollenaere

September 15, 2016 at 6:28 am

It’s the default template… we didn’t change is. I did a template reset and it still the same as above …


Tony

  • Support Staff

September 15, 2016 at 6:30 am

Which section are you looking at?

Can you post a screenshot:

https://eventespresso.com/wiki/troubleshooting-checklist/#screenshots


mark tollenaere

September 15, 2016 at 6:44 am

Hi Tony,
http://schoolvoorrelaties.mmdev.be/wp-content/uploads/2016/09/Schermafbeelding-2016-09-15-om-14.39.13.png

[TICKET_LINE_ITEM_LIST]

I removed the colspan=”2″ and added a <td></td> to make it work for now

tnx
Lieven


Lorenzo Orlando Caum

  • Support Staff

September 15, 2016 at 9:40 am

Hi Lieven,

Was the styling issue resolved after your most recent changes?


Lorenzo


Tony

  • Support Staff

September 15, 2016 at 10:05 am

My apologies, for some reason I had the Invoice template on my mind rather than the Receipt template.

Can you link me to an event I can view this on please?


mark tollenaere

September 16, 2016 at 1:12 am

http://schoolvoorrelaties.mmdev.be/trainingen/basismodule-relateren-zo_-code-b49/

http://schoolvoorrelaties.mmdev.be/?ee=msg_url_trigger&snd_msgr=html&gen_msgr=html&message_type=receipt&context=purchaser&token=1-49abf6e5c92205969db51f1f9df074a5&GRP_ID=1&id=480

do I need to reset the code with the colspan?

tnx!
Lieven


Tony

  • Support Staff

September 21, 2016 at 8:49 am

Hi Lieven,

I’ve been running some testing on this and so far have been unable to reproduce.

I also pulled the latest Dutch translations from:

https://translate.eventespresso.com/projects/event-espresso-4/nl/event-espresso-nl_NL

and reset my receipt template to confirm it wasn’t an issue with the translations, again that worked fine.

This seems unique to your server but I can’t see why.

Do you have any other plugins that create PDFs? I’m wondering if an unexpected version of DOMPDF is being used.

Viewing 17 reply threads

The support post ‘download pdf / receipt doesn't have layout’ 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