medium.com 5 min read

Fixing text that was copy-pasted from a PDF

Copying text out of a PDF gives you hard line breaks, hyphenated words and phantom spaces. The fix is mechanical, so a routine works better than judgment.

The routine

  1. Paste the text into the Article Formatter.
  2. Keep every cleanup rule on for a first pass, then switch off quote normalization if the document quotes code.
  3. Compare the preview with the source: headings and list items should survive, and hyphens at line ends should be checked by hand.
  4. Copy the formatted text and finish in your editor.

What still needs a human

Word breaks inside hyphenated compounds, table rows and footnotes are judgement calls. Formatting tools can normalize them but cannot know which line break was intentional.

Open Access Reading & Fair Use Notice

This article was rendered via Freedium for personal distraction-free reading, research, and accessibility. All copyright, trademarks, and intellectual property remain with the original author and publication.