SetMarkInfo
Document properties, Accessibility
Popis
Nastaví slovník /MarkInfo dokumentu v katalogu. Je-li Marked 1, katalog dostane položku /MarkInfo << /Marked true /Suspects false >>, která deklaruje dokument jako tagované PDF. Je-li Marked 0, položka /MarkInfo se odstraní
Tuto funkci automaticky volá SetPDFUAMode i SetPDFAMode na úrovních shody a (PDF/A-1a, PDF/A-2a, PDF/A-3a). Volejte ji přímo jen tehdy, když potřebujete stav tagovaného PDF bez kompletního nastavení PDF/UA-1 nebo PDF/A-A
Syntaxe
Delphi
Function TPDFlib.SetMarkInfo(Marked: Integer): Integer;
ActiveX
Function PDFlib::SetMarkInfo(Marked As Long) As Long
DLL
int DLSetMarkInfo(int InstanceID, int Marked);
Parametry
| Marked | 1 prohlásit dokument za tagovaný (zapíše /Marked true a /Suspects false); 0 odstranit položku /MarkInfo |
|---|
Return values
| 1 | Položka /MarkInfo byla úspěšně aktualizována |
|---|
Poznámky
ISO 14289-1 (PDF/UA-1) §7.18.6 requires /Suspects to be present and set to false when /Marked is true. The library always writes /Suspects false alongside /Marked true, so a single call to SetMarkInfo(1) satisfies both requirements.
Setting /Marked true is a declarative statement only — it does not by itself populate the document's structure tree. After calling SetMarkInfo(1), build the structure tree with BeginTag/EndTag pairs and mark decorative content with BeginArtifact/EndArtifact. Use GetPDFUADiagnostics to surface common gaps before saving.
Předchozí stav /MarkInfo načteného dokumentu zjistíte přes IsTaggedPDF
Příklad
// Convert a non-tagged loaded document into a tagged one, then add structure
PDF.LoadFromFile('source.pdf', '');
if PDF.IsTaggedPDF = 0 then
begin
PDF.SetMarkInfo(1);
// Re-open page 1 for editing
PDF.SelectPage(1);
PDF.BeginPageUpdate;
PDF.BeginTag('H1', '', '');
PDF.PrintText(50, 750, 'Document Title');
PDF.EndTag;
PDF.EndPageUpdate;
end;
PDF.SaveToFile('tagged.pdf');Viz také
IsTaggedPDF, SetPDFUAMode, SetPDFAMode, BeginTag, GetPDFUADiagnostics