Processing of lines in PDF generation

Hello,

I did custom modification to App/Utils/Traits/MakesInvoiceValues.php to make position name with notes as one field separated by break-line. Code:

//in transformLineItems function, around 290 line
            $desc = is_null(optional($item)->product_key) ? $item->item : $item->product_key;
            $desc = $desc."\n".$this->processReservedKeywords($item->notes);
            $data[$key][$table_type.'.item'] = $desc;

I know you’re working on it too, but I really needed it, so I did it myself. Code was working up to now. After last update apparently it stopped working correctly. Text is overlapping in this field, screen:

image

Any idea, what changed in code? By adding more break-lines \n notes part is moving right from it, but I want it below. How should I force it to make another line in this field?

Hi,

@ben do you happen to know what may have caused this?

Note: in general we aren’t able to provide developer support

Mostly I want to get some hint about what to look about. I will try on my own to fix this, because this is my own modification after all.

Thanks for reaching us.
First of all, I’d check the source of the invoice.

Here’s how you can get the output: http://localhost:3000/docs/custom-fields/#getting-pdf-source-code

After some update I back to this thread and used “fast mode” to get HTML by inspection and I found that for text in td and column-width it is not expanding in height, but overlapping text with every break-line. Earlier it was overlapping with and without column-width style set. Really weird, it seems it was problem with CSS styles (some weird combination), not break-line processing.

Maybe it will help someone.