Clean PDF copy and paste artifacts while preserving compound words
Admin ·
Two line-ending hyphens can look alike on the page. One can mark a place where a word may wrap and the other may belong in a compound. Use the receiving-notes sample to see what both choices do before cleaning your own PDF text.
Compare a soft hyphen and a printed hyphen
Choose Load example. The first body paragraph has an invisible U+00AD soft hyphen after re and a line break before counted. With the default repair, the output reads recounted.
The next sentence has a normal printed hyphen after re and a line break before check. Keep the printed hyphen yields re-check. Select Remove at likely split words to see how recheck differs. Choose Keep the printed hyphen when that mark belongs in the text.
| Break in the sample | Default result | Check |
|---|---|---|
| re + U+00AD + line break + counted | recounted | The discretionary character and break are gone |
| re- + line break + check | re-check | The printed hyphen survives |
| final | final | The Latin ligature expands to two letters |
Unicode UAX #14 use of printed and soft hyphensUnicode Alphabetic Presentation Forms code chart
Check paragraph boundaries and bullet items
With Likely prose continuations, Keep the label visible joins the next line about the second count. Check signs at close starts a new line after the full stop. Choose Adjacent prose lines to try joining that sentence too. Headings, tables and page breaks may need a manual review based on the original layout.
The bullet items stay on separate lines. Enable Convert bullet markers to hyphens if the destination expects simple text or Markdown. Switch on Replace non-breaking spaces to turn the space between bin and 7 into a regular space.
Turn on Remove stray zero-width spaces to join ID and 32 in the second bullet. The Arabic sample word stays in place. Keep the option off when U+200B carries a deliberate break opportunity in your source.
Unicode UAX #14 use of printed and soft hyphensUnicode Character Database and derived properties
Compare the cleaned export with the original PDF
Download cleaned text and open it as UTF-8. Compare sample quantities, compound words and list items with the PDF. Copy or download the result again after changing any rule that joined two distinct entries.
If selecting words in the PDF gives you empty text, use PDF to Text to run OCR first. Open its UTF-8 text export here and compare names and quantities against the page image before using the result.
Unicode UAX #14 use of printed and soft hyphensWHATWG newline normalization in the textarea value
Common questions
How can I check a wide table before I join lines?
Turn off Join hard-wrapped prose and Collapse inner runs of spaces. Compare grouped rows with the PDF itself. The tool can keep the copied text, while the original document shows which rows and columns the content belonged to.
How do I keep a curly quote or a narrow no-break space?
Leave Straighten curly quotes or Replace non-breaking spaces off. These rules are independently selectable. In the sample the bin number provides a way to check what changing the second option does.