{
 "name": "make_accessible_custom",
 "title": "Make Accessible (tuned: sequential headings + content language)",
 "desc": "Official default remediation preset for automated PDF/UA-1 compliance using PDFix SDK. The preset performs conservative, non-destructive cleanup, structure repair, tagging completion, and accessibility fixes.",
 "version": "0.7.1",
 "min_sdk_version": "8.8.0",
 "max_sdk_version": "",
 "release_date": "2026-04-17",
 "category": "Accessibility",
 "icon": "accessibility_new",
 "settings": {
  "stop_on_action_failure": true
 },
 "actions": [
  {
   "name": "delete_annot",
   "title": "Delete Annotations (TrapNet, PrinterMark)",
   "desc": "Remove non-permitted annotation types that commonly cause PDF/UA compliance failures. TrapNet and PrinterMark annotations are production artifacts and must not be present in accessible documents.",
   "params": [
    {
     "name": "annot_types",
     "value": "^(TrapNet|PrinterMark)$"
    }
   ]
  },
  {
   "name": "fix_parent_tree",
   "title": "Fix Parent Tree (Initial repair)",
   "desc": "Rebuild and normalize the ParentTree to ensure that all marked content references (MCIDs) correctly point to the structure tree. This establishes a stable structural foundation before tagging and cleanup.",
   "params": []
  },
  {
   "name": "add_tags",
   "title": "AutoTag (Preflight, Preserve Existing Tags)",
   "desc": "Automatically add missing structure tags using preflight-assisted layout analysis while preserving any existing tag structure. The action does not overwrite tags and does not inject standard layout attributes, keeping remediation conservative and predictable.",
   "params": [
    {
     "name": "template",
     "value": ""
    },
    {
     "name": "preflight",
     "value": true
    },
    {
     "name": "standard_attrs",
     "value": false
    },
    {
     "name": "sequential_headings",
     "value": true
    },
    {
     "name": "overwrite",
     "value": false
    }
   ]
  },
  {
   "name": "fix_table_tag",
   "title": "Fix Table Tag",
   "desc": "Repair standard Table tag structure without flattening. Normalize cell span attributes (RowSpan/ColSpan) for consistent column counts across rows, generate missing header cells when needed, and move invalid nested elements outside the Table to keep the structure PDF/UA-friendly.",
   "params": [
    {
     "name": "tag_names",
     "value": "^Table$"
    },
    {
     "name": "flatten_table",
     "value": false
    },
    {
     "name": "fix_table_spans",
     "value": true
    },
    {
     "name": "fix_table_headers",
     "value": "true"
    },
    {
     "name": "fix_nested",
     "value": "move"
    }
   ]
  },
  {
   "name": "fix_table_tag",
   "desc": "Flatten incorrectly structured tables to a simpler, more robust hierarchy. Use this mode when table sections or internal nesting are malformed; it converts the table structure to reduce complexity and moves invalid nested elements outside the Table to prevent PDF/UA table validation failures.",
   "title": "Fix Table Tag",
   "params": [
    {
     "name": "tag_names",
     "value": "^Table$"
    },
    {
     "name": "flatten_table",
     "value": true
    },
    {
     "name": "fix_table_spans",
     "value": false
    },
    {
     "name": "fix_table_headers",
     "value": false
    },
    {
     "name": "fix_nested",
     "value": "move"
    }
   ]
  },
  {
   "name": "delete_tags",
   "title": "Delete Tags (Empty non-semantic tags)",
   "desc": "Remove empty structure elements that do not carry semantic meaning and only pollute the tag tree. Headings, table cells, table rows, and list bodies are explicitly preserved to avoid breaking document semantics.",
   "params": [
    {
     "name": "tag_names",
     "value": {
      "template": {
       "tag_update": [
        {
         "query": {
          "$and": [
           {
            "$0_tag_type": {
             "$regex": "^(?!H$|H\\d$|TH$|TD$|TR$|LBody$).*"
            }
           },
           {
            "$0_has_content": "false"
           }
          ],
          "param": [
           "pds_struct_elem"
          ]
         },
         "statement": "$if"
        }
       ]
      }
     }
    },
    {
     "name": "tag_content",
     "value": "none"
    }
   ]
  },
  {
   "name": "remove_content_marks",
   "title": "Remove Content Marks (Invalid MCIDs)",
   "desc": "Remove marked-content sequences that reference invalid or broken MCIDs. This prevents structure corruption and resolves common ParentTree and content reference errors.",
   "params": [
    {
     "name": "object_types",
     "value": ".*"
    },
    {
     "name": "flags",
     "value": 8
    }
   ]
  },
  {
   "name": "artifact_content",
   "title": "Artifact Untagged Content",
   "desc": "Mark untagged page content without MCIDs as artifacts. This ensures that decorative or non-semantic content is ignored by assistive technologies.",
   "params": [
    {
     "name": "object_types",
     "value": {
      "template": {
       "object_update": [
        {
         "query": {
          "$and": [
           {
            "$0_artifact": "false"
           },
           {
            "$0_mcid": "-1"
           }
          ],
          "param": [
           "pds_object"
          ]
         },
         "statement": "$if"
        }
       ]
      }
     }
    },
    {
     "name": "artifact_type",
     "value": 0
    }
   ]
  },
  {
   "name": "set_display_doc_title",
   "title": "Fix Display Document Title",
   "desc": "Synchronize the ViewerPreferences DisplayDocTitle setting with the actual document title so that assistive technologies announce the correct title.",
   "params": []
  },
  {
   "name": "embed_font",
   "title": "Fix Fonts",
   "desc": "Embed all fonts used in the document to ensure consistent rendering and reliable text extraction across platforms and assistive technologies.",
   "params": []
  },
  {
   "name": "fix_headings",
   "title": "Fix Headings (Add missing headings)",
   "desc": "Normalize heading hierarchy by resolving skipped levels and converting headings to a consistent generic H* structure. This improves outline quality and screen reader navigation.",
   "params": [
    {
     "name": "renumber_headings",
     "value": 1
    },
    {
     "name": "fix_heading_levels",
     "value": true
    }
   ]
  },
  {
   "name": "fix_parent_tree",
   "title": "Fix Parent Tree (Final normalization)",
   "desc": "Re-run ParentTree repair after tagging and cleanup to ensure all newly created or modified content references are correctly linked.",
   "params": []
  },
  {
   "name": "fix_oc_name",
   "title": "Fix Optional Content Configuration",
   "desc": "Repair Optional Content (OCG) configuration dictionaries to ensure layer definitions are valid and accessible.",
   "params": []
  },
  {
   "name": "set_suspect_value",
   "title": "Clear Suspect Flag",
   "desc": "Fix the MarkInfo dictionary by clearing the Suspects entry, indicating that the document structure is no longer considered unreliable.",
   "params": []
  },
  {
   "name": "fix_structure_spaces",
   "title": "Fix Spaces (Add missing, Artifact unnecessary)",
   "desc": "Insert missing spaces between words and mark unnecessary spaces as artifacts to improve text readability for screen readers.",
   "params": [
    {
     "name": "add_missing_spaces",
     "value": true
    },
    {
     "name": "remove_unnecessary_spaces",
     "value": false
    },
    {
     "name": "artifact_unnecessary_spaces",
     "value": true
    }
   ]
  },
  {
   "name": "tag_annot",
   "title": "Tag Untagged Annotations",
   "desc": "Attach untagged annotations to the nearest appropriate structure elements so that interactive content is included in the document structure.",
   "params": [
    {
     "name": "annot_types",
     "value": {
      "template": {
       "annot_update": [
        {
         "query": {
          "$and": [
           {
            "$0_tag_type": ""
           }
          ],
          "param": [
           "pdf_annot"
          ]
         },
         "statement": "$if"
        }
       ]
      }
     }
    }
   ]
  },
  {
   "name": "set_annot_contents",
   "title": "Set Annotation Contents (BBox text)",
   "desc": "Populate annotation Contents using text extracted from the annotation bounding box. Provides meaningful accessible names when available.",
   "params": [
    {
     "name": "annot_types",
     "value": ".*"
    },
    {
     "name": "alt_type",
     "value": 1
    },
    {
     "name": "custom_text",
     "value": "Decorative"
    },
    {
     "name": "bbox_padding_x",
     "value": 4
    },
    {
     "name": "bbox_padding_x_right",
     "value": 4
    },
    {
     "name": "bbox_padding_y_top",
     "value": 4
    },
    {
     "name": "bbox_padding_y",
     "value": 4
    },
    {
     "name": "overwrite",
     "value": false
    }
   ]
  },
  {
   "name": "set_annot_contents",
   "title": "Set Annotation Contents (Action destination)",
   "desc": "Populate annotation Contents using the annotation action destination (e.g., link target) when available.",
   "params": [
    {
     "name": "annot_types",
     "value": ".*"
    },
    {
     "name": "alt_type",
     "value": 2
    },
    {
     "name": "custom_text",
     "value": "Decorative"
    },
    {
     "name": "bbox_padding_x",
     "value": 4
    },
    {
     "name": "bbox_padding_x_right",
     "value": 4
    },
    {
     "name": "bbox_padding_y_top",
     "value": 4
    },
    {
     "name": "bbox_padding_y",
     "value": 4
    },
    {
     "name": "overwrite",
     "value": false
    }
   ]
  },
  {
   "name": "set_annot_contents",
   "title": "Set Annotation Contents (Auto-generated)",
   "desc": "Populate annotation Contents using auto-generated text as a fallback when no meaningful source text is available.",
   "params": [
    {
     "name": "annot_types",
     "value": ".*"
    },
    {
     "name": "alt_type",
     "value": 3
    },
    {
     "name": "custom_text",
     "value": "Decorative"
    },
    {
     "name": "bbox_padding_x",
     "value": 4
    },
    {
     "name": "bbox_padding_x_right",
     "value": 4
    },
    {
     "name": "bbox_padding_y_top",
     "value": 4
    },
    {
     "name": "bbox_padding_y",
     "value": 4
    },
    {
     "name": "overwrite",
     "value": false
    }
   ]
  },
  {
   "name": "set_alt",
   "title": "Set Alt (Figure/Formula: From associated content)",
   "desc": "Set alternate descriptions for Figure and Formula tags using associated tag content. If an Annotation is present among children, its Contents is used.",
   "params": [
    {
     "name": "tag_names",
     "value": "^Figure$|^Formula$"
    },
    {
     "name": "alt_type",
     "value": 4
    },
    {
     "name": "custom_text",
     "value": "Decorative"
    },
    {
     "name": "description_tag",
     "value": "Caption"
    },
    {
     "name": "overwrite",
     "value": false
    }
   ]
  },
  {
   "name": "set_alt",
   "title": "Set Alt (Figure/Formula: First description tag above)",
   "desc": "Set alternate descriptions for Figure and Formula tags using the first suitable description tag found above the element.",
   "params": [
    {
     "name": "tag_names",
     "value": "^Figure$|^Formula$"
    },
    {
     "name": "alt_type",
     "value": 1
    },
    {
     "name": "custom_text",
     "value": "Decorative"
    },
    {
     "name": "description_tag",
     "value": ""
    },
    {
     "name": "overwrite",
     "value": false
    }
   ]
  },
  {
   "name": "set_alt",
   "title": "Set Alt (Figure/Formula: First description tag below)",
   "desc": "Set alternate descriptions for Figure and Formula tags using the first suitable description tag found below the element.",
   "params": [
    {
     "name": "tag_names",
     "value": "^Figure$|^Formula$"
    },
    {
     "name": "alt_type",
     "value": 2
    },
    {
     "name": "custom_text",
     "value": "Decorative"
    },
    {
     "name": "description_tag",
     "value": ""
    },
    {
     "name": "overwrite",
     "value": false
    }
   ]
  },
  {
   "name": "set_alt",
   "title": "Set Alt (Figure/Formula: Custom text fallback)",
   "desc": "Set alternate descriptions for Figure and Formula tags using a custom fallback value when no meaningful description is available.",
   "params": [
    {
     "name": "tag_names",
     "value": "^Figure$|^Formula$"
    },
    {
     "name": "alt_type",
     "value": 0
    },
    {
     "name": "custom_text",
     "value": "Decorative"
    },
    {
     "name": "description_tag",
     "value": "Caption"
    },
    {
     "name": "overwrite",
     "value": false
    }
   ]
  },
  {
   "name": "set_alt",
   "title": "Set Alt (Form: From associated content)",
   "desc": "Set alternate descriptions for Form tags using associated tag content. If an Annotation is present among children, its Contents is used.",
   "params": [
    {
     "name": "tag_names",
     "value": "^Form$"
    },
    {
     "name": "alt_type",
     "value": 4
    },
    {
     "name": "custom_text",
     "value": "Decorative"
    },
    {
     "name": "description_tag",
     "value": "Caption"
    },
    {
     "name": "overwrite",
     "value": false
    }
   ]
  },
  {
   "name": "fix_media_clip_keys",
   "title": "Fix Media Clip (Content-Type to text/plain)",
   "desc": "Fix media clip content type keys to a safe default (text/plain) to prevent validation failures on embedded media metadata.",
   "params": [
    {
     "name": "ct_key",
     "value": "text/plain"
    }
   ]
  },
  {
   "name": "set_tag_id",
   "title": "Set Tag IDs (Note, TH)",
   "desc": "Generate unique ID keys for Note and table header (TH) structure elements as required by PDF/UA.",
   "params": [
    {
     "name": "tag_names",
     "value": "^Note$|^TH$"
    },
    {
     "name": "overwrite",
     "value": false
    }
   ]
  },
  {
   "name": "fix_id_tree",
   "title": "Fix ID Tree",
   "desc": "Repair the document ID tree to restore valid references for structure elements and tagged content."
  },
  {
   "name": "set_tabs_key",
   "title": "Set Tab Order (Structure)",
   "desc": "Set the page Tabs key to Structure so keyboard navigation follows the logical reading order.",
   "params": [
    {
     "name": "tabs_key",
     "value": "S"
    },
    {
     "name": "overwrite",
     "value": true
    }
   ]
  },
  {
   "name": "fix_metadata",
   "desc": "Repair and normalize document XMP metadata to improve standards compliance and consistency",
   "title": "Fix XMP Metadata"
  },
  {
   "name": "set_title",
   "desc": "Set the document Title metadata by picking text from the first matching structure tag (Title). This aligns metadata with the visible main heading for assistive technologies and preserves any existing Title unless overwrite is enabled.",
   "params": [
    {
     "name": "title_type",
     "value": "1"
    },
    {
     "name": "custom_text",
     "value": ""
    },
    {
     "name": "description_tag",
     "value": "Title"
    },
    {
     "name": "overwrite",
     "value": false
    }
   ],
   "title": "Set Title (From Title Tag)"
  },
  {
   "name": "set_title",
   "desc": "Set the document Title metadata by picking text from the first matching structure tag (H1). This aligns metadata with the visible main heading for assistive technologies and preserves any existing Title unless overwrite is enabled.",
   "params": [
    {
     "name": "title_type",
     "value": "1"
    },
    {
     "name": "custom_text",
     "value": ""
    },
    {
     "name": "description_tag",
     "value": "H1"
    },
    {
     "name": "overwrite",
     "value": false
    }
   ],
   "title": "Set Title (From H1 Heading)"
  },
  {
   "name": "set_title",
   "desc": "Set the document Title metadata from the PDF Info dictionary. Use this as a reliable fallback when the tag structure does not contain a suitable heading. Existing Title is preserved unless overwrite is enabled.",
   "params": [
    {
     "name": "title_type",
     "value": "3"
    },
    {
     "name": "custom_text",
     "value": ""
    },
    {
     "name": "description_tag",
     "value": ""
    },
    {
     "name": "overwrite",
     "value": false
    }
   ],
   "title": "Set Title (From Info Dictionary)"
  },
  {
   "name": "set_title",
   "desc": "Set the document Title metadata from the input file name. This provides a deterministic fallback title when neither tag-based detection nor existing Info metadata is suitable. Existing Title is preserved unless overwrite is enabled.",
   "params": [
    {
     "name": "title_type",
     "value": "2"
    },
    {
     "name": "custom_text",
     "value": ""
    },
    {
     "name": "description_tag",
     "value": ""
    },
    {
     "name": "overwrite",
     "value": false
    }
   ],
   "title": "Set Title (From File Name)"
  },
  {
   "name": "set_pdf_ua_standard",
   "title": "Set PDF/UA-1 Identifier",
   "desc": "Declare PDF/UA-1 conformance by setting the appropriate PDF/UA identifier in the document metadata.",
   "params": [
    {
     "name": "part_number",
     "value": "1"
    },
    {
     "name": "rev_number",
     "value": "2023"
    }
   ]
  },
  {
   "name": "set_language",
   "title": "Set Document Language (en-US)",
   "desc": "Define the primary document language to ensure correct pronunciation and processing by assistive technologies.",
   "params": [
    {
     "name": "lang",
     "value": "__LANG__"
    },
    {
     "name": "overwrite",
     "value": false
    }
   ]
  },
  {
   "name": "set_content_language",
   "title": "Set Content Language",
   "desc": "Set language on page content objects.",
   "params": [
    {
     "name": "object_types",
     "value": ".*"
    },
    {
     "name": "lang",
     "value": "__LANG__"
    },
    {
     "name": "overwrite",
     "value": false
    }
   ]
  },
  {
   "name": "set_tag_language",
   "title": "Set Tag Language",
   "desc": "Set language on structure tags.",
   "params": [
    {
     "name": "tag_names",
     "value": ".*"
    },
    {
     "name": "lang",
     "value": "__LANG__"
    },
    {
     "name": "overwrite",
     "value": false
    }
   ]
  },
  {
   "name": "create_bookmarks",
   "title": "Create Bookmarks",
   "desc": "Create bookmarks for the document to improve navigation and accessibility.",
   "params": [
    {
     "name": "tag_1",
     "value": "^H1$"
    },
    {
     "name": "tag_2",
     "value": "^H2$"
    },
    {
     "name": "tag_3",
     "value": "^H3$"
    },
    {
     "name": "overwrite",
     "value": false
    }
   ]
  }
 ]
}