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

Did you know...

IDRsolutions offers a whole range of online file converters to convert PDF and Microsoft Excel, Word and Office Documents to HTML5, SVG or image formats?

It is free to use for single file conversions and also includes Developer links if you want to use our commercial software for bulk conversions. Find out more on this page

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

Dawscon 2020 Software Conference in Pictures

The latest Dawscon software conference took place today at Dawson College, Montreal. Attendance was free and there were 2 tracks with topics including JavaScript,...
Mark Stephens
17 sec read

Leave a Reply

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

IDRsolutions Ltd 2020. All rights reserved.