Skip to content

Fix docs examples that don't compile or mislead - #69

Merged
MarcinZiabek merged 5 commits into
mainfrom
docs/rotate-layout-method-names
Oct 27, 2026
Merged

MarcinZiabek merged 5 commits into
mainfrom
docs/rotate-layout-method-names

Conversation

@DawidRobertNowak

@DawidRobertNowak DawidRobertNowak commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Docs examples that don't compile on the current QuestPDF, use obsolete APIs, or describe behaviour incorrectly. Every change verified on QuestPDF 2026.9.1.

Wrong or missing names (compile errors)

  • Rotate: RotateCounterclockwise / RotateClockwise → RotateLayoutCounterclockwise / RotateLayoutClockwise; table basics: obsolete RotateLeft() replaced.

  • Document operations: LayerConfiguration, DocumentAttachment, DocumentAttachmentRelationship, Encryption40Bit/128Bit/256Bit → DocumentOperation.… (nested types, 12 places).

  • Units: Unit.Points → Unit.Point; Unit.Millimeters, Unit.Millimeter → Unit.Millimetre; Unit.Centimeter → Unit.Centimetre; Unit.Mill → Unit.Mil (border, column, row, page settings, length units). The units table now lists every unit once and notes the British spelling.

  • Generating output: GenerateSvgFiles() → GenerateSvg().

  • Debug area: .Debug(...) → .DebugArea(...).

  • Components: IContainer.Empty → EmptyContainer.Create(), plus the missing ) before .GeneratePdf(...).

  • Style inheritance: container.container.Padding(5) → container.Padding(5).

  • Dynamic components: using QuestPDF.Elements; (for DynamicContext) and using System.Globalization; (for CultureInfo).

  • Barcodes: the QR example used BarcodeFormat.EAN_13 → BarcodeFormat.QR_CODE.

  • Text style, font family: Times New Roman / Courier New are system fonts, not loaded by default since 2026.9, so the example threw → the bundled Noto Serif / JetBrains Mono the tests already use; image regenerated, intro points to font management.

Obsolete APIs

  • PdfA = true → PDFA_Conformance = PDFA_Conformance.PDFA_3B (document operations, ZUGFeRD).
  • Grid → Column + Row (debug area, image basics, prototyping, document structure ×3), the replacement the obsolete message suggests.
  • MinimalBox() → Shrink(); Text(double) → Text($"{…}") (table header and footer).

Misleading text

  • SVG: "same scaling options as raster images" → the real options; SVG always keeps its aspect ratio. New "Transparent colors" section: QuestPDF writes #AARRGGBB, the SVG renderer reads #RRGGBBAA, so use fill-opacity in SVG markup; the colors page links to it.
  • Layers: additional layers continue across pages but are not repeated on each one (verified); for content on every page, use the page Background / Foreground slots.
  • Shadow: blur, spread and offsets are in points, not pixels (rendered: OffsetX = 50 moves the shadow by 100 px at 144 DPI).
  • Text basics: the "Download" fallback of the embedded hyperlink PDF pointed to a different file (document-merge-continuous.pdf).
  • Text style, Break Anywhere: long words already wrap without it; it changes where lines break (fills lines instead of breaking at / or -).

Check

  • Every changed snippet extracted from the pages and compiled against QuestPDF 2026.9.1: 0 errors, 0 warnings; the dynamic-components and components examples also run and produce the expected PDF.
  • Grid, MinimalBox and Text(double) replacements render identically to the old code (positions of every rectangle, word and image compared), so the existing example images stay valid.
  • Unit conversions in the table measured in a generated PDF (1 in = 72 pt, 1 ft = 864 pt, 1 mil = 0.072 pt, 1 cm = 28.35 pt).
  • A scan of all docs pages for type and member names that don't exist in, or are obsolete in, the 2026.9.1 package finds nothing left except the intentionally legacy Previewer page.
  • npm run docs:build passes; merges cleanly with main and with Make llms.txt a useful entry point for AI assistants #70.

Why

Found by an AI documentation test: real developer questions answered by AI agents from the docs, every answer compiled. Most failures came from docs snippets like these, and tools that index the docs (e.g. Context7) copy them as they are.

🤖 Generated with Claude Code

@DawidRobertNowak DawidRobertNowak changed the title Use the RotateLayoutClockwise / RotateLayoutCounterclockwise method names Fix API names in examples: rotate methods, SVG scaling options, QR barcode format Oct 17, 2026
@DawidRobertNowak DawidRobertNowak changed the title Fix API names in examples: rotate methods, SVG scaling options, QR barcode format Fix docs examples that don't compile: rotate names, SVG scaling, QR format, nested DocumentOperation types, obsolete PdfA Oct 17, 2026
@DawidRobertNowak
DawidRobertNowak force-pushed the docs/rotate-layout-method-names branch from 1b751b0 to 10083f1 Compare October 20, 2026 13:32
@DawidRobertNowak DawidRobertNowak changed the title Fix docs examples that don't compile: rotate names, SVG scaling, QR format, nested DocumentOperation types, obsolete PdfA Fix docs examples that don't compile or mislead Oct 20, 2026
- Rotate: RotateLayoutClockwise / RotateLayoutCounterclockwise; table basics:
  obsolete RotateLeft replaced.
- SVG: describe the real scaling options (SVG keeps its aspect ratio); add a
  section on transparent colors (QuestPDF writes #AARRGGBB, the SVG renderer
  reads #RRGGBBAA); colors page points to it.
- Barcodes: the QR example uses BarcodeFormat.QR_CODE.
- Document operations: nested DocumentOperation types are qualified;
  document operations and ZUGFeRD use PDFA_Conformance instead of obsolete PdfA.
- Units: Unit.Point, Unit.Centimetre, Unit.Millimetre, Unit.Mil (border, column,
  row, page settings, length units table, which also lists every unit once).
- Generating output: GenerateSvg instead of GenerateSvgFiles.
- Debug area: DebugArea instead of Debug.
- Components: EmptyContainer.Create() instead of IContainer.Empty, and the
  missing parenthesis before GeneratePdf.
- Dynamic components: usings for QuestPDF.Elements and System.Globalization.
- Layers: additional layers continue across pages but are not repeated;
  point to the page Background / Foreground slots.
- Text style: say what BreakAnywhere changes; long words already wrap.
- Obsolete Grid, MinimalBox and Text(object) replaced with Column/Row, Shrink
  and string text; the rendered output is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DawidRobertNowak and others added 4 commits October 21, 2026 13:32
Verified by rendering: OffsetX = 50 moves the shadow by 100 px at 144 DPI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fallback link of the embedded text-hyperlink.pdf pointed to document-merge-continuous.pdf.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Times New Roman and Courier New are system fonts, which QuestPDF 2026.9 no longer loads by default, so the example threw. The tests switched to Noto Serif and JetBrains Mono; the page, its image and the intro sentence now match and point to font management.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t, refine SVG color handling, and clean up dynamic components example.
@MarcinZiabek
MarcinZiabek merged commit 5ff38b6 into main Oct 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants