Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › document chunking

Adding Headings to PDF Text for AI Retrieval: Do They Help, and Why Pages After 1 Were Off by One

By Freedom251 Team · · 6 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Headings can help an AI retrieval pipeline, but only under one condition: the PDF’s heading structure has to survive extraction, and the chunker or index has to use that structure to keep each passage tied to its section. Heading-looking text pasted into a flat text stream does not reliably produce that outcome, because a parser may never identify it as a heading and retrieval may never read it as one.

The symptom in the title, “one level off,” is ambiguous. It could describe heading depth, where a section lands one level too shallow or too deep. It could also describe page numbers, where everything after the first page is reported one number lower than the page a reader sees. The “Page 1” wording points to the page-number reading, and this article treats that as the primary problem while noting the heading-depth case where it matters. Neither can be diagnosed from the title alone. The cause depends on the source PDF, the parser, and the extracted output. A useful first check is whether the pipeline mixes a zero-based internal page index with a displayed page label.

As an Amazon Associate I earn from qualifying purchases.

What a PDF heading actually is

In the PDF standard as the W3C describes it, a heading is structure, not appearance. The W3C’s technique PDF9 explains that headings are marked as H or H1 through H6 elements in the PDF’s structure tree, and that a logical heading hierarchy gives assistive technologies a navigable outline of the document. The technique puts it this way: “The purpose of this technique is to show how headings in PDF documents can be marked so that they are recognized by assistive technologies.” (W3C PDF9 technique)

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

That distinction matters for retrieval. A line that is bold, large, or centered on the page looks like a heading to a person, but a parser only knows it is a heading if the file tags it as one or if the parser infers it from layout. A PDF can carry several separate layers: the visual page layout, the machine-readable text, the tagged structure tree, and the page labels shown to readers. These layers are related but not identical, and a pipeline can keep one and lose another.

#1 Best Overall
Adobe Acrobat Pro | PDF Software | Convert, Edit, E-Sign, Protect | PC/Mac Online Code | Activation Required
  • Create and edit PDFs. Collaborate with ease. E-sign documents and collect signatures. Get everything done in one app, wherever you go.
  • Edit text and images without jumping to another app.
  • E-sign documents or request e-signatures on any device. Recipients don’t need to log in to e-sign.
  • Convert PDFs to editable Microsoft Word, Excel, or PowerPoint documents.
  • Share PDFs for collaboration. Commenting features make it easy for reviewers to comment, mark up, and annotate.

Where heading structure gets lost

Heading information is often lost at the first step, when the parser turns a PDF into text or blocks. Google Cloud’s Agent Search documentation illustrates how much this depends on the parser. Its digital parser, the one that reads text already embedded in the file, does not identify headings. Its official description reads: “The digital parser extracts machine-readable text from documents. It detects text blocks, but not document elements such as tables, lists, and headings.” (Google Cloud Agent Search: parse and chunk documents)

Parser type (per Google Cloud documentation) Detects headings? What the documentation says it is for
Digital parser No. It detects text blocks, not headings, tables, or lists. Extracting machine-readable text from documents
Layout parser Yes. It detects headings and other document elements and enables content-aware chunking for RAG. Complex hierarchy and tables, per Google’s recommendation
PDF OCR parser Not stated for headings in the cited documentation. Scanned or image-based text

These are product-specific descriptions. They show what Google’s parsers are documented to do, not what every parser does. When you compare parsers, check four things: whether heading structure is detected, whether scanned or image-based text is handled, whether reading order and tables are preserved, and whether the output gives the chunker usable structural metadata.

Rank #2
Acrobat Pro | 1-Month Subscription | PDF Software |Convert, Edit, E-Sign, Protect |Activation Required [PC/Mac Online Code]
  • Create and edit PDFs. Collaborate with ease. E-sign documents and collect signatures. Get everything done in one app, wherever you go.
  • Edit text and images without jumping to another app.
  • E-sign documents or request e-signatures on any device. Recipients don’t need to log in to e-sign.
  • Convert PDFs to editable Microsoft Word, Excel, or PowerPoint documents.
  • Share PDFs for collaboration. Commenting features make it easy for reviewers to comment, mark up, and annotate.

Even a parser that detects headings only helps if the rest of the pipeline keeps them. Heading information has to survive chunk construction and be stored as metadata. If a later step discards the hierarchy, the heading markup cannot improve retrieval at that point.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do headings improve retrieval? What the evidence shows

Google’s Agent Search documentation says that document chunking indexes data in chunks and that its layout parser detects structural elements such as headings so chunking can follow the content. That is a vendor’s description of intended behavior. It does not independently measure whether headings improve every retrieval result.

Rank #3
PDF Extra Lifetime - Professional PDF Editor - Best Adobe Acrobat Pro Alternative - Lifetime License for Windows PC
  • Perfect Adobe Acrobat Pro alternative – lifetime license for Windows 10 and 11.
  • EDIT text, images, pages, hyperlinks, designs in PDF documents. ORGANIZE PDFs.
  • READ and Comment on PDFs – Intuitive reading modes & document commenting and mark up tools!
  • CREATE, COMBINE, SCAN and COMPRESS PDFs.
  • FILL forms & Digitally Sign PDFs. Work with Digital certificates

The most direct comparison available is a 2026 arXiv preprint, From PDF to RAG-Ready: Evaluating Document Conversion Frameworks for Domain-Specific Question Answering. Its authors built a manually curated benchmark of 50 questions over 36 Portuguese administrative documents, totaling 1,706 pages and about 492,000 words. Reported accuracy:

Configuration (as named in the preprint) Reported score Scope of the result
Naïve PDFLoader 86.9% The preprint’s benchmark, 2026
Manually curated Markdown 97.1% The preprint’s benchmark, 2026
Docling with hierarchical splitting and image descriptions 94.1% The preprint’s benchmark, 2026

The authors report that metadata enrichment and hierarchy-aware chunking contributed more to accuracy than the choice of conversion framework alone. That is the most useful finding for this question: keeping structure through to the chunks mattered more than which converter produced the text. Treat it with care. These are results on one corpus, with one question set and one judging setup, in a preprint that may be revised. They are not a general accuracy expectation for a new pipeline, and no industry-wide improvement rate was established in the sources reviewed. (arXiv 2604.04948)

Rank #4
PDF Extra 2024| Complete PDF Reader and Editor | Create, Edit, Convert, Combine, Comment, Fill & Sign PDFs | Lifetime License | 1 Windows PC | 1 User [PC Online code]
  • EDIT text, images & designs in PDF documents. ORGANIZE PDFs. Convert PDFs to Word, Excel & ePub.
  • READ and Comment PDFs – Intuitive reading modes & document commenting and mark up.
  • CREATE, COMBINE, SCAN and COMPRESS PDFs
  • FILL forms & Digitally Sign PDFs. PROTECT and Encrypt PDFs
  • LIFETIME License for 1 Windows PC or Laptop. 5GB MobiDrive Cloud Storage Included.

Why pages after page 1 can be off by one

A page-number offset is usually a mismatch between two numbering conventions, not a damaged file. PyMuPDF’s text extraction takes a zero-based page number, so the first physical page is index 0. Its PDF APIs handle page labels separately, which means the number a reader sees on the page can differ from the internal index. (PyMuPDF document API)

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The mismatch appears when a pipeline stores the index and displays it as the page number, while the PDF’s own label is one-based. Suppose the first physical page is index 0 and carries the label “1.” If the pipeline shows the index, every page reads one lower than its label, and the offset looks like “everything after page 1 is off.” This is a plausible explanation to test, not a diagnosis of any particular file.

Best Value
PDF Director 3 PLUS - Edit, Convert, Redact, Protect PDFs, Fill Forms for Win 11, 10, 8.1, 7
  • Full-featured PDF Editor: Edit text in the document
  • Fully convert PDF to Word and Excel and continue editing
  • NEW: Further development of existing functions
  • NEW: Even faster and more user-friendly
  • NEW: Over 75 small improvements in all areas

Front matter creates a second version of the same problem. Many documents number a preface or contents page with Roman numerals and restart Arabic numbering at the main text. Illustratively, if three Roman-numbered pages come before the body, the body’s first page may be physical index 3 and label “1.” A pipeline that ignores labels will cite that page with a number that matches neither a reader’s view nor the document’s own contents list.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How to find the offset in five steps

  1. Open the PDF and note the displayed page label and physical position for the first several pages, including any Roman-numbered front matter and any point where numbering restarts.
  2. Log both the parser’s page index and the human-facing label in the pipeline output. For each, record whether it is zero-based, one-based, or read from the PDF’s page-label definitions.
  3. Compare the raw extracted text and structure tree with the generated heading and chunk records. Check that each heading is attached to the correct page, and whether section levels shifted during a separate hierarchy-building step.
  4. After ingestion, inspect chunk boundaries and metadata. If heading paths are stored and used for retrieval, confirm that the stored path and source location match the original PDF.
  5. Only after you know which stage introduces the offset, fix that stage. A page-base mismatch is corrected in the numbering code; a shifted heading level is corrected in the hierarchy step; a missing heading is a parser or tagging issue.

The title alone cannot identify the PDF, parser, software version, or implementation, so no single root cause can be named without the extracted output for the actual file.

Checking and correcting heading tags in Acrobat

If the PDF’s tags are the source of the problem, Adobe’s Reading Order tool in Acrobat Pro can show the order of highlighted regions, let you move regions, and apply heading levels. It is useful for verifying a file before it enters an ingestion pipeline. (Adobe Acrobat Reading Order tool documentation)

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Confirm that each heading region is tagged, and that its level matches its place in the outline.
  • Confirm that reading order follows the visual order of the page, especially in multi-column layouts.
  • Check the page labels in the document properties against what your pipeline reports.

Adobe cautions that manual tagging does not provide as much structure detail as its Add Tags to Document command. For a file with many headings or complex layouts, a manual fix may be enough for a single correction but less thorough than regenerating the tag structure, and the trade-off should be checked on the actual file before you rely on it.

Quick Recap

Bestseller No. 1
Adobe Acrobat Pro | PDF Software | Convert, Edit, E-Sign, Protect | PC/Mac Online Code | Activation Required
Adobe Acrobat Pro | PDF Software | Convert, Edit, E-Sign, Protect | PC/Mac Online Code | Activation Required
Edit text and images without jumping to another app.; Convert PDFs to editable Microsoft Word, Excel, or PowerPoint documents.
$239.88
Bestseller No. 2
Acrobat Pro | 1-Month Subscription | PDF Software |Convert, Edit, E-Sign, Protect |Activation Required [PC/Mac Online Code]
Acrobat Pro | 1-Month Subscription | PDF Software |Convert, Edit, E-Sign, Protect |Activation Required [PC/Mac Online Code]
Edit text and images without jumping to another app.; Convert PDFs to editable Microsoft Word, Excel, or PowerPoint documents.
$29.99
Bestseller No. 3
PDF Extra Lifetime - Professional PDF Editor - Best Adobe Acrobat Pro Alternative - Lifetime License for Windows PC
PDF Extra Lifetime - Professional PDF Editor - Best Adobe Acrobat Pro Alternative - Lifetime License for Windows PC
Perfect Adobe Acrobat Pro alternative – lifetime license for Windows 10 and 11.; EDIT text, images, pages, hyperlinks, designs in PDF documents. ORGANIZE PDFs.
$99.99
Bestseller No. 4
PDF Extra 2024| Complete PDF Reader and Editor | Create, Edit, Convert, Combine, Comment, Fill & Sign PDFs | Lifetime License | 1 Windows PC | 1 User [PC Online code]
PDF Extra 2024| Complete PDF Reader and Editor | Create, Edit, Convert, Combine, Comment, Fill & Sign PDFs | Lifetime License | 1 Windows PC | 1 User [PC Online code]
READ and Comment PDFs – Intuitive reading modes & document commenting and mark up.; CREATE, COMBINE, SCAN and COMPRESS PDFs
$99.99
Bestseller No. 5
PDF Director 3 PLUS - Edit, Convert, Redact, Protect PDFs, Fill Forms for Win 11, 10, 8.1, 7
PDF Director 3 PLUS - Edit, Convert, Redact, Protect PDFs, Fill Forms for Win 11, 10, 8.1, 7
Full-featured PDF Editor: Edit text in the document; Fully convert PDF to Word and Excel and continue editing
$29.99

“

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

document chunkingpage labelsPDF accessibilityPDF headingsPDF parsingRAG

Leave a Reply

Your email address will not be published. Required fields are marked *

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.