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

Do you need to process or display PDF files?

Find out why you should be using IDRSolutions software

Dynamic XFA/PDF to HTML – resolveNode method

1 min read

Dynamic XFA forms contain JavaScript which needs some considerable tidying up to convert into content which will run on a Browser.

In this  technical article, our lead developer of FormVu (which converts Acrobat forms into standalone HTML5) gives you an insight into some of the technical issues involved.

XFA Form resolveNode
An XFA form with and example of resolveNode.

In this article I do an overview of some factors that have to be taken into consideration prior to implementing resolveNode subroutine in your code.

Why resolveNode?

Adobe lifecycle designer follows the Ecma Script 357 specification to represent the SOM model structure.

in simple example :…..

<class>

<student><name>john</name></student>.

<student><name>david</name></student>

</class>

in case If you want to access the name of second student then you need to pass the query as “class.student[1].name” for access

But such an array based access algorithm is not available in regular javascript; therefore resolveNode method is implemented to reference the node information from ecma script 357 supported script.

resolveNode method plays major role in adding, removing, and moving subform instances on the fly:

A nice html implementation example of this functionality can be found in this converted example.

Have a go at trying to add and delete items from purchase order form

Steps to handle resolveNode function:

The following are steps that simplify the process of handling resolveNode functions.

1. Write down the short representation of your full XFA form model by removing internal node structure of fields; so you can track the method insertion point and the caller of the function very quickly.

2. Always use descendant search prior to ascendant search: if you do not found the required item in descendants then move to the ascendant nodes;

3. Use parent by parent search while traversing to ascendant nodes:

4. Check for [*] symbol : if you come across this sign try to traverse through all the nodes which has the same named descendants of particular node;

5. check for “..” symbol for descendant search and “.parent” for accessing parent node.

As you can see, it can be done but requires a large amount of pre-processing.



Our software libraries allow you to

Convert PDF files to HTML
Use PDF Forms in a web browser
Convert PDF Documents to an image
Work with PDF Documents in Java
Read and write HEIC and other Image formats in Java
suda Senior Java EE Develope specialises in Pdf forms , Fonts, application servers and Image manipulation, meditates in spare time.

How to insert an image into a PDF

Recently, we released JPedal 2023.07 which contains the ability to insert images into PDF files. All you need is a copy of JPedal, a...
Jacob Collins
18 sec read