Print header and footer text

xlsx.print-header-footer

Text in a sheet's print header or footer appears on paper and in Page Layout view, and never in the Normal view a reviewer scrolls.

How the text is hidden

A worksheet's <headerFooter> element holds up to six strings — odd, even and first, header and footer. Each is a single string, not markup: &-escapes carry position, font, size, colour and auto-fields, so &C&"Aptos"&12&K000000 OFFICIAL is a centred 12pt black OFFICIAL with everything before the word being instructions to the renderer. Excel prints it on every page and shows it in Page Layout view; the Normal grid does not display it.

Why a model still reads it

The element sits inside the worksheet part, which every package reader opens, and the words are plain text in the string. A caller reading extracted text meets the header content without having met it in the application.

What we do about it

headerFooterBlocks reads all six slots, strips the renderer's codes in a fixed longest-first order — an escaped && is restored to a literal ampersand rather than dropped — and emits each non-empty string as a block with role header or footer, on the container of the sheet that owns it, so the caller can tell which sheet carried a marking. The runs are marked visible: true: a payload moved here is printed, so it is more visible, not less. The rule xlsx-print-header-footer matches on the block role and reports at severity informational with action disclose.

How often it fires

7.2% of 200 real workbooks from five national open-data portals (CA, IE, DE, GR, UK), measured 2026-08-21.

This is an alert-volume number and nothing else. It says how often the alarm sounds on documents as found — not how often it is right, and not whether what it found was harmless. Documents as found may themselves carry concealment. Read it against the population named above rather than as a property of documents in general.

next

Check your own file

Three commands: a key, credit, a verdict.

Start with the API