Foxit PDF SDK
FSDK.TagTreeEditor Class Reference

Public Member Functions

 AddNewTag (selected_tag_id, type, title)
 Add a new tag to the tag tree. More...
 
 AddTagForAnnotation (is_tag_annotations, annot, page_index, selected_tag_id)
 Add tag for annotation. More...
 
 ChangeTagToArtifact (selected_tag_ids, artifact_type, artifact_to_side)
 Change tag to artifact. More...
 
 constructor (pdf_doc)
 Constructor. More...
 
 CreateTagFromSelectionByContent (selected_content_ids, selected_tag_id)
 Create tag from selection by content. More...
 
 CreateTagFromSelectionByElement (page_index, selected_tag_id)
 Create tag from selection by element. More...
 
 CreateTagFromSelectionByTag (selected_tag_ids, last_selected_tag_id)
 Create tag from selection by tag. More...
 
 CreateTagFromSelectionByText (page_index, selected_text_rects, selected_tag_id)
 Create tag from selection by text. More...
 
 DeleteEmptyTags (selected_tag_ids)
 Delete empty tags from the tag tree. More...
 
 DeleteTags (selected_tag_ids)
 Delete specified tags from the tag tree. More...
 
 FindTagFromSelection (selected_tag_ids)
 Find tag from selection. More...
 
 GetAllContents (selected_tag_id)
 Get all contents of a specified tag item. More...
 
 GetContentTreeItemIDsByTagItemID (selected_tag_id)
 Get content tree item IDs by tag item ID. More...
 
 GetTagPropertyByID (item_id)
 Get tag property by tag item ID. More...
 
 GetTagTree ()
 Get the tag tree of the current PDF document. More...
 
 GetTagTreeContextMenuItems (input_data)
 Get context menu items for tag tree. More...
 
 IsEmpty ()
 Check whether current object is empty or not. More...
 
 MoveTags (source_tag_ids, dest_tag_id, is_moved_as_child)
 Move tags in the tag tree. More...
 
 SetDocAsTaggedPDF ()
 Set the current PDF document as a tagged PDF. More...
 
 SetTagPropertyActualText (item_id, actual_text)
 Set tag property actual text for a specified tag item. More...
 
 SetTagPropertyAlternateText (item_id, alternate_text)
 Set tag property alternate text for a specified tag item. More...
 
 SetTagPropertyID (item_id, id)
 Set tag property ID for a specified tag item. More...
 
 SetTagPropertyLanguage (item_id, language)
 Set tag property language for a specified tag item. More...
 
 SetTagPropertyTitle (item_id, title)
 Set tag property title for a specified tag item. More...
 
 SetTagPropertyType (item_id, type)
 Set tag property type for a specified tag item. More...
 

Static Public Attributes

static e_ArtifactAttachToSideTypeBottom
 Artifact attach side: bottom.
 
static e_ArtifactAttachToSideTypeLeft
 Artifact attach side: left.
 
static e_ArtifactAttachToSideTypeNone
 Enumeration for artifact attach-to-side type. More...
 
static e_ArtifactAttachToSideTypeRight
 Artifact attach side: right.
 
static e_ArtifactAttachToSideTypeTop
 Artifact attach side: top.
 
static e_ArtifactTypeLayout
 Artifact type: layout artifact (visual layout elements).
 
static e_ArtifactTypePage
 Enumeration for artifact type. More...
 
static e_ArtifactTypePagination
 Artifact type: pagination-related artifact (e.g., headers/footers).
 

Detailed Description

This class lets user edit the tag tree (structure tree) of a PDF document: query and modify tag properties, add / delete / move tags, create tags from selection, change tags to artifacts and mark the document as a tagged PDF. Before using any class or methods in this module, please ensure Foxit PDF SDK has been initialized successfully by function FSDK.Library.Initialize with a key including "Accessibility" module.

See also
FSDK.Library

Member Function Documentation

◆ AddNewTag()

FSDK.TagTreeEditor.AddNewTag (   selected_tag_id,
  type,
  title 
)
inline

Add a new tag to the tag tree.

Parameters
[in]selected_tag_idThe selected tag ID as parent.
[in]typeThe tag type.
[in]titleThe tag title.
Returns
The updated tag tree item array.

◆ AddTagForAnnotation()

FSDK.TagTreeEditor.AddTagForAnnotation (   is_tag_annotations,
  annot,
  page_index,
  selected_tag_id 
)
inline

Add tag for annotation.

Parameters
[in]is_tag_annotationsWhether to tag annotations.
[in]annotThe annotation object.
[in]page_indexThe page index.
[in]selected_tag_idThe selected tag ID.
Returns
The updated tag tree item array.

◆ ChangeTagToArtifact()

FSDK.TagTreeEditor.ChangeTagToArtifact (   selected_tag_ids,
  artifact_type,
  artifact_to_side 
)
inline

Change tag to artifact.

Parameters
[in]selected_tag_idsThe selected tag IDs.
[in]artifact_typeThe artifact type. Please refer to FSDK.ArtifactType.
[in]artifact_to_sideThe artifact attach to side type. Please refer to FSDK.ArtifactAttachToSideType.
Returns
true means success, while false means not.

◆ constructor()

FSDK.TagTreeEditor.constructor (   pdf_doc)
inline

Constructor.

Parameters
[in]pdf_docA valid PDF document object.

◆ CreateTagFromSelectionByContent()

FSDK.TagTreeEditor.CreateTagFromSelectionByContent (   selected_content_ids,
  selected_tag_id 
)
inline

Create tag from selection by content.

Parameters
[in]selected_content_idsThe selected content IDs.
[in]selected_tag_idThe selected tag ID.
Returns
The updated tag tree item array.

◆ CreateTagFromSelectionByElement()

FSDK.TagTreeEditor.CreateTagFromSelectionByElement (   page_index,
  selected_tag_id 
)
inline

Create tag from selection by element.

Parameters
[in]page_indexThe page index.
[in]selected_tag_idThe selected tag ID.
Returns
The updated tag tree item array.

◆ CreateTagFromSelectionByTag()

FSDK.TagTreeEditor.CreateTagFromSelectionByTag (   selected_tag_ids,
  last_selected_tag_id 
)
inline

Create tag from selection by tag.

Parameters
[in]selected_tag_idsThe selected tag IDs.
[in]last_selected_tag_idThe last selected tag ID.
Returns
The updated tag tree item array.

◆ CreateTagFromSelectionByText()

FSDK.TagTreeEditor.CreateTagFromSelectionByText (   page_index,
  selected_text_rects,
  selected_tag_id 
)
inline

Create tag from selection by text.

Parameters
[in]page_indexThe page index.
[in]selected_text_rectsThe selected text rectangles.
[in]selected_tag_idThe selected tag ID.
Returns
The updated tag tree item array.

◆ DeleteEmptyTags()

FSDK.TagTreeEditor.DeleteEmptyTags (   selected_tag_ids)
inline

Delete empty tags from the tag tree.

Parameters
[in]selected_tag_idsThe array of tag IDs to check for empty tags.
Returns
The updated tag tree item array.

◆ DeleteTags()

FSDK.TagTreeEditor.DeleteTags (   selected_tag_ids)
inline

Delete specified tags from the tag tree.

Parameters
[in]selected_tag_idsThe array of tag IDs to delete.
Returns
The updated tag tree item array.

◆ FindTagFromSelection()

FSDK.TagTreeEditor.FindTagFromSelection (   selected_tag_ids)
inline

Find tag from selection.

Parameters
[in]selected_tag_idsThe selected tag IDs.
Returns
The array of found tag IDs.

◆ GetAllContents()

FSDK.TagTreeEditor.GetAllContents (   selected_tag_id)
inline

Get all contents of a specified tag item.

Parameters
[in]selected_tag_idThe selected tag ID.
Returns
The content text.

◆ GetContentTreeItemIDsByTagItemID()

FSDK.TagTreeEditor.GetContentTreeItemIDsByTagItemID (   selected_tag_id)
inline

Get content tree item IDs by tag item ID.

Parameters
[in]selected_tag_idThe selected tag ID.
Returns
The array of content tree item IDs.

◆ GetTagPropertyByID()

FSDK.TagTreeEditor.GetTagPropertyByID (   item_id)
inline

Get tag property by tag item ID.

Parameters
[in]item_idThe tag item ID, obtained from FSDK.TagTreeItemData.item_id of items returned by FSDK.TagTreeEditor.GetTagTree.
Returns
The tag property object.
Note
The tag item referenced by item_id must be a structure element (FSDK.TagTreeItemData.e_TagNodeTypeElement) node. Reference-type nodes such as marked content (FSDK.TagTreeItemData.e_TagNodeTypeMarkedContentSeq) or object reference (FSDK.TagTreeItemData.e_TagNodeTypeObject) do not carry this property and will cause the call to fail.

◆ GetTagTree()

FSDK.TagTreeEditor.GetTagTree ( )
inline

Get the tag tree of the current PDF document.

Returns
The tag tree item array.

◆ GetTagTreeContextMenuItems()

FSDK.TagTreeEditor.GetTagTreeContextMenuItems (   input_data)
inline

Get context menu items for tag tree.

Parameters
[in]input_dataThe input data for context menu.
Returns
The array of menu item data.

◆ IsEmpty()

FSDK.TagTreeEditor.IsEmpty ( )
inline

Check whether current object is empty or not.

When the current object is empty, that means current object is useless.

Returns
true means current object is empty, while false means not.

◆ MoveTags()

FSDK.TagTreeEditor.MoveTags (   source_tag_ids,
  dest_tag_id,
  is_moved_as_child 
)
inline

Move tags in the tag tree.

Parameters
[in]source_tag_idsThe source tag IDs to move.
[in]dest_tag_idThe destination tag ID.
[in]is_moved_as_childWhether to move as child of destination.
Returns
The updated tag tree item array.

◆ SetDocAsTaggedPDF()

FSDK.TagTreeEditor.SetDocAsTaggedPDF ( )
inline

Set the current PDF document as a tagged PDF.

Returns
true means success, while false means not.

◆ SetTagPropertyActualText()

FSDK.TagTreeEditor.SetTagPropertyActualText (   item_id,
  actual_text 
)
inline

Set tag property actual text for a specified tag item.

Parameters
[in]item_idThe tag item ID, obtained from FSDK.TagTreeItemData.item_id of items returned by FSDK.TagTreeEditor.GetTagTree.
[in]actual_textThe actual text to set.
Returns
true means success, while false means not.
Note
The tag item referenced by item_id must be a structure element (FSDK.TagTreeItemData.e_TagNodeTypeElement) node. Reference-type nodes such as marked content (FSDK.TagTreeItemData.e_TagNodeTypeMarkedContentSeq) or object reference (FSDK.TagTreeItemData.e_TagNodeTypeObject) do not carry this property and will cause the call to fail.

◆ SetTagPropertyAlternateText()

FSDK.TagTreeEditor.SetTagPropertyAlternateText (   item_id,
  alternate_text 
)
inline

Set tag property alternate text for a specified tag item.

Parameters
[in]item_idThe tag item ID, obtained from FSDK.TagTreeItemData.item_id of items returned by FSDK.TagTreeEditor.GetTagTree.
[in]alternate_textThe alternate text to set.
Returns
true means success, while false means not.
Note
The tag item referenced by item_id must be a structure element (FSDK.TagTreeItemData.e_TagNodeTypeElement) node. Reference-type nodes such as marked content (FSDK.TagTreeItemData.e_TagNodeTypeMarkedContentSeq) or object reference (FSDK.TagTreeItemData.e_TagNodeTypeObject) do not carry this property and will cause the call to fail.

◆ SetTagPropertyID()

FSDK.TagTreeEditor.SetTagPropertyID (   item_id,
  id 
)
inline

Set tag property ID for a specified tag item.

Parameters
[in]item_idThe tag item ID, obtained from FSDK.TagTreeItemData.item_id of items returned by FSDK.TagTreeEditor.GetTagTree.
[in]idThe ID to set.
Returns
true means success, while false means not.
Note
The tag item referenced by item_id must be a structure element (FSDK.TagTreeItemData.e_TagNodeTypeElement) node. Reference-type nodes such as marked content (FSDK.TagTreeItemData.e_TagNodeTypeMarkedContentSeq) or object reference (FSDK.TagTreeItemData.e_TagNodeTypeObject) do not carry this property and will cause the call to fail.

◆ SetTagPropertyLanguage()

FSDK.TagTreeEditor.SetTagPropertyLanguage (   item_id,
  language 
)
inline

Set tag property language for a specified tag item.

Parameters
[in]item_idThe tag item ID, obtained from FSDK.TagTreeItemData.item_id of items returned by FSDK.TagTreeEditor.GetTagTree.
[in]languageThe language to set.
Returns
true means success, while false means not.
Note
The tag item referenced by item_id must be a structure element (FSDK.TagTreeItemData.e_TagNodeTypeElement) node. Reference-type nodes such as marked content (FSDK.TagTreeItemData.e_TagNodeTypeMarkedContentSeq) or object reference (FSDK.TagTreeItemData.e_TagNodeTypeObject) do not carry this property and will cause the call to fail.

◆ SetTagPropertyTitle()

FSDK.TagTreeEditor.SetTagPropertyTitle (   item_id,
  title 
)
inline

Set tag property title for a specified tag item.

Parameters
[in]item_idThe tag item ID, obtained from FSDK.TagTreeItemData.item_id of items returned by FSDK.TagTreeEditor.GetTagTree.
[in]titleThe tag title to set.
Returns
true means success, while false means not.
Note
The tag item referenced by item_id must be a structure element (FSDK.TagTreeItemData.e_TagNodeTypeElement) node. Reference-type nodes such as marked content (FSDK.TagTreeItemData.e_TagNodeTypeMarkedContentSeq) or object reference (FSDK.TagTreeItemData.e_TagNodeTypeObject) do not carry this property and will cause the call to fail.

◆ SetTagPropertyType()

FSDK.TagTreeEditor.SetTagPropertyType (   item_id,
  type 
)
inline

Set tag property type for a specified tag item.

Parameters
[in]item_idThe tag item ID, obtained from FSDK.TagTreeItemData.item_id of items returned by FSDK.TagTreeEditor.GetTagTree.
[in]typeThe tag type to set.
Returns
true means success, while false means not.
Note
The tag item referenced by item_id must be a structure element (FSDK.TagTreeItemData.e_TagNodeTypeElement) node. Reference-type nodes such as marked content (FSDK.TagTreeItemData.e_TagNodeTypeMarkedContentSeq) or object reference (FSDK.TagTreeItemData.e_TagNodeTypeObject) do not carry this property and will cause the call to fail.

Member Data Documentation

◆ e_ArtifactAttachToSideTypeNone

FSDK.TagTreeEditor.e_ArtifactAttachToSideTypeNone
static

Enumeration for artifact attach-to-side type.

Values of this enumeration should be used alone.

Artifact attach side: none.

◆ e_ArtifactTypePage

FSDK.TagTreeEditor.e_ArtifactTypePage
static

Enumeration for artifact type.

Values of this enumeration should be used alone.

Artifact type: page-level artifact.