THotPDF.AddStructureElement and Tagged PDF Helpers
Esta página documenta os helpers atuais de árvore de estrutura tagged-PDF e PDF/UA de THotPDF. Identificadores de código correspondem às declarações públicas em Lib/HPDFDoc.pas
Current Delphi Surface
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;
Structure Attributes and Role Mapping
SetStructureElementLanguage grava uma substituição /Lang BCP-47, SetStructureElementExpansionText grava o texto de expansão /E, SetStructureElementTitle grava o título legível /T e AddStructRoleMap mapeia funções estruturais personalizadas de volta para funções PDF padrão. StandardStructureTypeToName retorna o nome de função PDF de um valor THPDFStandardStructureType, e IsStandardStructureType verifica se um nome de função é padrão
High-Level Tagged Helpers
EmitTaggedHeading, BeginTaggedList, EmitTaggedListItem, BeginTaggedTable, AddTaggedTableRow, EmitTaggedTableHeader, EmitTaggedTableCell, BeginTaggedFigure, EndTaggedFigure e RegisterAnnotForStructure cobrem a fiação comum de cabeçalhos, listas, tabelas, figuras e anotações PDF/UA sem forçar os chamadores a gerenciar MCIDs manualmente
Typical Workflow
Habilite saída marcada ou PDFUACompliance, crie o elemento de estrutura raiz, use a família de helpers para emitir conteúdo semântico e feche toda sequência iniciada de tagged-content ou figura antes de EndDoc