Jump to content

Invoice PDF - Transaction ID field too short


Recommended Posts

The Transaction ID field in the PDF invoice is a "Cell" meaning it can't wrap text. We use SagePay and get very long transaction IDs, which therefore overflow to the right & left, over-writing the other fields.

 

Solution is to change the field from "Cell" to "MultiCell" which will wrap text.

 

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

 

Find:

$pdf->Cell(40,6,$_LANG["invoicestransdate"],1,0,'C','1');
$pdf->Cell(50,6,$_LANG["invoicestransgateway"],1,0,'C','1');
$pdf->Cell(50,6,$_LANG["invoicestransid"],1,0,'C','1');
$pdf->Cell(40,6,$_LANG["invoicestransamount"],1,0,'C','1');

 

And replace with:

       
$pdf->MultiCell(40,10,$trans['date'],1,'C',false,0);
$pdf->MultiCell(50,10,$trans['gateway'],1,'C',false,0);
$pdf->MultiCell(50,10,$trans['transid'],1,'C',false,0);
$pdf->MultiCell(40,10,$trans['amount'],1,'C',false,0);

 

Please note that I've set the height to 10, as this allows 2 lines of text & suffices for my purpose. If you have longer IDs you may need to adjust.

 

Edith

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