Skip to content

Layout: an unknown placeholder in a running band template is printed literally without a report #598

Open

Description

@Tim81

Problem

RunningBand.Resolve replaces {page} and {pages} and leaves any other brace text as given. A typo such as
{total} is drawn as text, and nothing reports it. (origin/main 1c61fa6,
src/VellumPdf.Layout/Elements/RunningBand.cs.)

195:     /// Any other brace text is left as given. A null template throws
...
201:     public string Resolve(int pageNumber, int totalPages) =>
202:         Template
203:             .Replace("{page}", pageNumber.ToString(...), StringComparison.Ordinal)
205:             .Replace("{pages}", totalPages.ToString(...), StringComparison.Ordinal);

The behaviour is documented, so this is a missing report, not a hidden one. A caller who types {total},
{Page} or { page } has no way to learn it from the library.

Measured

Measured in the 2026-11-16 handbook research on VellumPdf 2.3.3 (not reproduced for this issue): the footer
Pagina {page} van {total} rendered as Pagina 1 van {total}.

Scope (v2.4: report; refused only in strict mode, which is opt-in)

Acceptance

  • Pagina {page} van {total} yields one report naming {total}; Pagina {page} van {pages} yields none.
  • Default mode saves with the same bytes as today; strict mode throws.
  • A template with two unknown tokens reports both.
  • The test fails on origin/main 1c61fa6, proven by mutation.

Relates to

Activity

  1. added
    bug
    area/layout
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/layoutbug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions