Prevent line break for wrapped text?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Prevent line break for wrapped text?

jimmarquardson
I am creating tutorials that involve running programs from the command line. Some of the commands are long enough to wrap when rendered to a PDF. For example, I have the following command:

```
sqlmap -u "http://127.0.0.1/some-website-with-a-really-long-url.extensions" --data="something=a value here"
```

In a PDF, it's rendered in 2 lines with a CRLF line break at the end of the first line. Currently, people copy the command from my PDF, and when they paste it, the commands fail because the lines are executed separately.

Is there a way to let the text flow and naturally wrap? I want it to look the same, but I don't want the extra CRLF characters to be inserted where it wraps.
Reply | Threaded
Open this post in threaded view
|

Re: Prevent line break for wrapped text?

mojavelinux
Administrator

On Tue, Mar 15, 2016 at 11:48 AM, jimmarquardson [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Is there a way to let the text flow and naturally wrap? I want it to look the same, but I don't want the extra CRLF characters to be inserted where it wraps.

There is no such concept in PDF. A soft wrap and a hard wrap at the end of a line are the same. That's because PDF doesn't support "flowing text" like the web.

In general, you are going to have a myriad of problems trying to copy and paste code out of a PDF, and it comes down to limitations in PDF itself. PDF does not honor indentation and it hard wraps lines. PDF was designed for print, and this is evidence of that legacy.

If my understanding about any of this is incorrect, I'm happy to be educated.

Cheers,

-Dan

--
Dan Allen | @mojavelinux | http://google.com/profiles/dan.j.allen