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.

PDF XFA DOM versus HTML DOM elements – a tiny comparison

46 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..

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.

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.

Converting your PDF files to HTML5 with BuildVu 

Recently we announced our updated product range for 2018 and are rebranding some existing products, like JPDF2HTML5 which has been renamed to BuildVu. It...
Georgia Ingham
3 min read

Leave a Reply

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