# On orders my company details spread outside the from box :-(

**URL:** <https://www.dolibarr.org/forum/t/on-orders-my-company-details-spread-outside-the-from-box/24313>\
**Category:** CRM/SRM Modules\
**Tags:** v18\
**Created:** [September 21, 2023, 8:44pm UTC](https://www.dolibarr.org/forum/t/on-orders-my-company-details-spread-outside-the-from-box/24313 "2023-09-21T20:44:34Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonbendtsen](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jonbendtsen](https://www.dolibarr.org/forum/u/jonbendtsen)\
**Post date:** [September 21, 2023, 8:44pm UTC](https://www.dolibarr.org/forum/t/on-orders-my-company-details-spread-outside-the-from-box/24313/1 "2023-09-21T20:44:34Z")

</div>

On orders my company details spread outside the from box ☹

How do I fix that?

![outside_address_box](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/a/a518cf709fc76c7057346b12498202d652f8f121.png)

---

<div class="post-metadata">

**Author:** ![sonikf](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/s/97f17d/32.png) [@sonikf](https://www.dolibarr.org/forum/u/sonikf)\
**Post date:** [September 21, 2023, 9:01pm UTC](https://www.dolibarr.org/forum/t/on-orders-my-company-details-spread-outside-the-from-box/24313/2 "2023-09-21T21:01:11Z")

</div>

Hi!  
Which pdf model do you use?

---

<div class="post-metadata">

**Author:** ![jonbendtsen](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jonbendtsen](https://www.dolibarr.org/forum/u/jonbendtsen)\
**Post date:** [September 21, 2023, 9:10pm UTC](https://www.dolibarr.org/forum/t/on-orders-my-company-details-spread-outside-the-from-box/24313/3 "2023-09-21T21:10:12Z")

</div>

right, that is important information, sorry I forgot to add it.

I actually tried all 3 built in  
proforma  
eratosthene  
einstein

and they all have the same issue.

---

<div class="post-metadata">

**Author:** ![sonikf](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/s/97f17d/32.png) [@sonikf](https://www.dolibarr.org/forum/u/sonikf)\
**Post date:** [September 21, 2023, 9:22pm UTC](https://www.dolibarr.org/forum/t/on-orders-my-company-details-spread-outside-the-from-box/24313/4 "2023-09-21T21:22:48Z")

</div>

I suggest you use eratosthene is the newest.  
Proforma is well for proforma invoices!  
You can modify core/modules/commande/doc/pdf\_eratosthene.modules.php  
search for // Show sender and in the sections below you can modify positions.  
You should also make a module after so as not to break your modifications with upgrades.

---

<div class="post-metadata">

**Author:** ![ksar](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/ksar/32/514_2.png) [@ksar](https://www.dolibarr.org/forum/u/ksar)\
**Post date:** [September 22, 2023, 6:14am UTC](https://www.dolibarr.org/forum/t/on-orders-my-company-details-spread-outside-the-from-box/24313/5 "2023-09-22T06:14:53Z")

</div>

Hello,

> [@jonbendtsen](#):
>
> ![outside_address_box](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/a/a518cf709fc76c7057346b12498202d652f8f121.png)

What is strange, is that you are not supposed to have 2 blank spaces, but only one :  
 ![image](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/f/ff1c54c5281af0425abe9dd594a83c7acd637a18.png)

How the company configuration is made ?

---

<div class="post-metadata">

**Author:** ![jonbendtsen](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jonbendtsen](https://www.dolibarr.org/forum/u/jonbendtsen)\
**Post date:** [September 23, 2023, 6:45am UTC](https://www.dolibarr.org/forum/t/on-orders-my-company-details-spread-outside-the-from-box/24313/6 "2023-09-23T06:45:17Z")

</div>

I do not see any extra newlines in the company definition, and I also checked using arrow keys to move around in the boxes.

![dolibarr_company_definition](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/5/52dc4ac0ef871fa5c049404771bbef46265a5847.png)

---

<div class="post-metadata">

**Author:** ![jonbendtsen](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jonbendtsen](https://www.dolibarr.org/forum/u/jonbendtsen)\
**Post date:** [October 8, 2023, 8:13am UTC](https://www.dolibarr.org/forum/t/on-orders-my-company-details-spread-outside-the-from-box/24313/7 "2023-10-08T08:13:45Z")

</div>

I might have tracked it down.

I’m also seeing it on orders, but for the recipient.

I’m using 1 big address field because I find it much easier for customers to fill out, and I don’t particular need to know where they are from, because I am using dolibarr to sell dance classes and workshops in our nonprofit, so we will never ship anything physical anyway. But we do need to know who our members and customers are.

Anyway, what I am seeing in the json for the address field is this:

```
"address": "Streetname\r\nPostal\r\nDenmark",

```

Notice all those \r and \n? Maybe I get an empty line because both the \r and \n are being translated to a newline?

![order_with_blank_lines_in_address](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/5/520e41073d515cd18114071a0ae9d26301ade893.png)

I’ll now go test it.

---

<div class="post-metadata">

**Author:** ![jonbendtsen](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jonbendtsen](https://www.dolibarr.org/forum/u/jonbendtsen)\
**Post date:** [October 8, 2023, 8:32am UTC](https://www.dolibarr.org/forum/t/on-orders-my-company-details-spread-outside-the-from-box/24313/8 "2023-10-08T08:32:14Z")

</div>

> [@jonbendtsen](#):
>
> `"Streetname\r\nPostal\r\nDenmark"`

YES, this \r seems to be the culprit.

When I stripped out \r before using the API to insert the address field, then I do not get any empty lines.

“address”: “STREETNAME\nPOSTAL\nDenmark”,

---

<div class="post-metadata">

**Author:** ![jonbendtsen](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jonbendtsen](https://www.dolibarr.org/forum/u/jonbendtsen)\
**Post date:** [October 8, 2023, 8:46am UTC](https://www.dolibarr.org/forum/t/on-orders-my-company-details-spread-outside-the-from-box/24313/9 "2023-10-08T08:46:17Z")

</div>

Looking at the json from API → Setup → GET /setup/company I see \r\n.

“address”: “c/o Jon Bendtsen\r\nSTREETNAME”,

I used the GUI to create the address, I did not inject it using json.

I am using a mac to fill out my forms, maybe this injects a \r\n in the text field?  
My iPhone does the same \r\n  
My Android does the same \r\n

Maybe it’s a browser issue? I doubt that  
Mac == Brave  
iPhone == firefox  
Android == Chromium

So now I wonder if this issue is because the PDF is created on a Linux, which is complicated for me to test.

---

<div class="post-metadata">

**Author:** ![jonbendtsen](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jonbendtsen](https://www.dolibarr.org/forum/u/jonbendtsen)\
**Post date:** [October 8, 2023, 8:51am UTC](https://www.dolibarr.org/forum/t/on-orders-my-company-details-spread-outside-the-from-box/24313/10 "2023-10-08T08:51:28Z")

</div>

issue seems fixed 🙂

> <https://github.com/Dolibarr/dolibarr/issues/25836>
>
> \### Bug
> 
> Display of addresses (sender and recipient) on PDF documents with uni…ntentional? space if the address field has two lines (same with the address of the issuing company)  
> 
> \### Environment Version
> 
> 18.0.1
> 
> \### Environment OS
> 
> \_No response\_
> 
> \### Environment Web server
> 
> \_No response\_
> 
> \### Environment PHP
> 
> 7.4
> 
> \### Environment Database
> 
> MySQL
> 
> \### Environment URL(s)
> 
> \_No response\_
> 
> \### Expected and actual behavior
> 
> 
> \### Steps to reproduce the behavior
> 
> Create a costumer (or edit compagny details) with min. 2 adress lines and generate a PDF
> 
> \### Attached files
> 
> \_No response\_
> 
> !\[ksnip\_20230907-173159\](https://github.com/Dolibarr/dolibarr/assets/22157096/fa2c81b2-d039-4a54-a67d-cf5400b063c0)
> !\[ksnip\_20230907-173130\](https://github.com/Dolibarr/dolibarr/assets/22157096/a32db75b-b7a3-4830-bbe6-7490184f0a10)
