Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

This site will have limited functionality while we undergo maintenance to improve your experience. If an article doesn't solve your issue and you want to ask a question, we have our support community waiting to help you at @FirefoxSupport on Twitter and/r/firefox on Reddit.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

When a pdf page is displayed and I copy some text and paste it, lines wrap. How to get the original line lengths?

  • 3 replies
  • 1 has this problem
  • 37 views
  • Last reply by DonDilworth

more options

I put example input on my website in pdf format. The user can copy and paste that text into an editor to run the examples. But when pasted, the lines wrap in many places, causing format errors when the program tries to interpret them. How can I arrange that the pasted text is exactly the same as in the displayed pdf file?

I put example input on my website in pdf format. The user can copy and paste that text into an editor to run the examples. But when pasted, the lines wrap in many places, causing format errors when the program tries to interpret them. How can I arrange that the pasted text is exactly the same as in the displayed pdf file?

Chosen solution

Copy/paste from the PDF Viewer is broken in many ways, like selection. Many bugs have been open about that on the bug tracker.

If you really need to copy and paste without issue, maybe use a different PDF viewer like Sumatra PDF.

Read this answer in context 👍 0

All Replies (3)

more options

Chosen Solution

Copy/paste from the PDF Viewer is broken in many ways, like selection. Many bugs have been open about that on the bug tracker.

If you really need to copy and paste without issue, maybe use a different PDF viewer like Sumatra PDF.

more options

Some PDFs trigger a message in Firefox that they might not display well in the built-in PDF viewer. I don't know how the viewer determines that, but it would be handy if you could trigger that message, since readers then would be encouraged to download the PDF and view it in their stand-alone viewer (e.g., Adobe Reader). Hmm...

more options

Very helpful replies, thank you. It seems pdf copy/paste is indeed broken. So I modified my website so the user sees docx files instead of pdf. Those open in Word just fine, and C/P works as well.

So I'm happy.