PDF XFA File Processing – Handling Arc elements

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”>
    <value>
          <arc hand=”right”/>
    </value>
    <para vAlign=”middle” hAlign=”center”/>
</draw>

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″/>

arc

 

There is another attribute called startAngle which defines the start point of an arc.
Example:
<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.

If you’re a first-time reader, or simply want to be notified when we post new articles and updates, you can keep up to date by social media (TwitterFacebook and Google+) or the  Blog RSS.

Related Posts:

The following two tabs change content below.

suda

Java EE developer at IDRSolutions
Suda is the Senior Java EE Developer at IDR Solutions, and specialises in XFA, Fonts, True-Type Fonts, application servers and conversions. He is a keen science-fiction fan in his spare time.
suda

About suda

Suda is the Senior Java EE Developer at IDR Solutions, and specialises in XFA, Fonts, True-Type Fonts, application servers and conversions.
He is a keen science-fiction fan in his spare time.

Leave a Reply

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

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>