Topic: Item Description Wrapping Problem on PDF Invoice

I am having a problem with long item descriptions not wrapping whole words.
For example it will just put 50 characters per line then chop words in half and put them on the next line.
I can't seem to find the php function which is causing this and how can it be fixed.
I use the item description to enter in what I did for the labour portition of my job.

Re: Item Description Wrapping Problem on PDF Invoice

For Sales invoice, /reporting/rep107.php. Line 131, you se a line:

$rep->TextColLines(1, 2, $myrow2['StockDescription'], -2);

This function wraps the lines between column 1 and 2 (0 based). If the description part can not fit, it will scale some of the text.
You can try to use

$rep->TextColLines(1, 2, $myrow2['StockDescription'], -2, 0, 0, 0, null, 0);

instead and see if it helps. It will not scale the text.

/Joe

Re: Item Description Wrapping Problem on PDF Invoice

Well that fixed my other problem i was having where the last line of text of the wrapped description would be stretched out and the other lines had smaller font.

But it still cuts words in half for instance this is one of my descriptions:

Connected to second computer and w
aited for data to copy over. Put HDD bac
k into server and packaged up for the cou
rier.

Why cant it be made to look like this:

Connected to second computer and
waited for data to copy over. Put HDD
back into server and packaged up for
the courier.

It just seems to ignore the spaces and just chops the line at 50 characters.
I've been looking and found a php function that can wrap lines of text at the last space so can this be changed in FrontAccounting.

Re: Item Description Wrapping Problem on PDF Invoice

I guess you encountered a bug. A default parameter ($spacereak) was missing in the routine. The default parameters were changed a while ago, and this side-effect appeared. Fixed in CVS main. You can also download the file /reporting/includes/pdf_report.inc here:



You can change the TextColLines function back to what it was before. Now it will not stretch now.

/Joe

Re: Item Description Wrapping Problem on PDF Invoice

Thank You so much Joe.

That is exactly what I needed no more having to go into the MYSql and add spaces to make everything look good.