PDF/A error

PDF/A error: broken or invalid cross-reference table

A damaged xref table means offsets do not point where they claim. Why it happens, what a validator can still tell you, and how to repair it.

The cross-reference table — the index mapping object numbers to byte offsets — does not match the file, so objects are not where the document says they are. Rebuild the file from a reader that can recover it; gopdfrab reconstructs the table where possible and reports the damage rather than refusing to open the file.

ISO 19005-1 clause 6.1File structure

The File structure check group covers 6.1.x — file header, trailer, xref, object framing, limits. The exact sub-clause is reported on the issue itself when the validator raises it.

What causes it

  • A truncated or interrupted upload, download or copy.
  • A file edited with a tool that wrote objects without updating the table.
  • Incremental updates appended incorrectly, so the chain of previous tables does not resolve.
  • Byte-level corruption in storage or transfer — often line-ending translation from a text-mode transfer.

How to fix it

  1. Recover the original file if you can. A rebuilt cross-reference table restores access to the objects that survived, not to the ones that were lost.
  2. Open and re-save with a tool that reconstructs the table by scanning for objects. gopdfrab does this on open, which is why a damaged document still produces a verification result.
  3. Check the transfer path if this recurs — a systematically corrupted file usually means a broken pipeline rather than a broken document.

Frequently asked

Can a document with a broken xref still be verified?

Usually yes. gopdfrab recovers what it can and reports issues on the recovered document, so a damaged file gives you a diagnosis rather than a hard failure. What it will not do is call the result conformant when the structure is not.

Does rebuilding the table fix the document?

It fixes the index. Objects that were actually lost stay lost — a rebuilt table just stops the file being unreadable because of the index alone.

How do I tell corruption from a merely non-conformant file?

Typed errors. gopdfrab distinguishes "this file is damaged" from "this file is valid PDF that fails PDF/A", so your code can react differently to the two.

Check your own document
The validator runs the same engine in your browser and names every failing check. The file is never uploaded.

Related failures

Encrypted document
PDF/A forbids encryption of any kind, including permission-only owner passwords. Why, and how to produce an unencrypted archival copy.