line break on pdf export

I have some code block that i put in my document like:

# openssl req -x509 -nodes -days 7300 -newkey rsa:2048 -keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem

And it’s on one line when i put in text editor:

Then i paste in my doc in libreoffice:

Now i export my file to pdf and select it from pdf:

When i paste it in texteditor it’s two line so my command broke and doesn’t work anymore:

Also i habe these lines in libreoffice:

But in pdf export broke and select like this in two section:

So when i paste somewhere from pdf it looks like:

Why not attach the real examples: odt and pdf files?

Editing: Refer Owen’s comment. I am by far not as experienced as he is concerning different systems and tools.

You used a HT to separate the rest of the line from the “#” character?
In this case I also got shown two “separated portions” when copying from the pdf.
Nonetheless I could not verify your observations with:
LibreOffice V 5.1.0.3 (64 bit), Win 8.1 using ‘Foxit Reader’ to open the created pdf.
The pasted text preserved the original line structure.

What are your environment / used tools?

Foxit Reader is evidently the best workaround on the Windows platform to the line breaks on copy from PDF issue. It is worth noting that PDF is designed as an output (rather than input) format. Refer these threads on the Superuser and Adobe forums.

it’s my system info: http://storage5.static.itmages.com/i/16/0312/h_1457771351_9629979_3d0420ff04.jpeg
and it’s my libre office info: http://storage7.static.itmages.com/i/16/0312/h_1457771395_9249520_2cd3d25b75.jpeg
And it’s my pdf reader: http://storage1.static.itmages.com/i/16/0312/h_1457771436_1336832_e768339d3b.jpeg

@minttux, you are stuck with the carriage returns. I get the same result here using Document Viewer under Debian. It is best to perform a search/replace using a regex afterwards to remove the unwanted CR.

you have try any regex to solve this problem?
when i copy from libreoffice its correct but in pdf breaks lines

@minttux, does the answer here help?