Jump to content

Strange justified alignment in delivery slips with tcpdf


Recommended Posts

Hi,

I'm using tcpdf instead of fpdf because of the need of diacritics.
The invoice looks fine, but the delivery slip has a strange alignment for product name - justified from left to right, pls. see attachment.
version 1.2.5

Any ideea what or where to change this ?

Thank you,

justified.pdf

Link to comment
Share on other sites

Hi,
in classes/PDF.php try to add align attribute ('L') - replace one line (around line 652):

$this->MultiCell($w[++$i], 5, Tools::iconv('utf-8', self::encoding(), $product['product_name']), 'B');


with:

$this->MultiCell($w[++$i], 5, Tools::iconv('utf-8', self::encoding(), $product['product_name']), 'B', 'L');



It worked for me. I see also line with product name around line 636, you can check also there.

Link to comment
Share on other sites

  • 1 year later...

Hi,

in classes/PDF.php try to add align attribute ('L') - replace one line (around line 652):

$this->MultiCell($w[++$i], 5, Tools::iconv('utf-8', self::encoding(), $product['product_name']), 'B');

with:

$this->MultiCell($w[++$i], 5, Tools::iconv('utf-8', self::encoding(), $product['product_name']), 'B', 'L');

It worked for me. I see also line with product name around line 636, you can check also there.

 

Excellent Answer!!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...