API referencePDF/A & Conformance

pdfGetConformanceViolation

Read back the real violation list pdfCheckConformance's

C
int32_t __stdcall pdfGetConformanceViolationCount(PPDF IPDF);
BOOL32 __stdcall pdfGetConformanceViolationA(PPDF IPDF, int32_t Index, int32_t* Code, const char* Buf, int32_t BufLen);
Delphi
function pdfGetConformanceViolationCount(const IPDF: PPDF): Integer; stdcall;
function pdfGetConformanceViolationA(const IPDF: PPDF; Index: Integer; out Code: Integer; Buf: PAnsiChar; BufLen: Integer): LongBool; stdcall;

Purpose. Read back the real violation list pdfCheckConformance's import-side validator populated — one (Code, human-readable message) pair per violation found.

Description. Both are plain, real accessors over the same FConfVCodes/FConfVMsgs parallel arrays populated by CheckImportConformance — there is no separate "run the check" step here; these simply read whatever the most recent pdfCheckConformance call recorded. pdfGetConformanceViolationA's Buf output is bounded by BufLen (truncated and always null-terminated, standard fixed-buffer-safe string-copy convention used elsewhere in this SDK).

Parameters.

ParameterDescription
IPDFDocument handle.
Index0-based index into the violation list from the most recent pdfCheckConformance call.
CodeOutput: the violation's numeric code (e.g. 1 = forbidden encryption, 2 = missing XMP metadata — see pdfCheckConformance for the confirmed code list).
Buf, BufLenOutput: the human-readable violation message, truncated to fit and always null-terminated.

Return value. pdfGetConformanceViolationCount: the number of violations recorded by the most recent check. pdfGetConformanceViolationA: True if Index is in range.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
PDF/A & Conformance
Category

Getters

Exported names

pdfGetConformanceViolationA

String variants

The …A form takes UTF-8, …W takes UTF-16; a bare name aliases the ANSI form.

See working code

Worked examples — complete programs in ten languages.