I am try to get tables with xfa.layout.pageContent(i, "subform"). This works well but when a table that spans multiple pages comes, that table is returned twice.
First time table is returned for say page 4 and when loop comes to next page 5 same table is returned again.
Can anyone please help, how to get table only once even if it spans many pages.
Are these answers useful?
Help other community members by marking useful answers as accepted.
You could use xfa.layout.page(...); which returns the first page the object appears on, so if this doesn't equal i then ignore.
You could also avoid the layout methods and just process the form model;
if (node.className == "exclGroup" ||
node.className == "subform" ||
node.className == "subformSet" ||
node.className == "area")
for (var i = 0; i < node.nodes.length; i++)
var childNode = node.nodes.item(i);
if (childNode.className == "subform" && childNode.layout == "table")
// ... do table stuff ... //
You might need to change form1 to match the name used in your form.