Practical guidesCounting

Why a PDF can open in a browser but fail page counting

Diagnose PDFs that open visually but fail counting: distinguish retrieval errors, password requirements, damaged structure and unverifiable recovery.

At a glance

A successful browser view proves that one viewer could display that response. A crawler may receive different bytes, and a tolerant viewer may repair damaged PDF references while opening the file. Reliable counting must establish a retrievable source and a consistent page tree, rather than infer a count from visible thumbnails.

Worked exampleIllustrative data

Investigate the first unsupported step instead of assuming the final parser is at fault.

Example triage sequence
StepQuestionEvidence
RetrieveDid we receive a public PDF?HTTP outcome and actual file type
OpenIs an authorized password needed?Encryption result
CountIs the page tree consistent?Parser outcome
RecoverCan independent readers agree?Verified count or unresolved reason

Scroll sideways to see all columns. Use arrow keys when the table is focused.

First compare the responses

Your browser might have a login cookie, a cached download or a temporary access grant. The public scan intentionally does not inherit that session. Open the URL anonymously and ask the owner to compare the public response with the actual PDF revision used by the report.

A PDF-looking URL can return an error page, incomplete transfer or redirect outside the agreed hosts. Those are retrieval or scope outcomes, not proof that the PDF itself is damaged. Use the report’s reason and observation time to direct the investigation.

  • Confirm anonymous access with the document owner.
  • Check that the response contains a complete PDF, not a login page.
  • Compare byte digests if both retrieved revisions are available.

Then distinguish display from verified structure

PDF readers differ in how they handle cross-reference damage and page-tree inconsistencies. QPDF explicitly distinguishes warnings from errors and can attempt recovery. A warning-free structural check still does not prove every aspect of the document is correct.

DocAccessible first uses strict parsing. For an eligible structural failure, one bounded recovery must find a consistent page tree and an independent reader must agree on a positive count from the original bytes. Disagreement or incomplete verification remains unknown. Password failures do not enter that structural recovery path.

Choose a correction that preserves evidence

Ask the source owner for a fresh export when the authored file is malformed or incomplete. Keep the original for comparison and give the new revision a separate identity in the work log. A changed file should not silently inherit the previous scan result.

For a temporary refusal or unavailable verification service, a permitted retry may help. For a password, use an authorized public or otherwise approved source. For parser disagreement, retain the unknown count and escalate instead of choosing whichever reader gives the most convenient number.

Practical next steps
ReasonOwner action
Public retrieval refusedCheck access policy and approved hosting
Password requiredProvide an authorized readable source
Damaged structureRe-export and retain revision evidence
Readers disagreeKeep unknown; inspect with a specialist

Scroll sideways to see all columns. Use arrow keys when the table is focused.

Sources and scope

Methods, worksheets and illustrative examples are DocAccessible editorial contributions. These references support the technical or product details described above. W3C techniques are informative guidance; they are not a certification scheme.

  1. QPDF: PDF inspection and exit status

    Structural inspection, page-count options and warning versus error outcomes.

  2. RFC 9110: HTTP Semantics

    HTTP response meanings, including redirects, refusals and missing resources.

  3. DocAccessible PDF inventory

    The counting workflow, report options and purchase boundary.

Written by the DocAccessible team under our editorial policy. Suggest a correction if a source or product detail needs updating.

See the evidence in a working example

Explore the public sample inventory report to try its table, full-screen view and missing-count reasons. The downloadable counting fixture check records what the local counter returned for seven self-authored inputs, with hashes and explicit limits.

Put the method to work.

Start with a clearer picture of your PDFs.

See count explanations in an inventory