Copying from a pdf, removing EOL and spaces

Hi everyone I want to copy an extract from a .pdf file. When I select some text to copy and paste it puts each word followed by two spaces on a separate line. Do you know a better way to extract some text from a .pdf? Alternatively what is an easy way to remove the space and EOL to reformat the text in a readable format? I am sure there are several, but I would appreciate a really easy one. TIA Roderick

On Wed, 23 Sep 2015 10:46:42 +1200, Roderick Aldridge wrote:
I want to copy an extract from a .pdf file. When I select some text to copy and paste it puts each word followed by two spaces on a separate line.
Copying text from a PDF file seems to me to be an inherently unreliable operation. Remember that PDF is designed for viewing, not for anything else. How the text is grouped into blocks in the PDF stream need bear no relation to how it appears on the page. Having said that, what PDF viewer are you using? Okular? It may be worth trying different ones. Rewrapping text should be quite easy. In Emacs, select the range of lines and press ALT-q.

Thanks for the suggestions. Nothing happened when I tried Ian's suggestion. I have to go out. I will try Lawrence's when I get back. Rod On 23/09/15 11:11, Lawrence D'Oliveiro wrote:
On Wed, 23 Sep 2015 10:46:42 +1200, Roderick Aldridge wrote:
I want to copy an extract from a .pdf file. When I select some text to copy and paste it puts each word followed by two spaces on a separate line. Copying text from a PDF file seems to me to be an inherently unreliable operation. Remember that PDF is designed for viewing, not for anything else. How the text is grouped into blocks in the PDF stream need bear no relation to how it appears on the page.
Having said that, what PDF viewer are you using? Okular? It may be worth trying different ones.
Rewrapping text should be quite easy. In Emacs, select the range of lines and press ALT-q. _______________________________________________ wlug mailing list | wlug(a)list.waikato.ac.nz Unsubscribe: http://list.waikato.ac.nz/mailman/listinfo/wlug

I wrote:
Rewrapping text should be quite easy. In Emacs, select the range of lines and press ALT-q.
Just a note, this will rewrap the text onto lines of a length limited by your current fill-column setting. To get all the text onto a single long line, set a large value for the fill column. E.g. to set it to 999999, do this ctrl-u 999999 ctrl-x f Then use alt-q to wrap selected text to this setting.
participants (2)
-
Lawrence D'Oliveiro
-
Roderick Aldridge