suda Senior Java EE Develope specialises in Pdf forms , Fonts, application servers and Image manipulation, meditates in spare time.

PDF XFA File Processing – Handling Arc elements

1 min read

This articles is one of the XFA series index (Please click here to find more articles related to XFA topic), furthermore this article examines guidelines to be considered prior to processing Arc elements in XFA files.

Dragging a circle from the object library draws a simple circle (actually it draws a ellipse) with following specification.

<draw name=”Circle1″ y=”31.75mm” x=”38.1mm” w=”25.4mm” h=”25.4mm”>
          <arc hand=”right”/>
    <para vAlign=”middle” hAlign=”center”/>

You have to access the first child of  the value node to define whether the object is arc related or not.

The name attribute does not change the appearance of an object, so renaming it as rectangle does not alter the widget into rectangle.

As I mentioned earlier the arc tag without a circular attribute will only draw an ellipse, however it appears more closer to a circle because the widget is wrapped into square. (refer to the h and w attributes of draw tags)

So the correct way to draw a circle should be defined as
<arc hand=”right” circular=”1″/>

In the case above, if the width is higher than height, the circle will be center aligned (horizontally) and if the height is higher than width, the circle will be middle aligned (vertically).

The sweepAngle attribute defines whether the object is actually an arc or not. The example below shows that the arc will be drawn anticlockwise.

<arc hand=”right” sweepAngle=”90″/>



There is another attribute called startAngle which defines the start point of an arc.
<arc hand=”right” sweepAngle=”90″ startAngle=”100″/>

The above command starts the angle from 100 degrees and moves up to 190 degrees.

Fill the color:

The fill attribute with a child node of fill will colour the arc red, green or blue. The interesting thing to note here is that the fill attribute will only colour from the start to the end angle chord and the surrounding circumference.

I hope that you have found the information on this blog article useful, in my next article I will be investigating more of an accurate page mapping algorithm that will allow you to parse and view the pages correctly in your custom XFA Viewer.

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.

suda Senior Java EE Develope specialises in Pdf forms , Fonts, application servers and Image manipulation, meditates in spare time.

Leave a Reply

Your email address will not be published. Required fields are marked *

IDRsolutions Ltd 2020. All rights reserved.