Working with PDFs: The Two Passwords, OCR on Scans, and Bookmarks Lost in Merging

The answer first: classify first, then handle the four failure buckets

PDF's convenience is also its trouble: one extension may hide an electronic document, a scan, a permission-protected file, or nothing but images. Requests end up in four buckets — it will not open, search finds nothing, it is too large, or merging wrecked the structure. The order matters: decide electronic versus scanned first, because everything downstream depends on it. The tool list lives in the PDF guide.

The first fork: electronic document or scan

An electronic document has a real text layer: copyable, searchable, editable, and small. A scan is an image that appears to have text because OCR attached its output as an invisible layer. That layer has three properties:

  1. accuracy typically 85–98%, depending on scan quality and typeface;
  2. errors concentrate in rare characters, punctuation and digits, with l/O/1/0 faring worst;
  3. it is not editable — what you copy is the OCR's guess, not the source.

The test is simple: select and copy a passage. Nothing sensible coming out, or garbled output, usually means a scan; clean, correct text means an electronic document. Editing content requires OCR first, and OCR quality caps every later operation.

Two passwords: will not open vs cannot copy

PDF encryption is routinely mistaken for a single switch when it is two layers:

Type Decides Behaviour
Owner password whether the file opens no password, no entry
User password what you may do after opening opens, but printing/copying blocked

So "will not open" and "opens but cannot copy" are two different problems: the first needs the owner password, the second is only a permission restriction.

Removing an owner password requires the original one — a property of the format, not a tool defect. Decryption applies only when the password is known; a forgotten password on an encrypted PDF is cryptographically unrecoverable, and backups are the only route. Some files claim to be encrypted while merely carrying a permission password and opening normally, so detect which case you have before acting.

Search finds nothing: the OCR layer is unreliable

Search on scans has a subtle signature: it appears to work, and the results cannot be trusted.

Concretely: searching lO1 (lowercase L, capital O, digit one) misses what should match 101, because OCR read a digit as a letter; names may match lookalike characters; copied identifiers corrupt downstream data.

Two goals, two treatments:

  • Archival retrieval → image-level search. Whole-page visual matching or layout recognition does not depend on per-character OCR and is more reliable.
  • Content editing → OCR first, then hand-check the critical fields: amounts, identifiers and dates. The sampling rate follows business risk; financial vouchers demand far more.

Too large: compress images, not structure

A scanned PDF has an extreme composition: about 95% image, with the text layer measured in tens of kilobytes.

That explains why a generic compress-document pass barely helps — it optimises font embedding, object structure and metadata, which were never the bulk. The real lever is the embedded image:

  • drop resolution from 300dpi to 150dpi (print grade to screen grade, visually indistinguishable);
  • replace lossless PNG with lossy JPEG (quality 0.6–0.8);
  • convert single-colour scans such as text-only contracts to greyscale or bitonal.

Together these typically save 60–80%. Note that some tools default to structural compression, so choose the image-compression option explicitly, or you will spend the effort and see almost no change.

Merging and splitting: bookmarks and links pay the price

What breaks in a merge is rarely page order but structural information. Bookmarks (outline), section jumps, form field values and internal links all depend on internal page and object references; a naive merge stacks page objects together and scrambles those references:

  • bookmarks point at the wrong page, sometimes at an existing but unrelated one;
  • internal links jump elsewhere or die;
  • form field values disappear.

The order of operations: use a tool that preserves the outline → click through every bookmark and link after merging → if the sources cross-reference each other, do not merge; serve separate PDFs behind an index page instead.

Splitting (with the PDF crop tool or page-by-page) carries the same risk, because renumbering misaligns bookmarks; confirm the old entries still map correctly afterwards.

Checklist and verification

  • [ ] Decide electronic versus scanned by selecting and copying text
  • [ ] Establish whether the owner password blocks opening or the user password restricts actions
  • [ ] Use image-level search for archival retrieval, not the OCR layer
  • [ ] OCR before editing, then spot-check amounts, identifiers and dates
  • [ ] Compress images (lower dpi, switch to JPEG), not document structure
  • [ ] Verify every bookmark and internal link after merging; consider not merging cross-referenced files
  • [ ] Confirm bookmark mapping after splitting

Setting the two password layers in an encryption-capable editor makes the difference observable: a user password alone still lets the file open while printing is disabled, and adding the owner password blocks opening without it. Running the same file through the PDF extractor also identifies the type — an electronic document yields complete text, a scan yields only OCR output.

Frequently Asked Questions

What is the difference between the owner password and the user password in PDF encryption?

They control entirely different things. The owner password decides whether the file can be opened at all — without it you cannot get in. The user password only decides what you may do after opening: the file opens but printing or copying is blocked. The common complaint of a document that will not open is the former; opens-but-cannot-copy is the latter, and you must establish which one you are facing before debugging. A PDF encryption tool lets you set both layers separately, and a PDF decrypt tool handles already-protected files — but removing an owner password requires the original one, which is a design limit rather than a tool defect.

Can scanned PDFs be searched reliably?

Yes, but the results cannot be trusted. A scan is an image; the searchable text layer is OCR output at typically 85–98% accuracy, with errors concentrated in rare characters, punctuation and digits. The consequences are concrete: searching for lO1 (lowercase L, capital O, digit one) misses what should match 101, and copying OCR text into a data pipeline yields corrupted identifiers. For archival search only, use image-level search that matches whole pages visually rather than relying on the text layer. For content editing, OCR first and manually spot-check the critical fields — amounts, identifiers and dates, where errors hurt most.

How do I compress a 20MB PDF down to 5MB?

Compress the images, not the document structure. In a scan roughly 95% of the bytes are images and the text layer is only tens of kilobytes, so a generic compress-document pass over fonts, objects and metadata changes almost nothing. What works is recompressing the embedded images: drop 300dpi to 150dpi, or replace lossless PNG with lossy JPEG, saving 60–80% with almost no visible difference. A PDF compressor tool operates at exactly that level. Note that some tools default to structural compression, so you may need to pick the image-compression option explicitly.

After merging several PDFs, the table of contents and internal links all break. Can that be fixed?

Broken links can be fixed; misaligned bookmarks are much harder. Simple merge tools discard the original outline and in-document links, so a bookmark may end up pointing at the wrong page. A tool that preserves the outline keeps most of it, and you should still verify each entry after merging. If the source documents cross-reference each other, prefer not to merge at all — serve separate PDFs behind an index page, which is more reliable than repairing links. A practical extra check is to export the merged text with a PDF extraction tool and confirm the section order matches expectations.

← Back to Blog