## TL;DR

The parser read only the first page of multi-page hotel folios, so itemized charges on page two vanished from the audit. Change the parser to iterate every page, concatenate the extracted text in order, and validate that the extracted page count matches the PDF's page count. A page-count assertion turns silent drops into loud failures.

## Error

```text
agent's pdf parser dropped the second page of itemized folios
```

## Steps

1. Confirm the drop: compare the parser's output against the full folio PDF. Expected: page-two charges (often incidentals and taxes) are missing from the output.
2. Check the parser code for a first-page-only read or a page-range default. Expected: the single-page assumption is visible.
3. Change the parser to loop over all pages in order and concatenate the results. Expected: multi-page folios produce complete text.
4. Add an assertion: extracted page count must equal the PDF's reported page count, else raise. Expected: future drops fail loudly instead of silently.
5. Re-parse the affected folios and re-run the audit checks. Expected: the missing charges appear and totals reconcile.

## When to use

- A PDF parser drops pages from multi-page documents.
- Folio totals do not match the parsed line items.
- Validating parser completeness.

## When not to use

- The parser fails on page one (a format problem, not a pagination problem).
- The PDF itself has only one page.
- The text extracts but misreads values (an OCR problem).

## Tool compatibility

Applies to custom audit agents parsing PDFs (Python PDF libraries, cloud document APIs; current 2026 releases).

### Variant phrasings

### folio total exceeds the parsed lines

Later pages were dropped. Parse all pages and assert the count.

### parser only read page one of the pdf

Loop the pages; never assume single-page.

### multi-page receipts parsed incompletely

Concatenate pages in order and validate completeness.

## Why it happens

Many PDF parsing snippets default to page one (sample code, quick prototypes), and the assumption survives into production because single-page receipts are the common case. Hotel folios, the documents most likely to be multi-page, are also the documents where the dropped pages carry the interesting charges (incidentals, taxes). The page-count assertion is the durable fix because it catches the bug class, not just this instance.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_e2dE0Io5f01nO19BYzgntw
