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

PDF XFA DOM versus HTML DOM elements – a tiny comparison

38 sec read

As you may aware of that displaying XFA based PDF files in HTML format is a critical part in the PDF to HTML conversion process. XFA supports Ecma Script 357 specification that was deprecated by World Wide Web Consortium (W3C). In order to overcome this issue I decided to add and override some properties of Element object in HTML DOM to make XFA Node methods available in HTML Elements.

The box below summarizes some interesting differences.

XFA Methods/PropertiesHTML (Element/Node/Attribute) Methods/Properties
 parent parentNode
 className nodeName
 nodes childNodes
 name nodeName
 clone(booleanParam) cloneNode(booleanParam)
 append(objectParam) appendChild(objectParam)
 insert(newNode,existNode) insertBefore(newNode,existNode)
 remove(objectParam) removeChild(objectParam)
 classAll getElementsByTagName(callerNodeName);
 createNode(stringParam) createElement(nodeName)
 getElement(name,index) getElementsByTagName(name)[index]
 remove(objectParam) removeChild(node)

XFA dom has array type architecture that is used to access child elements with the same name but javascript does not have this feature and it has to use resolveNode or resolveNodes methods to access the node objects. Please read this article for the usage of resolveNode subroutine.

Hope this information is helpful..



Converting PDF/ Office Documents to HTML?

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 2022. All rights reserved.