Skip to main content
Known Participant
July 15, 2016
Question

Iterate through Structure tree

  • July 15, 2016
  • 1 reply
  • 460 views

I know how to iterate through the content tree. However, I am finding it difficult to iterate through the structure tree taking into account sub trees. Is it possible to iterate through the structure tree when it is multi leveled? Also can you locate a container found in the content tree within the structure tree?

This topic has been closed for replies.

1 reply

lrosenth
Adobe Employee
Adobe Employee
July 15, 2016

The three can be iterated bi-directionally – you can get kids and parents. Not sure where your issues are…

LWShayAuthor
Known Participant
July 15, 2016

Okay it may be an error in logic. Is it possible to only get structure tree elements located on a specific page without having to iterate through the complete tree?

lrosenth
Adobe Employee
Adobe Employee
July 15, 2016

No, it is not – you need to walk the tree to find the page of each element.

There have been some recent conversations as part of PDF 2.x about how that might be accomplished using the new DPart feature of PDF 2.0 – but nothing concrete at this time. (mostly because it’s a complex problem since structure doesn’t have to have any relationship to presentation)