3

We've recently started using CiviCRM and CiviEvent but have found that the confirmation PDFs attached to confirmation emails are cutting off text and not appearing properly.

This is what they look like when I download the confirmation PDF that CiviEvent automatically generates.

page 1 of confirmation email page 2 of confirmation email

Can anyone please advise how we can fix this?

Cheers

  • Hi Josh - welcome to CiviCRM on StackExchange. It could be that your PDF settings are for a different paper size than the one you are using which you could verify at /civicrm/admin/pdfFormats?reset=1 – petednz - fuzion Dec 4 '18 at 4:38
  • @petednz-fuzion thanks for your reply! I tried this before - originally there were no PDF settings saved, and then I input new settings with the "letter" paper size (checking the dimensions were correct). Tried registering again but the new confirmation PDF still came through the same as before. – josh Dec 4 '18 at 5:11
1

Josh - By the look of the invoice, it seems the width isn't adjusted correctly in your pdf file. Civi normally assigns width statically to the table added in the message templates. So my first attempt would be to either remove the width attribute from the <table> element and test the pdf receipts OR modify the width in the table tag to some other value and see if the issue gets fixed.

Eg. the event online receipt template seems to be adding the table as -

<table width="700" border="0" cellpadding="0" cellspacing="0" id="crm-event_receipt" style="font-family: Arial, Verdana, sans-serif; text-align: left;">

Check by removing the width attribute from the above line and see if the pdf content is correctly adjusted in the document.

Note that the width you change in the table element also reflects in the email received to the users. So better to first check this in a dev environment.

  • thank you! Changing it to a different number did the trick. For anyone who comes across this in the future, the code to adjust table width is found in /civicrm/admin/messageTemplates?reset=1 -> System Workflow Messages -> Events - Registration Confirmation and Receipt (on-line). – josh Dec 4 '18 at 22:59
  • cool - you may also see changes in your receipt email too. If you just want to limit it for pdf attachment - you can specify the removal of the width attribute in extension by writing a hook - docs.civicrm.org/dev/en/latest/hooks/… might help you with the same. – jitendra - fuzion Dec 5 '18 at 2:45
1

I've often found good luck by switching to wkhtmltopdf. It's written in a coding language that makes it tough to distribute directly with CiviCRM, but takes a few minutes for someone who knows what they're doing to install. Someone posted wkhtmltopdf instructions here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.