API referenceAnnotations

pdfSetAnnotMigrationState

Set an annotation's review/migration state (e.g. Accepted/

C
int32_t __stdcall pdfSetAnnotMigrationStateA(PPDF IPDF, uint32_t Annot, TAnnotState State, const char* User);
int32_t __stdcall pdfSetAnnotMigrationStateW(PPDF IPDF, uint32_t Annot, TAnnotState State, const wchar_t* User);
Delphi
function pdfSetAnnotMigrationStateA(const IPDF: PPDF; Annot: Cardinal; State: TAnnotState; const User: PAnsiChar): Integer; stdcall;
function pdfSetAnnotMigrationStateW(const IPDF: PPDF; Annot: Cardinal; State: TAnnotState; const User: PWideChar): Integer; stdcall;

Purpose. Set an annotation's review/migration state (e.g. Accepted/ Rejected/Cancelled/Completed/None) and the reviewing user's name — the /StateModel+/State review-workflow mechanism.

Parameters.

ParameterDescription
IPDFDocument handle.
AnnotDocument-wide annotation handle.
StateThe review-state enum value.
UserReviewer name. W is UTF-8-encoded before storage; A is stored as given.

Return value. -1 if IPDF is invalid; otherwise reflects SetAnnotMigrationStateH's own success/failure encoding (not independently re-verified beyond the null-handle guard in this chapter).

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfSetAnnotMigrationStateA(IntPtr IPDF, uint Annot, TAnnotState State, [MarshalAs(UnmanagedType.LPStr)] string User);
public static extern int pdfSetAnnotMigrationStateW(IntPtr IPDF, uint Annot, TAnnotState State, [MarshalAs(UnmanagedType.LPWStr)] string User);
Area
Annotations
Category

Annotations

Exported names

pdfSetAnnotMigrationStateA pdfSetAnnotMigrationStateW

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.