Working with PDFs you did not create: scans, locked files and bad exports

A PDF you made yourself behaves. A PDF that arrives by email from an institution, a supplier or a government portal frequently does not. It is a photograph of a document, or it refuses to allow copying, or it opens as an undifferentiated wall of text with the columns interleaved.

These are three distinct problems with three distinct solutions, and diagnosing which one you have takes about five seconds.

The diagnostic

Try to select a line of text with your cursor.

  • Nothing selects. It is a scan — an image of a page. You need text recognition.
  • Text selects but will not copy. Permissions are restricted.
  • Text copies but arrives scrambled. The document’s internal text order does not match its visual layout.

Problem one: it is a picture

Scanned documents contain no text at all, which is why searching finds nothing and copying produces nothing. Optical character recognition reads the shapes and adds a text layer underneath the image, leaving the page looking identical while becoming searchable and selectable.

Running OCR PDF on a clean scan of printed text is highly accurate. Accuracy falls with skewed pages, low-resolution scans, coloured or patterned backgrounds, handwriting and unusual typefaces. Three things improve results before you start: scan at 300 DPI rather than 150, straighten the page, and convert to greyscale.

Always proofread numbers. Recognition errors cluster on digits and on characters that resemble each other — 0 and O, 1 and l, 5 and S — which is exactly where an error in an invoice or a statement does damage.

Problem two: it is restricted

PDFs support two entirely different kinds of password, and confusing them causes most of the frustration here.

Type Effect Can you work around it?
Owner password Restricts printing, copying or editing; file opens normally Yes — the restriction is advisory
User password File will not open at all without it No — the content is encrypted

Owner-password restrictions are enforced by the reader as a courtesy, not by encryption, so removing them with unlock PDF is a routine operation on a document you are entitled to use — a statement addressed to you, a form you need to complete, a report you have licensed.

A user password is different: without it there is nothing to remove. Ask the sender. And whichever type you are dealing with, being able to bypass a restriction is not the same as being allowed to — check the licence or terms on anything you did not originate.

Problem three: the text comes out scrambled

PDF stores text as positioned fragments, not as a reading order. In a two-column layout, a badly generated file may store the fragments left-to-right across both columns, so copying produces alternating lines from each column. Tables suffer similarly — cells arrive in storage order rather than row order.

Extracting with PDF to text gives you the raw content to work with, which is usually easier to repair in a text editor than to fight inside the PDF. For tables specifically, extract, then rebuild the structure in a spreadsheet rather than trying to preserve it through the conversion.

A habit worth adopting

Whenever a scanned document arrives that you might need again — a contract, a statement, a certificate — run recognition on it once, at the point of receipt, and file the searchable version. The two minutes spent then replace the twenty spent later hunting through a folder of unsearchable images for the one that mentioned a particular reference number.