THotPDF.AddStructureElement + attributs d’accessibilité PDF/UA

THotPDF surface PDF balisée (v2.119.36 / v2.119.40 / v2.119.41)

 

AddXFAPacket  Prise en charge AcroForm

THotPDF.AddStructureElement et assistants PDF balisés

Cette page documente les assistants actuels de structure PDF balisée et PDF/UA de THotPDF. Les identifiants de code correspondent aux déclarations publiques de Lib/HPDFDoc.pas

Surface Delphi actuelle

procedure SetStructureElementLanguage(Elem: THPDFDictionaryObject; const Lang: AnsiString);
procedure SetStructureElementExpansionText(Elem: THPDFDictionaryObject; const ExpansionText: AnsiString);
procedure SetStructureElementTitle(Elem: THPDFDictionaryObject; const Title: AnsiString);
procedure AddStructRoleMap(const SourceRole: AnsiString; const TargetRole: AnsiString);

function BeginTaggedContent(const Role: AnsiString; Parent: THPDFDictionaryObject;
  const Lang: AnsiString = ''; const Alt: AnsiString = '';
  const ActualText: AnsiString = ''; const ExpansionText: AnsiString = ''): THPDFDictionaryObject;
procedure EndTaggedContent;

function EmitTaggedHeading(Level: Integer; Parent: THPDFDictionaryObject; X, Y: Single; const Text: WideString): THPDFDictionaryObject;
function BeginTaggedList(Parent: THPDFDictionaryObject; const NumberingStyle: AnsiString = 'None'): THPDFDictionaryObject;
function EmitTaggedListItem(ListElem: THPDFDictionaryObject; LblX, LblY: Single; const LabelText: WideString; BodyX, BodyY: Single; const BodyText: WideString): THPDFDictionaryObject;
function BeginTaggedTable(Parent: THPDFDictionaryObject): THPDFDictionaryObject;
function AddTaggedTableRow(TableElem: THPDFDictionaryObject): THPDFDictionaryObject;
function EmitTaggedTableHeader(TRElem: THPDFDictionaryObject; X, Y: Single; const Text: WideString; const Scope: AnsiString): THPDFDictionaryObject;
function EmitTaggedTableCell(TRElem: THPDFDictionaryObject; X, Y: Single; const Text: WideString): THPDFDictionaryObject;
function BeginTaggedFigure(Parent: THPDFDictionaryObject; const AltText: AnsiString; const BBox: array of Single): THPDFDictionaryObject;
procedure EndTaggedFigure;
procedure RegisterAnnotForStructure(AnnotDict: THPDFDictionaryObject; StructElem: THPDFDictionaryObject);

function StandardStructureTypeToName(T: THPDFStandardStructureType): AnsiString;
function IsStandardStructureType(const Name: AnsiString): Boolean;

Attributs de structure et mappage des rôles

SetStructureElementLanguage écrit une substitution BCP-47 /Lang, SetStructureElementExpansionText écrit le texte d’expansion /E, SetStructureElementTitle écrit le titre lisible /T, et AddStructRoleMap mappe les rôles de structure personnalisés vers les rôles PDF standard. StandardStructureTypeToName renvoie le nom de rôle PDF pour une valeur THPDFStandardStructureType, et IsStandardStructureType vérifie si un nom de rôle est standard

Assistants PDF balisés de haut niveau

EmitTaggedHeading, BeginTaggedList, EmitTaggedListItem, BeginTaggedTable, AddTaggedTableRow, EmitTaggedTableHeader, EmitTaggedTableCell, BeginTaggedFigure, EndTaggedFigure et RegisterAnnotForStructure couvrent le chaînage courant des titres, listes, tableaux, figures et annotations PDF/UA sans obliger les appelants à gérer les MCID manuellement

Flux de travail type

Activez la sortie balisée ou PDFUACompliance, créez l’élément racine de structure, utilisez la famille d’assistants pour émettre du contenu sémantique, puis fermez chaque séquence de contenu balisé ou de figure ouverte avant EndDoc