[]
Represents a parsed PDF tag (structure element) in the document's logical structure.
An instance of this class is created from a StructElement, and holds a reference to that object in its StructElement property.
public class Element : LogicalStructureItem
Gets the list of current element's child elements.
Note that even if the current element has no children, accessing this property initializes the list. To simply check whether the element has any children, use HasChildren.
public IReadOnlyList<Element> Children { get; }
Gets the list of content items associated with the current element.
Note that even if the current element has no associated content items, accessing this property initializes the list. To simply check whether the element has any associated content items, use HasContentItems.
public IReadOnlyList<ContentItemBase> ContentItems { get; }
Gets a value indicating whether the current element has any children Element objects (the Children list is not empty).
Note that even if the current element has no children, accessing Children will initialize it, so using this property is recommended when checking whether an element has any children.
public bool HasChildren { get; }
Gets a value indicating whether the current element has any content items associated with it (the ContentItems list is not empty).
Note that even if there are no associated content items, accessing ContentItems will initialize it, so using this property is recommended when checking whether an element has any associated content items.
public bool HasContentItems { get; }
Gets a value indicating whether the current element has any children (the Items list is not empty).
Note that even if the current element has no children, accessing Items will initialize it, so using this property is recommended when checking whether an element has any children.
public bool HasItems { get; }
Gets the list of current element's child elements.
Note that even if the current element has no children, accessing this property initializes the list. To simply check whether the element has any children, use HasItems.
public List<LogicalStructureItem> Items { get; }
Gets the document logical structure to which this element belongs.
public LogicalStructure LogicalStructure { get; }
Gets the parent of the current element.
public Element Parent { get; }
Gets the structure element (PDF tag) that was used to create this element.
public StructElement StructElement { get; }
public string Type { get; }
Iterates over child elements of this Element or its children, and returns an Element that matches a criteria specified via a callback.
public Element FindChild(Func<Element, bool> callback, bool recursive = true)
callback
System.Func<T, TResult><Element, bool>The callback method used to test the elements.
recursive
boolIndicates whether to iterate over child elements' children.
The first element for which the callback
returned true,
or null if no such element exists.
Iterates over content items that belong to this Element or its children, and returns a ContentItem that matches a criteria specified via a callback.
public ContentItemBase FindContentItem(Func<ContentItemBase, bool> callback, bool recursive = true)
callback
System.Func<T, TResult><ContentItemBase, bool>The callback method used to test the content items.
recursive
boolIndicates whether to iterate over content items of child elements.
The first content item for which the callback
returned true,
or null if no such item exists.
Builds and returns the dot-delimited full name of this element including all parent elements' names.
The result looks like "xxx.yyy.Type".
public string GetFullType()
Returns the list of PdfImageInfo objects associated with the current element.
public IList<PdfImageInfo> GetImages()
The list of images associated with this element.
Returns the list of ITextParagraph objects representing the content associated with the current element.
public IList<ITextParagraph> GetParagraphs()
The list of paragraphs associated with this element.
Returns the text associated with this element. This method calls GetParagraphs() and returns an empty string if that method returns null.
public string GetText()
The text associated with this element, or an empty string.