Page reorder & rotation (page model)
Applies an order permutation and per-page rotations to mixed landscape/portrait pages; only pages whose position or angle actually changed are committed, and a no-op has commitCount=0.
Inputs and parameters
document— Single document page model (JSON)order— Page-id order (comma-separated; leave empty to keep original)rotations— Rotation map (JSON, angles are multiples of 90)
Real example
document=5-page mixed landscape/portrait model (p1 landscape, p2 portrait…); order=p2,p1,p3,p4,p5; rotations={"p2":90}
→ plan.commitCount=2; changed=[{id:"p2",fromIndex:2,toIndex:1,fromRotation:0,toRotation:90},{id:"p1",fromIndex:1,toIndex:2,...}]; unchangedIds=["p3","p4","p5"]. An empty edit has commitCount=0.
Limits and failure handling
order must be a unique permutation of original page ids; rotations only accept known pages with 90-degree multiples; only a change list is produced — pages are not re-rendered and no PDF is generated. Opening a downloaded result to verify orientation is not tested.
FAQ
Can I rotate by 45 degrees?
No, INVALID_ROTATION is returned; angles must be multiples of 90 and are normalised to 0/90/180/270.
Can I verify page orientation in a downloaded result?
Not this round. The real PDF engine is not integrated/tested and no openable result file exists; the JSON plan records target orientation/angle only. Browser verification is pending after engine integration.