How to compare two PDFs for changes in text and layout

12 August 2025

Hands use one of two laptops placed side by side on a table.
Illustrative photograph. Cropped and resized. Photo: “Hands With Laptop” — Burst / NegativeSpace. · CC0 1.0

Start a PDF document comparison by confirming which revision is the baseline. Compare the extracted text to find changed wording and quantities, then compare the rendered pages to catch moves and reflow. Inspect each difference in both originals before approving the revision.

In eight synthetic PDF pairs, the text check found five seeded content changes, including a deadline shortened from five working days to three. The page-image or page-count check flagged all eight pairs. The remaining three explain why a visual difference needs a reader’s judgement.

Related articles

Which changes alter the reader’s decision?

A reviewer deciding whether to release equipment needs to spot an added “not”. A buyer approving an order needs to know which item changed quantity. Start with that decision and mark the amounts, dates, permissions or responsibilities on which it depends.

A readable PDF, a searchable text layer and a structured set of extracted fields are different outputs. None automatically establishes that a changed value is correct or approved. A comparison report is evidence for a review decision, not validated business data by itself.

Where this guidance stops

These files contain selectable text. If both versions are images of paper, first match the pages and check their alignment. The scanned PDF comparison guide shows how a slight shift can make an unchanged page look different. The document owner still decides whether to approve a revision.

The controlled examples below are synthetic. They provide known changes and a review framework, with no claimed product detection rate or measured customer result.

Prepare known document versions

Version identity and expected changes

Identify the baseline and candidate by revision, date and file checksum where available. Confirm that the files are the intended pair. Comparing a draft against another draft can produce a convincing report that answers the wrong question.

Prepare a representative set covering the documents your team reviews. Include long paragraphs, tables, notes, changed pagination and relevant languages. Keep important exceptions visible, such as mixed scanned pages or a revised attachment that a page-text comparison may not cover.

Create the reference change record independently of the comparison output. For a synthetic test, deliberately seed known changes and have another reviewer verify the before-and-after meaning. For real versions, obtain an authorised change record and inspect the source documents to confirm it.

Reference itemWhy it belongs in the record
Old and new file identitiesEstablishes which versions were compared
Stable section or table referenceLocates a change despite pagination shifts
Before and after contentMakes the difference independently inspectable
Change typeSeparates additions, removals, edits and moves
Expected significanceDefines the review question before tool output is seen
Reviewer and rationaleShows who confirmed the classification and why

Do not designate every font or position change as harmless. A heading hierarchy, emphasis or relocated qualification can change interpretation. The classification must consider context.

Eight PDF pairs with known differences

Inputs, assumptions and the expected result

Download and unzip the eight before-and-after pairs. They are revisions of a fictional equipment procedure. The original test specification preserves the intended changes as written before the PDFs were generated. The completed observations record the text, file hashes, page counts and comparison result for each pair.

CaseSeeded differenceExpected review classification
C01Dispatch within five days becomes three daysChanged deadline
C02“May release” becomes “may not release”Changed permission
C03Table quantity 20 becomes 200Changed numerical value
C04Responsible team changesChanged ownership
C05An exception instruction is removedRemoved requirement
C06Same paragraph moves within an equivalent contextMove; assess whether meaning remains equivalent
C07Body font changes without intended content changePresentation control
C08A paragraph crosses a new page boundaryReflow control

For the baseline, Poppler’s pdftotext extracted each file and consecutive whitespace was collapsed before the strings were compared. A separate check counted the pages and compared their rendered pixels at 72 dpi.

Record the application's exact version, comparison mode, page ranges and report filters. Adobe documents different modes for continuous text and page-oriented content, a text-only option that excludes graphics differences, and report filters that can hide categories of change. These choices define what the result can show. Adobe: Compare two versions of a PDF.

Run the comparison and save the untouched report. Match each reported candidate to the reference record, inspect its context in both files and assign a reviewer classification. Keep unmatched flags and missing reference changes in the log. A later manual correction must not be presented as an original tool finding.

Reproduce a changed quantity and a moved instruction

If you have the Poppler command-line tools, run these commands from the folder containing the unzipped PDFs. You can also inspect each pair side by side in a PDF viewer.

pdftotext C03-before.pdf -
pdftotext C03-after.pdf -
pdfinfo C08-before.pdf
pdfinfo C08-after.pdf

C03 changed the order quantity. Both files have one page. The first text output includes “Storage boxes 20” and the second includes “Storage boxes 200”. Open the two pages, match the item label and record the old and new quantities against that item. A page-count check alone would miss the change.

C08 moved an intact instruction. Look for the Pages field in the two pdfinfo outputs. The baseline has one page and the revision has two. Open page two of the revision. “Check the item count before closing the request.” is still present. The words match after whitespace normalisation, although the old page reference now leads to the heading alone.

Across all eight pairs, normalised text changed in C01–C05 and matched in C06–C08. Every pair showed a visual or page-count difference. These observations establish what happened to the supplied files. The experiment used English digital text and measured neither commercial software performance nor reviewer time.

Classify meaningful changes and noise

Additions, removals, moves and formatting

Measure the unit that matters. Decide whether one rewritten paragraph counts as one change or several, and apply that rule consistently. Otherwise a tool that creates many small markers can appear more thorough simply because it reports at a different granularity.

For each known meaningful change, record whether the tool identified it, partly identified it or missed it. For each reported candidate, record whether it corresponds to a meaningful change, a genuine presentation difference or an erroneous comparison caused by misalignment. A real formatting difference can be irrelevant to the task without being a technically false detection.

Use the blank classification and effort log to record one decision per case in your own trial. For C02, record the addition of “not” and its effect on release before approval. For C07, log the changed typeface and the unchanged instruction. Counting both as visual flags is accurate. Counting both as changes to the procedure would be misleading.

Check unflagged content as well as highlighted regions. In the seeded corpus, the reference list makes omissions visible. In a real review without complete ground truth, use an explicit additional verification method and state what uncertainty remains. A quiet report is not evidence that every important passage stayed unchanged.

Acceptance checklist for PDF document comparison

Reflow, tables and invisible changes

When pagination changes, compare corresponding content rather than blindly pairing page numbers. Inspect the boundaries around inserted or removed pages. If alignment is uncertain, stop automated acceptance and establish the correct match manually.

For tables, verify the relationship between labels, rows, columns and values. A number moved to the wrong row can matter even if the same digits remain in the file. If your packs mix Arabic and English, add a known bilingual row to the pilot and have a reader of both languages check the order, labels and quantity in the saved result.

Define the treatment of information outside ordinary visible page text. Comments, attachments, field values or metadata may require separate checks. State those exclusions in the review record instead of implying that one comparison covers every property of the files.

Before accepting the workflow, confirm:

  • The intended versions and full required comparison scope are identified.
  • Known critical changes are detected or covered by an explicit manual control.
  • Missed, partial and non-actionable findings are recorded separately.
  • Moves and reflow have not concealed content changes.
  • Table and reference relationships have been checked.
  • Excluded document features have another approved review route.
  • The reviewer can explain and reproduce the final change decisions.

If the source is too poor for dependable extraction or alignment, obtain a better source or move to a suitable manual or scanned-document review. Record the rejected case in the pilot results.

Use comparison in a controlled review

Reviewer confirmation and change-log evidence

Set acceptance rules before the pilot. For example, require every seeded critical change to be accounted for and every unresolved candidate to have an owner. Treat those as proposed organisational rules, not an industry benchmark.

Time a reviewer from opening the two versions through recording the last decision. Log preparation, processing, inspection and rework separately. Keep failed comparisons in the sample when estimating the effort for the next batch.

Retain the input identities, settings, original report and reviewer decisions together. Evaluate software on your actual document classes and review burden. The useful outcome is a trustworthy change decision with traceable evidence.

Detect changed numbers when a revised PDF reflows

Compare the value in its original context after text reflows. A moved line and a changed digit need different review decisions.

Read “Detect changed numbers when a revised PDF reflows”.

How to tell whether a paragraph moved between two PDFs

When a paragraph moves under a new heading, compare its scope as well as its wording before classifying the move as harmless.

Read “How to tell whether a paragraph moved between two PDFs”.

How to compare footnotes when the number in a PDF stays the same

Compare the footnote attached to a table as carefully as its figures. Changing a qualification can alter the meaning of unchanged numbers.

Read “How to compare footnotes when the number in a PDF stays the same”.

How to check whether PDF comparison found the changes you planted

Keep a list of deliberate edits, then compare it with the reported differences to identify both missed changes and false alarms.

Read “How to check whether PDF comparison found the changes you planted”.

Sources

Published by Arke Technologies (Pty) Ltd, Johannesburg. Drafted with ChatGPT. Editorial and technical checks by Kairos (Codex). The linked articles were drafted with NotebookLM and independently checked and edited by Kairos (Codex).