Skip to content

BL-15958 Expand full-bleed page-size support and dotImpose handoff - #8263

Draft
hatton wants to merge 3 commits into
masterfrom
BL-15958-page-sizes
Draft

BL-15958 Expand full-bleed page-size support and dotImpose handoff#8263
hatton wants to merge 3 commits into
masterfrom
BL-15958-page-sizes

Conversation

@hatton

@hatton hatton commented Aug 31, 2026

Copy link
Copy Markdown
Member

[Claude Fable 5 following a prompt from Hatton]

Part 2 of 3 of the updated BL-15958 work, split out of #7713.

Tracker: BL-15958

What this does

  • Adds DistFiles/pageSizesLookup.json, generated at build time by src/content/pageSizes.ts, so C# code can look up trim dimensions for any layout. SizeAndOrientation.TryGetSizeInMillimeters reads it.
  • EpubMaker.GetPageDimensions now uses that lookup instead of parsing pageSizes.json itself.
  • The PDF pipeline supports full bleed for all page sizes: MakePdfUsingExternalPdfMakerProgram sizes full-bleed pages from the lookup, and PdfMaker writes explicit trim/bleed boxes before the dotImpose handoff.
  • Booklet layouts keep trim-sized source pages (PublishModel.GetPrintingWithFullBleed).
  • Updates sillsdev.dotImpose to 2.6.7-test, published to nuget.org from sillsdev/dotImpose master. The new library deprecates NullLayoutMethod(insetTrimboxMillimeters); Bloom now uses the parameterless NullLayoutMethod() because the source PDF carries explicit boxes.

Follow-up before merge

The pin is a prerelease version (2.6.7-test). The dotImpose publish workflow fills its default suffix "test" even when the dispatch input is empty, so a release version needs a one-line workflow fix in that repo first. Then bump the pin here.

Relationship to the other parts

Independent of the other two PRs; based on master. The siblings are the edge-to-edge theme PR (#8262) and the edit-mode crop-marks PR (#8264).

Verification

  • The full front-end build passes and regenerates the lookup file.
  • The PdfMakerTests and MakePdfUsingExternalPdfMakerProgramTests fixtures pass: 25 of 25, including the full-bleed crop-marks trim test that failed against dotImpose 2.6.2.

🤖 Generated with Claude Code


This change is Reviewable

Devin review

Adds DistFiles/pageSizesLookup.json (generated by src/content/pageSizes.ts)
so C# code can look up page dimensions for any layout. Uses it in
SizeAndOrientation, EpubMaker, and the PDF pipeline. Keeps full-bleed
trim/bleed boxes intact through the dotImpose handoff, and keeps booklet
source pages trim-sized.

Known issue: NullLayoutMethod_FullBleedWithCropMarks_KeepsTrimAtFinalPageSize
fails against the public sillsdev.dotImpose 2.6.2; the expected behavior
exists only in unpublished dotImpose builds (2.6.9-2.6.13).

Carved from the updated BL-15958-edge-to-edge-theme work (PR #7713).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR centralizes page-size dimensions in a generated millimeter lookup and expands the PDF full-bleed pipeline to additional paper sizes and the dotImpose handoff.

  • Generates and distributes pageSizesLookup.json from the canonical page-size configuration.
  • Reuses the lookup for ePub dimensions and full-bleed PDF sizing.
  • Reconstructs PDF trim, bleed, crop, and art boxes before imposition.
  • Keeps booklet source pages trim-sized and adds PDF sizing/box tests.

Important Files Changed

Filename Overview
src/BloomExe/Book/SizeAndOrientation.cs Adds lazy loading and orientation-aware access to generated millimeter dimensions; the two new public methods need documentation comments.
src/content/pageSizes.ts Extends the existing page-size build step to deterministically generate a C#-consumable lookup with configured, ISO-series, and square aliases.
src/BloomExe/Publish/PDF/MakePdfUsingExternalPdfMakerProgram.cs Replaces the fixed full-bleed size switch with lookup-backed trim dimensions plus a 3 mm bleed on every edge.
src/BloomExe/Publish/PDF/PdfMaker.cs Recreates page boxes before dotImpose and supplies a consistent 3 mm full-bleed inset; compatibility with the currently published dotImpose behavior remains explicitly acknowledged by the PR.
src/BloomExe/Publish/PDF/PublishPdfApi.cs Automatically synchronizes crop-mark generation with the selected book's print-bleed preference.
src/BloomExe/Publish/PublishModel.cs Restricts bleed-sized source pages to non-booklet output so imposed booklet layouts continue using trim dimensions.
src/BloomExe/Publish/Epub/EpubMaker.cs Reuses the generated millimeter lookup and converts dimensions to CSS pixels for ePub output.
src/BloomTests/Publish/PDF/PdfMakerTests.cs Adds bleed-offset and dotImpose TrimBox coverage, including the dependency behavior explicitly called out as unresolved.
src/BloomTests/Publish/PDF/MakePdfUsingExternalPdfMakerProgramTests.cs Covers expanded portrait, landscape, square, and unsupported full-bleed page-size handling.

Reviews (1): Last reviewed commit: "BL-15958 Expand full-bleed page-size sup..." | Re-trigger Greptile

hatton and others added 2 commits August 31, 2026 11:00
The newly published dotImpose deprecates NullLayoutMethod(insetTrimboxMillimeters)
and throws when the source PDF already defines a TrimBox. Bloom sets explicit
trim/bleed boxes on full-bleed pages (SetFullBleedPageBoxes), so use the
parameterless NullLayoutMethod and remove GetNullLayoutBleedOffsetMm.
The crop-marks test now builds its input with the same explicit boxes and passes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant