Jump to content

PDF Invoice - Company Address Cut Off


Recommended Posts

The PDF Invoice uses the customers' address as guideline as to how many lines of text are shown. As result, if the company address is longer than the customer address, it is cut off.

 

We use 7 lines in our address & have done this simple solution:

 

In your template folder, find the file invoicepdf.tpl.

 

Find the code:

 

if ($customfields) {
   foreach ($customfields AS $customfield) {
       $pdf->Cell(88,4,$customfield['fieldname'].': '.$customfield['value'],'LR');
       $pdf->Cell(4,4,'');
       $pdf->Cell(88,4,$companyaddress[$ci],'LR');$ci++;
       $pdf->Ln();
   }
} 

 

And below add:

 

// We need to ensure that our address shows in full (we use 7 lines)
while ($ci < 7) {
   $pdf->Cell(88,4,'','LR');
   $pdf->Cell(4,4,'');
   $pdf->Cell(88,4,$companyaddress[$ci],'LR');$ci++;
   $pdf->Ln();   
}

 

NB: Please note that you need to change the number of lines to the ones you use. The company address is set in your WHMCS admin under "Set UP -> General Settings -> "Pay To Text".

 

Edith

Link to comment
Share on other sites

  • WHMCS CEO

This is a tricky one as there's a lot of variation in what people put in that field, but addresses longer than 5 or 6 lines are unusual so for the current default templates we took the decision to support up to 5 lines by default. We'll look into if there's a better way of handling this with a multi-line cell maybe.

 

Matt

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated