A-series paper folds and print scaling — reproducible geometry
Executed 2026-11-06: macOS 27.0.1, arm64, CPython 3.12.14.

Run in the extracted directory:
  python3 a-series-paper-lab.py --svg rerun.svg > rerun.json

The standard-library script takes no document input, contacts no network,
and uses no printer. With no --svg argument it only writes its JSON report
to stdout. The optional argument writes a diagram to the supplied path.
Assertions cover ten placement cases, nominal folds, two invalid margins,
and the round-trip length multiplier. The archive contains the script,
recorded JSON, original SVG diagram, and this file.

The two-up case also checks two A4 portraits with a fixed 6 mm gap. With
no outer margins, the maximum equal scale on landscape A3 is 69/70.

Geometry:
- Paper and source sizes are width by height in mm, in fixed orientations.
- A fold divides the longest side by two and sorts the resulting sides.
- A printable rectangle is the paper size minus equal margins on all sides.
- Fit uses the smaller of target width/source width and target height/source
  height. A content rectangle is assumed centered in its target.
- Rational scales are evaluated exactly. The irrational ideal scale uses
  Decimal with 50 significant digits. JSON decimals are formatted to eight
  decimal places after the fit decision.

The 5 mm destination margins and 10 mm source margins are teaching
assumptions, not specifications for any printer. The 141% and 70% menu
values are inputs to the model, not measurements of the device. This lab
does not measure tolerances, paper transport, driver settings, printing,
centering error, auto rotation, or PDF box handling. The diagram is a
screen illustration, not a calibration sheet.

Sources checked 2026-11-06:
https://www.iso.org/standard/36631.html
https://www.w3.org/TR/css-page-3/#page-size-prop
https://oip.manual.canon/USRMA-7979-zz-CS-enGB/contents/devu-set_menu_list-fnc-copy.html
https://helpx.adobe.com/acrobat/desktop/print-documents/set-up-and-print-pdfs/page-size.html
