BeginArtifactEx

Tagged PDF, Accessibility

Description

Opens a PDF artifact marked-content sequence with explicit artifact type and optional Pagination subtype in a single call. Extends BeginArtifact to support the full artifact property dictionary defined in ISO 32000-1 §14.8.2.2.1 Table 330.

Use this function when you need to express both an artifact type (Pagination, Layout, or Page) and a Pagination subtype (Header, Footer, Watermark, PageNum, or LineNum) in a single operator. For cases where only one dimension is needed, BeginArtifact is sufficient.

Every BeginArtifactEx call must be followed by a matching EndArtifact call.

Syntax

Delphi

function TPDFlib.BeginArtifactEx(const ArtifactType, ArtifactSubtype: WideString): Integer;

ActiveX

Function PDFlib::BeginArtifactEx(ArtifactType As String, ArtifactSubtype As String) As Long

DLL

int DLBeginArtifactEx(int InstanceID, wchar_t* ArtifactType, wchar_t* ArtifactSubtype);
int DLBeginArtifactExA(int InstanceID, char* ArtifactType, char* ArtifactSubtype);

Parameters

ArtifactTypeArtifact type name written as the /Type property. Valid values per ISO 32000-1 §14.8.2.2.1:
  • Pagination — page header, footer, page number, or other pagination element
  • Layout — layout-driven content such as column rules, background decoration
  • Page — intrinsic page content not tied to any logical structure
Pass an empty string to omit /Type (the operator falls back to /Subtype-only or bare /Artifact BMC).
ArtifactSubtypePagination subtype written as the /Subtype property. Meaningful only when ArtifactType is Pagination. Common values: Header, Footer, Watermark, PageNum, LineNum. Pass an empty string to omit /Subtype.

Operator written

Both non-empty/Artifact << /Type /T /Subtype /S >> BMC
Type only/Artifact << /Type /T >> BMC
Subtype only/Artifact << /Subtype /S >> BMC
Both empty/Artifact BMC

Return values

0Failed (no document is open)
1Artifact sequence opened successfully

Example

// Mark a running header as a Pagination artifact with subtype Header
PDF.BeginArtifactEx('Pagination', 'Header');
PDF.PrintText(50, 780, 'Chapter 3  —  Results');
PDF.EndArtifact;

// Mark a column rule as a Layout artifact (no subtype needed)
PDF.BeginArtifactEx('Layout', '');
PDF.DrawLine(300, 50, 300, 750);
PDF.EndArtifact;