Appearance
Transformations
Press supports rotating block elements in 90-degree increments. This is primarily useful for fitting wide content (like landscape data tables) into portrait pages.
Rotation
Add the rotation attribute to any block element:
xml
<frame rotation="270">
<!-- Content rendered in landscape orientation -->
</frame>Valid Values
| Value | Effect |
|---|---|
90 | Rotate 90 degrees clockwise |
180 | Rotate 180 degrees (upside down) |
270 | Rotate 270 degrees clockwise (90 degrees anti-clockwise) |
How Rotation Works
Rotation happens in-place around the element's top-left corner.
Important: width and height are pre-rotation dimensions. All other positioning attributes (top, left, right, bottom) are post-rotation.
This means for a landscape table on a portrait page:
xml
<frame rotation="270" width="700pt" height="500pt">
<table>
<!-- Wide table content -->
</table>
</frame>width="700pt"is the width before rotation (which becomes the height available for children)height="500pt"is the height before rotation (which becomes the width available for children)
Example: Landscape Data Table
A monthly statistics table that's too wide for portrait. Rotate it 270 degrees so it reads naturally when the page is turned:
xml
<press>
<document format="A4" page-margin="1cm">
<page>
<frame rotation="270" width="100%">
<table font-size="7pt">
<tr>
<th>Variable</th>
<th>Jan</th>
<th>Feb</th>
<th>Mar</th>
<th>Apr</th>
<th>May</th>
<th>Jun</th>
<th>Jul</th>
<th>Aug</th>
<th>Sep</th>
<th>Oct</th>
<th>Nov</th>
<th>Dec</th>
</tr>
<repeat data="data.rows" item="row">
<tr>
<td font-style="bold">{{ row.label }}</td>
<repeat data="row.values" item="val">
<td text-align="center">{{ val }}</td>
</repeat>
</tr>
</repeat>
</table>
<p font-size="7pt" font-color="#6b7280" space-before-desired="8pt">
Table 1: Summary of monthly statistics for the reporting period.
</p>
</frame>
</page>
</document>
</press>Nesting Rotated Elements
Rotations can be nested -- a rotated frame inside another rotated frame will have their rotations combined.