This article is part of the ongoing XFA article index series, you can read more about XFA here. In this article we will be discussing how to draw XFA Borders and border based background colors in XFA XML template. More information can be found in Adobe XFA specification.
The <border> element consists of edge and corner; where the edge element describes the edges of the border and corner describes the intersection of the border.
if a widget (a field or draw element) is enclosed in single solid color border which has same thickness on all sides then you may find only one edge element is present in border node. For individual side editing there will be 4 edges presented in node.
Consider following Example
<corner thickness=”0.1778mm” stroke=”dashed”>
in above example the first edge will be drawn from top left hand corner to top right hand corner with color value 255,0,255 (rgb representation); and the line style will be dashed. the second edge will be drawn from top right hand corner to bottom right hand corner with solid line (if no strike is specified then system considers it as solid line, in the same way if no color is specified system draws the line in black). The XFA rendering machine draws the edges clockwise from top left hand corner.
The picture above illustrates that border thickness does not affect the text margin (Please note there is no padding features in XFA) coordination.
Fill attribute fills the enclosed region in any given color; Thickness defines the thickness of each border’s edges and corners.
The break attribute allows the widget border to display over multiple pages if its value is open.
In the next article in this ongoing series we will be investigating arcs and circles in XFA files.
This post is part of our “XFA Articles Index” in these articles, we aim to help you understand XFA.
IDRsolutions develop a Java PDF library, a PDF forms to HTML5 converter, a PDF to HTML5 or SVG converter and a Java Image Library that doubles as an ImageIO replacement. On the blog our team post about anything interesting they learn about.