API reference › PDF/A & Conformance
pdfAddRoleMap
Real tagged-PDF structure-tree mechanisms: /RoleMap
int32_t __stdcall pdfAddRoleMapA(PPDF IPDF, const char* CustomType, const char* StandardType);
BOOL32 __stdcall pdfAddRoleMapEntry(PPDF IPDF, const char* CustomTag, const char* StdTag);
BOOL32 __stdcall pdfAddClassMapEntry(PPDF IPDF, const char* ClassName, const char* Owner, const char* Key, const char* Val);
function pdfAddRoleMapA(const IPDF: PPDF; CustomType, StandardType: PAnsiChar): Integer; stdcall;
function pdfAddRoleMapEntry(const IPDF: PPDF; const CustomTag, StdTag: PAnsiChar): LongBool; stdcall;
function pdfAddClassMapEntry(const IPDF: PPDF; const ClassName, Owner, Key, Val: PAnsiChar): LongBool; stdcall;
Purpose. Real tagged-PDF structure-tree mechanisms: /RoleMap custom-to-standard structure-type mapping (two ABI entry points — pdfAddRoleMap and pdfAddRoleMapEntry — over the same real AddRoleMapEntryH), and /ClassMap (custom class attribute definitions, via AddClassMapEntryH).
Description. All three narrow their string parameters via AnsiPtrToStr/AnsiString (system-codepage ANSI, no W-suffixed Unicode variant exists for pdfAddRoleMapEntry/pdfAddClassMapEntry despite pdfAddRoleMapA/W both existing as a pair — an asymmetry between the two role-map entry points). pdfAddClassMapEntry stores a 4-tuple (class name, owner, attribute key, value) — the /ClassMap mechanism lets multiple structure elements share a named attribute-set class rather than repeating attributes per-element.
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
CustomType/CustomTag | The document's custom structure-type name. |
StandardType/StdTag | The standard PDF structure type it maps to. |
ClassName, Owner, Key, Val | *(ClassMap only)* The class name, attribute owner namespace, key, and value. |
Return value. True/non-zero on success.
C# (P/Invoke)
public static extern int pdfAddRoleMapW(IntPtr IPDF, IntPtr CustomType, IntPtr StandardType);
public static extern int pdfAddRoleMap(IntPtr IPDF, IntPtr CustomType, IntPtr StandardType);
public static extern int pdfAddRoleMapA(IntPtr IPDF, IntPtr CustomType, IntPtr StandardType);
Content Creation
pdfAddRoleMapW
pdfAddRoleMap
pdfAddRoleMapA
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.