SetMarkInfo

Document properties, Accessibility

Description

Sets the document's /MarkInfo dictionary in the Catalog. When Marked is 1 the Catalog gains a /MarkInfo << /Marked true /Suspects false >> entry, declaring the document as a tagged PDF. When Marked is 0 the /MarkInfo entry is removed.

This function is called automatically by SetPDFUAMode and by SetPDFAMode at a-conformance levels (PDF/A-1a, PDF/A-2a, PDF/A-3a). Call it directly only when you need tagged-PDF status without the full PDF/UA-1 or PDF/A-A setup.

Syntax

Delphi

function TPDFlib.SetMarkInfo(Marked: Integer): Integer;

ActiveX

Function PDFlib::SetMarkInfo(Marked As Long) As Long

DLL

int DLSetMarkInfo(int InstanceID, int Marked);

Parameters

Marked1 to declare the document tagged (writes /Marked true and /Suspects false); 0 to remove the /MarkInfo entry.

Return values

1The /MarkInfo entry was updated successfully.

Remarks

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.

The previous state of /MarkInfo on a loaded document can be queried with IsTaggedPDF.

Example

// 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');

See also

IsTaggedPDF, SetPDFUAMode, SetPDFAMode, BeginTag, GetPDFUADiagnostics