How to get text out of a PDF without uploading it anywhere

Every "free PDF to Word" site works the same way: you upload the document, a server converts it, you download the result. For an invoice that is fine. For a contract, a medical record, or anything covered by an NDA, it is not — you have just sent the file to a stranger and left a copy on their infrastructure.

All four methods below run entirely on your own machine.

Method 1: copy from the viewer

Best for: a paragraph or two.

Select the text and paste. Works when the PDF has a real text layer. Quality depends on the viewer: a good one keeps reading order and paragraph breaks, a poor one gives you each line as a separate fragment with hard breaks in the wrong places.

Watch for: headers and footers interleaved into the middle of your paste, and hyphenated words staying hyphenated.

Method 2: export the whole document to TXT

Best for: anything longer than a page.

FlyPDF's text export applies reading-order analysis and strips repeating headers and footers, so the output is closer to what a human would read top-to-bottom rather than the order text happens to be drawn in.

This distinction matters more than it sounds. A PDF content stream stores text in drawing order: the running header, then a floating figure caption, then the paragraph that visually precedes it. Naive extraction reproduces that mess. Reading-order analysis reconstructs columns and blocks.

Watch for: two-column layouts. Most extractors order them per page rather than per column, so a two-column paper comes out with the left and right columns interleaved across each page break. FlyPDF orders within a page; if you need true column-first flow for a full paper, extract page ranges and check a page by hand first.

Method 3: OCR a scan, then copy or export

Best for: scanned documents, faxes, photographed pages.

No text layer means nothing to extract — so recognise it first. See offline OCR on Windows for what runs, and why search finds nothing for how to tell whether you have a scan at all.

Because the recognised text exists in memory in FlyPDF (no new PDF is written), you can search it and copy from it immediately, and the original file stays untouched.

Method 4: the command line, for batch work

Best for: hundreds of files, or scripting.

No dependencies to install for the OCR-free case — Python with a small library handles extraction:

pip install pypdf

python -c "import pypdf; r=pypdf.PdfReader('in.pdf'); print('\n'.join(p.extract_text() for p in r.pages))" > out.txt

For scans you need an OCR engine locally — ocrmypdf uses Tesseract and produces a searchable PDF on your own machine:

ocrmypdf --language eng in.pdf out_searchable.pdf

Both are offline once installed. Do check the licence terms of whatever you install, and note that Tesseract-based OCR is slower and less accurate on difficult scans than the OCR models bundled with FlyPDF — the trade-off is that it is scriptable and free.

Choosing between them

You haveUseExpected quality
A few paragraphs, real text layerCopy from viewerClean
A whole document, real text layerExport to TXTClean, minus column issues
A scan or photoOCR, then copy or exportGood on clean 300 DPI scans, weak on faxes
Hundreds of filesCommand lineDepends on source quality
A form you filled inAnything — but check outputOften poor; form fields are stored separately

Why output is sometimes garbage

If extraction gives you mojibake or the wrong characters, it is almost never the extractor's fault. Three causes cover nearly every case:

  1. Broken ToUnicode map — the file does not say what its glyphs mean. Fix: OCR.
  2. Text stored as outlines — no characters to recover. Fix: OCR.
  3. A scan — no text at all. Fix: OCR.

Notice the pattern: when the file's own text layer cannot be trusted, recognition is the answer, and recognition is only as good as the page image.

A note on "free online converter" sites

Beyond the confidentiality problem, there are practical ones: file size caps, queueing, watermarks on output, documents retained for an unknown period, and terms of service that grant broad rights over uploaded content. For public documents none of this matters much. For anything else, the four local methods are faster than the upload anyway.

The short version

If your document has a text layer, export it locally — do not upload it. If it does not, OCR it locally — do not upload it. Either way the file never leaves your machine, and the original is never modified.

FlyPDF does both, offline: try the 30-day trial or read the known limitations first if your documents are unusual.

<!-- fd:hublink --> Related guide: see Batch search across PDFs for a detailed walkthrough.

FlyPDF does this locally. Read-only by design: OCR, search, annotations and text export all run on your machine, and the source file is never rewritten.

Try FlyPDF free for 30 days

← Back to the blog