Missing line breaks in soffice file conversion

I’m using the npm package libreoffice-convert (which uses soffice under the hood) to convert a docx file to a pdf.
The docx contains linebreaks, but the converted pdf doesn’t, and the text appears there in one big blob.
What could be the issue and how do I solve it?

Reopen your question to provide more details (click on below it, then on the “pencil” icon). Mention OS name (I assume it is Linux, but which distro and release number?) and LO version.

There is no such libreoffice-convert in my Fedora 39. Where did you find it? What is is supposed to do?

He uses a javascript library (hint: npm), wich calls LibreOffice. But so we neither knew the installed version nor the used command…

What could this mean? Do you expect to get special characters, like CR, when copying text from the PDF? If so, you might have wrong expectations. You shouldn’t expect to be able to find the original bytes (or even characters) in PDFs. Things like ligatures may replace the character sequence even more. PDF is a format created for visual representation.

At first: Find out, what happens, if you load the file yourself from LibreOffice. Does it look ok in LibreOffice? If yes, try to create a pdf. (Use the same LO as your npm lib.)
.
Try to find the command, wich the library uses to call LibreOffice. It may include a wrong filter to load the .docx.
.
Analyse the .docx: MS accepts often other content. For example I’ve seen html-pages generated by databases silently converted to excel-tables.
.
And if you seek help, provide a sample document, so other users here can test themselves. As a Javascript developer you should know about the stuff necessary to analyze a problem.

PS: blob is usually a binary large object in a database, so I doubt it is an appropiate description of the result in your pdf.