Class ProhibitedTagRelationsResolver

java.lang.Object
com.itextpdf.layout.tagging.ProhibitedTagRelationsResolver

public class ProhibitedTagRelationsResolver extends Object
This class is used to resolve prohibited relations between parent and child tags.
  • Field Details

  • Constructor Details

    • ProhibitedTagRelationsResolver

      public ProhibitedTagRelationsResolver(PdfDocument pdfDocument)
      Creates a new instance of ProhibitedTagRelationsResolver.
      Parameters:
      pdfDocument - the document to be processed.
  • Method Details

    • repairTagStructure

      public void repairTagStructure(LayoutTaggingHelper taggingHelper, IRenderer topRender)
      Resolves prohibited relations between parent and child tags.
      Parameters:
      taggingHelper - the tagging helper.
      topRender - the top renderer.
    • overwriteTaggingRule

      public void overwriteTaggingRule(String parentRole, String childRole, String newRole)
      Overwrites tagging rule if it already exists. Otherwise, adds the new rule.
      Parameters:
      parentRole - The parent role.
      childRole - The child role.
      newRole - The new role the child should have.
    • executeRoleReplacementRule

      private void executeRoleReplacementRule(TaggingHintKey kid, String key)
    • isKidNonStructElement

      private static boolean isKidNonStructElement(TaggingHintKey kid)
    • generateKey

      private static String generateKey(String parentRole, String childRole)
    • resolveToFinalRole

      private String resolveToFinalRole(LayoutTaggingHelper helper, TaggingHintKey taggingHintKey, boolean isKid)
    • getParentRole

      private String getParentRole(LayoutTaggingHelper helper, TaggingHintKey hintKey, List<String> rolesToSkip)
    • resolveToStandardRole

      private String resolveToStandardRole(String role)