Jump to content

Extra text on PDF invoices mis-aligned


isdoo

Recommended Posts

Okay - this has me stumped!! Could any suggest why this is happening. (It used to work fine until a version or two back and still is not correct in version 4.

 

This is part of the code that we have in place....

 


if ($status=="Cancelled") {
   $pdf->SetXY(10,225);
   $pdf->SetTextColor(0, 0, 205);
   $pdf->SetFont('Arial','B',6.5); # Use 6.5pt Text
   $pdf->MultiCell(180, 3, "Invoice Cancelled:", 0, 'L'); 
   $pdf->SetFont('Arial','',6.5); # Use 6.5pt Text
   $pdf->MultiCell(180, 3, "We have cancelled your invoice number $invoicenum.\n\nIf you have any queries, please email xxxxx@xxxx.com", 0, 'L'); 
} elseif ($status=="Paid") {
   $pdf->SetXY(10,225);
   $pdf->SetTextColor(0, 0, 205);
   $pdf->SetFont('Arial','B',6.5); # Use 6.5pt Text
   $pdf->MultiCell(180, 3, "Thank you for your payment:", 0, 'L'); 
   $pdf->SetFont('Arial','',6.5); # Use 6.5pt Text
   $pdf->MultiCell(180, 3, "Many thanks for your payment, which we have credited to your invoice number $invoicenum. \n\nIf you have any queries on your account please email xxxxx@xxxx.com", 0, 'L'); 

}

 

However the first line in each block is being displayed starting in the left margin, with the subsequent lines correctly displayed in line with the rest of the page.

 

It is not the 'B' that is throwing it out as in the unpaid section, I have addtional bold lines, which are inline with the rest of the text.

 

It is purely the first line that is shown further to the left.

 

I am baffled!

 

Thanks in advance.

Link to comment
Share on other sites

Try this

if ($status=="Cancelled") {
   $pdf->SetXY(10,225);
   $pdf->SetTextColor(0, 0, 205);
   $pdf->SetFont('Arial','B',6.5); # Use 6.5pt Text
   $pdf->MultiCell(180, 3, "Invoice Cancelled:", 0, 'L', 0, 2); 
   $pdf->SetFont('Arial','',6.5); # Use 6.5pt Text
   $pdf->MultiCell(180, 3, "We have cancelled your invoice number $invoicenum.\n\nIf you have any queries, please email xxxxx@xxxx.com", 0, 'L'); 
} elseif ($status=="Paid") {
   $pdf->SetXY(10,225);
   $pdf->SetTextColor(0, 0, 205);
   $pdf->SetFont('Arial','B',6.5); # Use 6.5pt Text
   $pdf->MultiCell(180, 3, "Thank you for your payment:", 0, 'L', 0, 2); 
   $pdf->SetFont('Arial','',6.5); # Use 6.5pt Text
   $pdf->MultiCell(180, 3, "Many thanks for your payment, which we have credited to your invoice number $invoicenum. \n\nIf you have any queries on your account please email xxxxx@xxxx.com", 0, 'L'); 

}

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