Document Structure
A Craft Language file is an XML document whose root element is <Document>.
Inside the root you define three optional sections — Header, Body, and
Footer — that map to the top, middle, and bottom areas of every page.
Minimal Example
<Document path="output/">
<Body margin_left="20" margin_right="20">
<Text font_size="24" style="bold">Hello, Docraft!</Text>
</Body>
</Document>
Root Element: <Document>
Attribute |
Type |
Description |
|---|---|---|
|
string |
Output directory for the rendered file. |
Sections
Common Node Attributes
Every content node supports these attributes:
Attribute |
Type |
Description |
|---|---|---|
|
string |
Logical name for DOM lookups. |
|
float |
Position in points (used with |
|
float |
Explicit size in points. |
|
bool |
Auto-fill available width (default |
|
bool |
Auto-fill available height (default |
|
float |
Inner padding in points. |
|
float |
Layout weight for proportional sizing inside |
|
|
Positioning mode (default |
|
int |
Stacking order (higher renders on top). |
|
bool |
Whether the node is rendered (default |
Color Values
Colors can be specified as:
Hex:
#RRGGBBor#RRGGBBAANamed:
black,white,red,green,blue,yellow,magenta,cyan,purpleTemplate:
${variable}or${data("field")}
Page Break
Insert <NewPage/> to force a manual page break.
<Body>
<Text>Page one content</Text>
<NewPage/>
<Text>Page two content</Text>
</Body>
Blank Line
Insert <Blank/> to add vertical spacing.
<Text>First paragraph</Text>
<Blank/>
<Text>Second paragraph</Text>