THotPDF.AddStructureElement + PDF/UA accessibility attributes

THotPDF tagged-PDF surface (v2.119.36 / v2.119.40 / v2.119.41)

 

AddXFAPacket  Soporte AcroForm

THotPDF.AddStructureElement y helpers de Tagged PDF

Esta página documenta los helpers actuales de árbol de estructura de Tagged PDF y PDF/UA de THotPDF. Los identificadores de código coinciden con las declaraciones públicas en Lib/HPDFDoc.pas

Superficie actual de Delphi

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;

Atributos de estructura y mapeo de roles

SetStructureElementLanguage escribe una anulación /Lang BCP-47, SetStructureElementExpansionText escribe el texto de expansión /E, SetStructureElementTitle escribe el título legible /T y AddStructRoleMap mapea los roles de estructura personalizados de vuelta a los roles estándar de PDF. StandardStructureTypeToName devuelve el nombre de rol PDF de un valor THPDFStandardStructureType, e IsStandardStructureType comprueba si un nombre de rol es estándar

Helpers etiquetados de alto nivel

EmitTaggedHeading, BeginTaggedList, EmitTaggedListItem, BeginTaggedTable, AddTaggedTableRow, EmitTaggedTableHeader, EmitTaggedTableCell, BeginTaggedFigure, EndTaggedFigure y RegisterAnnotForStructure cubren el cableado común de encabezados, listas, tablas, figuras y anotaciones de PDF/UA sin obligar a los llamadores a administrar MCIDs manualmente

Flujo de trabajo típico

Activa la salida etiquetada o PDFUACompliance, crea el elemento raíz de estructura, usa la familia de helpers para emitir contenido semántico y cierra cada secuencia de contenido etiquetado o de figura antes de EndDoc