Search code examples
pdfformattingadobe-illustrator

How do I make an Illustrator PDF have new lines when copying and pasting?


I'm working in Adobe Illustrator. I'm trying to create a document that can be copied and pasted into a plain text editor. The problem I'm having is that when I copy text from the PDF and paste it to an editor, I end up losing new lines that separate content:

Where it looks like this in the PDF:

Title

Objective

    To create a blah blah blah...

However, when pasting it into a text editor, it looks like this:

Title Objective To create a blah blah blah...

Title and Objective are simple text elements, while "To create a blah blah blah..." is actually a text box. How can I add new lines in the formatting to ensure that when it's pasted that it retains the separation?


Solution

  • Text in PDF files does not normally contain 'new line' (ie cariage return or linefeed) characters, because the text is placed at specific locations on the page.

    In rare cases it is possible that text will have these characters, but this is only likely to be true for 'dumb' producing applications. A feature-rich application like Illustrator (which can do much more than boring horizontal lines of text) will almost always place text without using these characters.

    MuPDF and ghostscript can both extract text and make a stab at maintaining the basic layout, I'm sure there are other applications which can do so as well. Copy & paste just isn't up to the job for the general case.