Element positions
Every page's box, and every element with an id on each page it is drawn on, from the engine's own placement.
curl https://api.reflowpdf.com/v1/layout \
-H "Authorization: Bearer $REFLOWPDF_API_KEY" \
-H "Content-Type: application/json" \
-d '{"html": "<h2 id=\"terms\">Terms</h2>…<table id=\"items\">…</table>"}'const { pages, elements } = await reflow.layout.create({ html })
const terms = elements.find(e => e.id === 'terms') // { id, page, x, y, width, height }layout = client.layout.create(html=html)
terms = next(e for e in layout.elements if e.id == "terms"){
"object": "layout",
"unit": "pt",
"document_pages": 2,
"pages": [
{
"number": 1,
"width": 595.28,
"height": 841.89
},
{
"number": 2,
"width": 595.28,
"height": 841.89
}
],
"elements": [
{
"id": "terms",
"page": 1,
"x": 56.69,
"y": 412.3,
"width": 481.89,
"height": 21.6
},
{
"id": "items",
"page": 1,
"x": 56.69,
"y": 452.1,
"width": 481.89,
"height": 332.1
},
{
"id": "items",
"page": 2,
"x": 56.69,
"y": 56.69,
"width": 481.89,
"height": 120.4
}
],
"missing_variables": [],
"skipped_resources": []
}- Rectangles in points (1/72 inch) from each page's top-left corner.
- An element across pages is on each: the table above starts on page 1 and ends on page 2.
- Only elements with an
idare reported: name what you want to find.
Build a table of contents with page numbers, place a signature field or a stamp where a block ended, check that a summary fits on its first page before you send it. A template's: POST /v1/templates/{id}/layout. Counted as the document's pages.