What is inside a PDF file, and what does repairing one do?
A PDF is a header naming its version, a body of numbered objects (pages, fonts, images, streams), a cross-reference table that records where each object starts, and a trailer pointing at the catalogue and the metadata. Metadata lives in the Info dictionary (title, author, dates, producer) and, since PDF 1.4, in an XMP stream; fonts are embedded whole, subsetted or only referenced by name. A viewer that cannot find an object walks the file to rebuild the cross-reference table — repair does the same and writes the rebuilt table, which fixes most "damaged file" errors without touching the pages.
Part 1:%PDF-1.7 Part 2:1 0 obj << /Type /Catalog /Pages 3 0 R >> endobj Part 3:2 0 obj << /Title (Invoice) /Producer (…) >> endobj Part 4:3 0 obj << /Type /Pages /Kids [4 0 R] /Count 1 >> endobj 4 0 obj << /Type /Page /Parent 3 0 R /Contents 5 0 R >> endobj Part 5:5 0 obj << /Length 44 >> stream … endstream endobj Part 6:xref 0 6 0000000000 65535 f … Part 7:trailer << /Size 6 /Root 1 0 R /Info 2 0 R >> startxref … %%EOF
- 2–5Body: numbered objects, counted by
/Typein the object census
- 1HeaderNames the PDF version
- 2Catalog (
/Root)The root dictionary; points to the page tree and almost everything elseCatalog tree - 3Info dictionaryMetadata: title, author, dates, producer
- 4Page tree
/Pageslists its/Kids; each/Pagepoints to its contentPage tree statistics - 5Content streamThe page’s drawing instructions, between
streamandendstreamStreams - 6Cross-reference tableWhere each object starts; repair rebuilds it
- 7Trailer
/Size,/Root,/Info, plus/Encrypt,/IDor/Prevwhen the file has themTrailer rows
A minimal file with byte offsets left out. Many files keep a cross-reference stream instead of the table, or several trailers linked by /Prev; the inspector reads the last one.
How to use PDF Structure Inspector
- Drop a PDF.
- Click "Inspect".
- Expand the catalog tree and read the findings.
PDF Structure Inspector features
- Header, trailer (/Size, /Root, /Info, /Encrypt, /ID, /Prev)
- Catalog dictionary as a browsable tree (two levels)
- Object census by /Type
- Page tree statistics and stream count
- Findings: JavaScript, OpenAction, launch actions, attachments, forms, multimedia, encryption
- Read-only; local processing
PDF Structure Inspector example
Look inside a generated invoice
Input:
invoice.pdfOutput:
Header %PDF-1.7 · trailer /Size 48 · Root 1 0 R · Info 2 0 R · objects: Page 2, Font 3, XObject 1, … · findings: noneFrequently asked questions about PDF Structure Inspector
What is the catalog?
The root dictionary of a PDF (/Root in the trailer). It points to the page tree, outlines, names, metadata, viewer preferences and interactive features; almost everything hangs off it.
Why are some objects counted as "unknown"?
Objects without a /Type key — content streams, images referenced only by name, arrays — are grouped by what can be inferred; the rest are reported as untyped.
Can I edit objects here?
No, the inspector is read-only. Use Sanitize PDF to remove active content and the Metadata Editor for document properties.
Is my PDF uploaded to a server?
No. The file is opened and processed by your browser with WebAssembly and JavaScript; nothing is sent to Mutqan Soft or anyone else. Close the tab and the file is gone. Downloading the result needs a free account — no subscription, no payment.
Can I use it on a password-protected PDF?
Yes, if you know the password: the file list asks for it once and every operation then works on the decrypted pages. The output is saved without a password unless you protect it again.
Technical notes
The inspector reads the tolerant pdf-lib object table and the catalog, and takes /Size and /Prev from the last trailer or cross-reference stream in the bytes; nested dictionaries are described to depth 2 with names, numbers, strings, array lengths and stream markers. It never resolves /Parent or /Pages upwards, which keeps the tree finite.
References
- ISO 32000-2:2020 — Document management — Portable document format — Part 2: PDF 2.0The current PDF standard: file structure, objects, pages, fonts, annotations, forms and encryption.
- PDF Reference — ISO 32000-1:2008 (PDF 1.7), Adobe copyThe freely readable PDF 1.7 specification: page trees, content streams, metadata, permissions and the standard security handler.
- PDF.jsThe open-source PDF renderer that draws PDF pages in the browser without a plugin — how documents are previewed locally.