OCR cleanup is easiest to get wrong when the text already sounds plausible. Joining two lines can repair a paragraph, but joining the wrong blocks can create a sentence the author never wrote. Removing repeated numbers can clear page footers or erase a list.
Keep the source PDF and the untouched export. Work on a copy, and treat every cleanup rule as something to test against the document rather than apply blindly to the whole file.
Restore meaningful headings first
Read the section titles in the source and compare them with the Markdown outline. A large printed line might be a chapter title, a figure caption, or a running header. Size alone does not establish its role.
Use heading levels to express actual hierarchy. A chapter can contain sections and subsections without every emphasized phrase becoming a new heading. Keep the wording needed to identify the same section in the PDF.
If page headers repeat the book or chapter title, remove confirmed duplicates from the working text rather than promoting each one into the outline. Check that the genuine heading remains at the section's beginning.
For a long document, repair one chapter and inspect its outline before repeating the approach elsewhere. Different parts of a textbook, index, and appendix may use different conventions.
Join wrapped lines without flattening structure
PDF extraction can leave a newline after every printed line. In ordinary prose, those lines may belong to one paragraph. But a line break can also separate list items, verse, code, or a displayed equation.
A manually written cleanup illustration is:
Before:
The samples were stored in a dry
cabinet until the second test.
After:
The samples were stored in a dry cabinet until the second test.
This illustrates an editing decision, not a measured conversion result. Check the PDF before using the same rule on a real passage.
Be careful with end-of-line hyphens. A word divided by typesetting may need joining; a genuine compound needs its hyphen retained. Do not remove every hyphen followed by a newline without reviewing examples.
Across pages, read the final source sentence and the next page's opening together. An intervening footer, note continuation, or column transition may make a simple join incorrect.
Remove page noise with a narrow rule
Identify repeated headers, footers, page labels, and scanning artifacts. Confirm a pattern on several pages before using search-and-replace. The same word may occur legitimately in the body, and a lone number may be data rather than a page number.
Prefer a rule tied to the actual repeated structure over deleting every short line. Run it on a small selection, inspect the changes, and retain the option to undo. If the document includes two-column sections, use the reading-order troubleshooting guide before treating an abrupt transition as mere whitespace.
Keep tables, captions, and footnotes separate from ordinary prose while cleaning. Their line structure often carries meaning that broad paragraph rules would destroy.
Compare before and after using the same source locations
Choose several paragraphs, one list, one table, and a note. Compare the untouched export, edited copy, and source PDF. Check words and relationships, not only visual neatness.
Record meaningful corrections: a restored heading, a removed running footer, a repaired paragraph boundary, or an unresolved recognition error. Distinguish formatting changes from changes to numbers or terminology. A revision that reads more smoothly may still have altered the evidence.
Preview the Markdown in its destination editor. Basic Markdown and extensions differ in their handling of tables, math, and footnotes; CommonMark defines the core syntax, not every application's behavior.
Finish with a reusable, traceable file
PDF Craft can convert scanned and text PDFs into Markdown for editing. Choose Markdown after uploading, download the completed result, and review it against the original. This workflow does not require or imply a separate feature for uploading arbitrary existing Markdown for translation.
Keep images and other resources with the cleaned document, and test their paths after moving it. Preserve the source title, edition, and page references when following the research notes workflow.
The useful stopping point is not a file with no visible irregularities. It is a file whose structure is usable, whose important corrections are verified, and whose uncertain passages remain clearly marked for review.