XML Attributes

Core Attributes

Name Description Example

height

Controls the height of an element.

Use height="72" to set the height to 72pt.

id

Unique identifier for an element.

Use id="customersignature" to identify a <signatureBlock> element as the one used to record customer signatures.

lineHeight

Controls the height of a line.

Use lineHeight="2.5" to set the line height to 2.5em (2.5 times the font size).

margin

Controls the margins of an element.

Use margin="36 40 36 40" to set the left and right margins to 36pt and the top and bottom margins to 40pt.

marginBottom

Controls the bottom margin of an element.

Use marginBottom="20" to set the bottom margin to 20pt.

marginLeft

Controls the left margin of an element.

Use marginLeft="20" to set the left margin to 20pt.

marginRight

Controls the right margin of an element.

Use marginRight="20" to set the right margin to 20pt.

marginTop

Controls the top margin of an element.

Use marginTop="20" to set the top margin to 20pt.

maxSize

Sets the maximum size of an element.

Use the maxImageSize attribute to set the maximum size of an <rtf> element.

The maxSize attribute downsizes elements proportionately to have a height or width no greater than the specified size.

Use maxSize="300" to set the maximum size to 300pt.

name

Sets the name for an element.

  • Use name="bold" to set the name for a <style> element to "bold".

  • Use name="Company Logo" to set the name for an <image> element to "Company Logo".

noWrap

Controls whether text wraps inside margins.

Use noWrap="true" to stop text from wrapping inside margins.

pageBreak

Controls whether to add a page break before or after an element.

  • Use pageBreak="before" to add a page break before an element.

  • Use pageBreak="after" to add a page break after an element.

pageMargins

Controls the margins of report pages.

  • Use pageMargins="36 170 36 36" to set the left, right, and bottom margins to 36pt and the top margins to 170pt.

  • When you set the top margin for a page, you must make it big enough to include the <header>.

  • When you set the bottom margin for a page, you must make it big enough to include the <footer>.

  • When you set left and right margins for a page, they don’t apply to the <header> and <footer>.

pageOrientation

Controls the orientation of report pages.

You can only use this attribute for the <template> element.
  • Use pageOrientation="landscape" to set the orientation to landscape.

  • Use pageOrientation="portrait" to set the orientation to portrait.

pageSize

Controls the size of report pages.

  • Use pageSize="A4" to set the page size to A4 (8.27 x 11.69 inches).

  • Use pageSize="LEGAL" to set the page size to Legal (8.5 x 14.0 inches).

  • Use pageSize="LETTER" to set the page size to Letter (8.5 x 11.0 inches).

  • Use pageSize="TABLOID" to set the page size to Tabloid (11 x 17.0 inches).

You can’t change page size when printing PDF reports.

style

Controls the style(s) applied to an element.

Use the <style> element to define styles.

You can apply one or multiple styles to an element.

If you apply multiple styles and the styles have the same attributes, the attributes for the last style specified applies.
  • Use style="tableheader" to apply the "tableheader" style.

  • Use style="header center" to apply the "header" and "center" styles.

width

Controls the width of an element.

Use width="200" to set the width to 200pt.

Text Attributes

Name Description Example

alignment

Controls text alignment.

  • Use alignment="left" to align text to the left.

  • Use alignment="center" to align text to the center.

  • Use alignment="right" to align text to the right.

  • Use alignment="justify" to stretch lines of text so that each line displays the same width.

bold

Controls whether text displays in bold.

Use bold="true" to display text in bold.

color

Controls text color.

  • Use color="red" to display text in red.

  • Use color="#ff0000" to display text in a particular shade of red using its hexadecimal value.

decoration

Controls text decoration, typically the line that is over, under, or through the text.

  • Use these to display text with:

    • decoration="lineThrough" with a line through it.

    • decoration="overline" with an overline.

    • decoration="underline" with an underline.

decorationColor

Controls the color of text decoration.

You can only use this attribute when you use the decoration attribute.
  • Use these to show text in color:

    • decorationColor="red" in red.

    • decorationColor="#ff0000" in a particular shade of red using its hexadecimal value.

decorationStyle

Controls the style of text decoration.

You can only use this attribute when you use the decoration attribute.
  • Use these to display text decoration as

    • decorationStyle="dashed" as dashes.

    • decorationStyle="dotted" as a dotted line.

    • decorationStyle="double" as a double line.

    • decorationStyle="wavy" as a wavy line.

font

Controls the font for text.

  • Use this to set the font:

    • font="Open Sans" to Open Sans.

    • font="Courier" to Courier.

fontSize

Controls text size.

  • Use fontSize="10" to set the size to 10pt.

  • Use fontSize="7.5" to set the size to 7.5pt.

italics

Controls whether text displays in italics.

Use italics="true" to display text in italics.

preserveWhitespace

Controls whether line breaks and tabs are honored for text entered inside of <text> elements.

Use preserveWhitespace="true" to honor line breaks and tabs.

rotate

Controls the angle at which to rotate text.

Use rotate="270" to rotate text 270 degrees.

Table Attributes

Name Description Example

border

Controls whether a border displays on a table.

Use border="false true false true" to display top and bottom borders but don’t display left and right borders.

borderBottom

Controls whether a border displays at the bottom of a cell.

Use borderBottom="true" to display a bottom border.

borderLeft

Controls whether a border displays on the left side of a cell.

Use borderLeft="true" to display a left border.

borderRight

Controls whether a border displays on the right side of a cell.

Use borderRight="true" to display a right border.

borderTop

Controls whether a border displays at the top of a cell.

Use borderTop="true" to display a top border.

borderWidth

Controls the border width of a table.

Use borderWidth="2" to set width to 2pt.

breakableRows

Controls whether rows in a table can break across pages.

  • Use breakableRows="true" to allow rows to break across pages.

  • Use breakableRows="false" to not allow rows to break across pages.

cellPadding

Controls the space between the cell perimeter and cell content.

Use cellPadding="2pt" to set the padding to 2pt.

colSpan

Controls how many columns an element spans across.

Use colSpan="6" to span an element across six columns.

columnWidths

Controls the column widths of a table in a table element.

You must set a width for every column in a table.

Use the columnWidths attribute inside the <table> element to set the columns for a table.

  • Use columnWidths="20 20 20 20" to set column widths to 20pt.

  • Use columnWidths="auto auto auto auto" to make columns expand to fit their contents.

  • Use columnWidths="* * * *" to make columns fill up as much space as possible.

col width

Controls the column widths of a table in a columns element.

You must set a width for every column in a table.

Use the col width attribute inside the <columns> element to set the columns for a table.

  • Use <col width="20"/> to set the column width to 20pt.

  • Use <col width="auto"/> to make the column expand to fit its contents.

  • Use <col width="*"/> to make the column fill up as much space as possible.

fillColor

Controls the color of a cell.

  • Use fillColor="red" to set the color to red.

  • Use fillColor="#ff0000" to set the color to red.

rowsBeforeBreak

Controls how many data rows are necessary to display a table on a page.

Use rowsBeforeBreak="5" to only display a table on a page when it has at least 5 data rows.

rowSpan

Controls how many rows an element spans across.

Use rowSpan="2" to span an element across two rows.

Image Attributes

Name Description Example

caption

Sets the identifying caption for an <imageCapture> or <signatureBlock> element.

Use caption="Company Man Signature" to display "Company Man Signature" under a <signatureBlock> element.

You must set a caption attribute for an item to get it to display "available for completion" when editing a PDF report.

fit

Controls the size of a <qr> element.

Use fit="100" to set the size to 100pt.

maxImageSize

Sets the maximum size of an <rtf> element.

Use maxImageSize="300" to set the maximum size to 300pt.

The maxImageSize attribute downsizes larger images proportionately to have a height or width no greater than the specified size.

rasterize

Controls whether text displays as an image inside a <watermark> element.

Use rasterize="true" to display text as an image.

src

Sets the external source that embeds an image inside an <image>.

Use src="https://www.pexels.com/photo/gray-industrial-machine-during-golden-hour-162568/ to insert an image from an online resource.