XML Attributes (PDF Reports)
Basics
XML attributes define the appearance of XML elements on PDF reports.
This article explains how to use XML attributes.
Core Attributes
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.
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.
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.
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.
Text Attributes
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.
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
decoration="lineThrough"
to display text with a line through it. -
Use
decoration="overline"
to display text with an overline. -
Use
decoration="underline"
to display text with an underline.
decorationColor
Controls the color of text decoration.
You can only use this attribute when you use the decoration attribute.
|
-
Use
decorationColor="red"
to display text decoration in red. -
Use
decorationColor="#ff0000"
to display text decoration 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
decorationStyle="dashed"
to display text decoration as dashes. -
Use
decorationStyle="dotted"
to display text decoration as a dotted line. -
Use
decorationStyle="double"
to display text decoration as a double line. -
Use
decorationStyle="wavy"
to display text decoration as a wavy line.
font
Controls the font for text.
-
Use
font="Open Sans"
to set the font to Open Sans. -
Use
font="Courier"
to set the font 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.
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.
Table Attributes
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.
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.
Image Attributes
caption
Sets the identifying caption for an <imageCapture>
or <signatureBlock>
element.
You must set a caption attribute for an item to get it to display "available for completion" when editing a PDF report.
|
Use caption="Company Man Signature"
to display "Company Man Signature" under a <signatureBlock>
element.
maxImageSize
Sets the maximum size of an <rtf>
element.
The maxImageSize attribute downsizes larger images proportionately to have a height or width no greater than the specified size.
|
Use maxImageSize="300"
to set the maximum size to 300pt.
rasterize
Controls whether text displays as an image inside a <watermark>
element.
Use rasterize="true"
to display text as an image.