page-layout

command
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Explicit page geometry

GOWORK=off go run ./examples/page-layout
output/qa-venv/bin/python scripts/qa/layout/verify_page_layout.py
NODE_PATH=output/sf-qa/node_modules node scripts/qa/structured/verify_structured.cjs output/page-layout/*.sf

The Go program writes source SF, DOCX, PDF and both reimports under ignored output/page-layout/. No external tools are required at runtime. Python, ProseMirror and LibreOffice are optional independent developer QA.

The three cases are an asymmetric landscape document with merged running content, a repeating body table, conditional cell start, linked RTL note and images; explicit zero edges/distances; and independent anchors on a legacy scalar margin. Source SF/DOCX settings/content/assets match exactly. Native PDFs use nine pages with fourteen exact-pixel placements. See docs/TESTING.md for producer conversion; verify_page_layout.py --office checks six producer pages/eight placements.

Use Layout.Margins to override every edge, including zero. HeaderDistance and FooterDistance pointers measure header top and footer bottom from the page edge. Nil preserves defaults; a nonnil zero is a real zero. The legacy scalar fallback is retained as data even when the group overrides it. Explicit groups use 18pt anchors by default; legacy nil geometry keeps its established writer behavior. The source example includes an ignored 41pt fallback to verify this distinction.

SF retains full precision; DOCX physical settings quantize to twips. Signed vertical offsets survive SF/DOCX and render natively when measured stories do not overlap the fixed body. Actual signed overlap remains unqualified and rejects atomically. See compatibility notes for section, binding and conditional-story gaps.

The native rich case has six pages, including a sparse first page from existing note/table admission. LibreOffice uses three, ignores the cell start and draws a left note separator. Both preserve all content, but this is not Word-equivalent pagination. PDF recovery retains physical page/asset positions and uncertainty; it does not invent authorial margins, anchors or header/footer roles.

Documentation

Overview

Four conversion paths with explicit asymmetric/zero margins and running offsets.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL