Invoice Formatting

  • Tim Serr
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
4 years 10 months ago - 4 years 10 months ago #139048 by Tim Serr
Invoice Formatting was created by Tim Serr
Hey there, absolutely LOVE this extension! Fantastic work and robust functionality.

I am, however, experiencing issues with the PDF Invoice. I've searched the forums and documentation but can't seem to find an answer on best practices for creating the invoice.

I've used inline CSS in hopes this would be okay, but it seems not to be working.

I've attached 2 images: one with the desired outcome (parts of the invoice intentionally blurred) and the other after it's run through the PDF engine.

What are the limitations in HTML coding for the PDF to print correctly?

I'm using Membership Pro version 2.20.2.
Invoice Settings: PDF Font left on default of Times New Roman (I've also tried different fonts with no success)

Any help is appreciated!

Following is the code I inserted to create the desired Invoice:
Code:
<div style="max-width: 800px; margin: auto; padding: 30px; border: 1px solid #eee; box-shadow: 0 0 10px rgba(0, 0, 0, .15); font-size: 16px; line-height: 24px; color: #555;"> <table cellpadding="0" cellspacing="0" style="width: 100%; line-height: inherit; text-align: left;"> <tr style="padding-bottom: 20px;"> <td colspan="2" style="padding: 5px; vertical-align: top;"> <table style="width: 100%; line-height: inherit;"> <tr> <td style="font-size: 45px; line-height: 45px; color: #333; padding: 5px; vertical-align: top;"><img src="https://www.website.com/someimage.png" style="width: 100%; max-width: 300px;" /></td> <td style="text-align: right;">Invoice No: [INVOICE_NUMBER]<br /> Invoice Date: [INVOICE_DATE]<br /> Invoice Status: [INVOICE_STATUS]</td> </tr> </table> </td> </tr> <tr> <td colspan="2" style="padding: 5px; vertical-align: top;padding-bottom: 40px;"> <table style="width: 100%; line-height: inherit; text-align: left;"> <tr> <td style="padding: 5px; vertical-align: top;"> <p>Community Association<br />123 Main<br />City, Province&nbsp;&nbsp;<br /><a href="mailto:###" style="color: #daa550; text-decoration: none;">###</a></p> </td> <td style="padding: 5px; vertical-align: top; text-align: right;padding-bottom: 40px;">[NAME]<br />[ADDRESS]<br />[CITY], [STATE]&nbsp;&nbsp;[ZIP]<br />[EMAIL]</td> </tr> </table> </td> </tr> <tr style="background: #eee; border-bottom: 1px solid #ddd; font-weight: bold;"> <td style="padding: 5px; vertical-align: top;">Payment Method</td> <td style="padding: 5px; vertical-align: top; text-align: right;">Transaction ID</td> </tr> <tr style="padding-bottom: 20px;"> <td style="padding: 5px; vertical-align: top;">[PAYMENT_METHOD]</td> <td style="padding: 5px; vertical-align: top; text-align: right;">[TRANSACTION_ID]</td> </tr> <tr style="background: #eee; border-bottom: 1px solid #ddd; font-weight: bold;"> <td style="padding: 5px; vertical-align: top;">Item</td> <td style="padding: 5px; vertical-align: top; text-align: right;">Price</td> </tr> <tr style="border-bottom: none;"> <td style="padding: 5px; vertical-align: top;">[ITEM_NAME]</td> <td style="padding: 5px; vertical-align: top; text-align: right;">[ITEM_AMOUNT]</td> </tr> <tr style="border-top: 2px solid #eee; font-weight: bold;"> <td style="padding: 5px; vertical-align: top;">&nbsp;</td> <td style="border-top: 2px solid #eee; padding: 5px; vertical-align: top; text-align: right;">Total: [TOTAL_AMOUNT]</td> </tr> </table> </div>
Last edit: 4 years 10 months ago by Tim Serr.

Please Log in or Create an account to join the conversation.

More
4 years 10 months ago #139052 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Invoice Formatting
Hello Tim

We are using TCPDF library ( tcpdf.org ) to generate invoice. Unfortunately, support for css is limited and they also do not have any clear documentation for it, so I'm also unsure what css code is supported. If you want, you can submit a support ticket sending us super admin account of your site

I will ask my developer to look at it and try to help you with the PDF layout (basically, we will need to make change, try and check the result to make sure it works)

Tuan

Please Log in or Create an account to join the conversation.

  • Tim Serr
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
4 years 10 months ago #139053 by Tim Serr
Replied by Tim Serr on topic Invoice Formatting
Thanks Tuan for the quick reply. It’s much appreciated and really appreciate your willingness to look at my site.

Unfortunately the site I’m testing on right now is hosted locally on my server (i.e., localhost). I can deploy it to a test server you can access but I won’t be able to do that until after the weekend if that’s okay?

I suspect no matter the Joomla configuration this may be an issue with CSS not being recognized by the PDF plug in. I’m not sure deploying a sandbox will resolve the issue but I’d certainly love to have you look at it to see if you could come up with a workaround.

Tim

Please Log in or Create an account to join the conversation.

More
4 years 10 months ago #139055 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Invoice Formatting
Hi Tim

This is not related to Joomla configuration or server configuration. It's just how TCPDF generates PDF file . Basically, PDF, unlike HTML, is quite difficult to adjust the layout, css, which is supported in HTML is very likely not supported in PDF

So Yes, you can setup your site to a public accessible server so that I can ask my developer to look at it and hopefully can help you

Regards,

Tuan

Please Log in or Create an account to join the conversation.

  • Tim Serr
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
4 years 10 months ago #139063 by Tim Serr
Replied by Tim Serr on topic Invoice Formatting
Hi Tuan. I've opened a Support Ticket with you (ticket number 105538) which contains access to my sandbox site.

Thanks again!
Tim

Please Log in or Create an account to join the conversation.

More
4 years 10 months ago #139074 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Invoice Formatting
Thanks Tim. We will check and reply you via support ticket (actually, my developer already replied)

Tuan
The following user(s) said Thank You: Tim Serr

Please Log in or Create an account to join the conversation.

  • Tim Serr
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
4 years 10 months ago #139078 by Tim Serr
Replied by Tim Serr on topic Invoice Formatting
Yes! Thanks so much, everything is printing the way it should. Just a few tweaks to get it right, but thanks taking a look at it...fantastic!

Tim

Please Log in or Create an account to join the conversation.

More
4 years 10 months ago #139082 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Invoice Formatting
Great. Happy to hear that. Please continue setting up and using the extension. If you have questions or need help, please don't hesitate to ask us

Tuan

Please Log in or Create an account to join the conversation.