C
BOOL32 __stdcall pdfSetAnnotStringA(PPDF IPDF, uint32_t Handle, int32_t StringType, const char* Value);
BOOL32 __stdcall pdfSetAnnotStringW(PPDF IPDF, uint32_t Handle, int32_t StringType, const wchar_t* Value);
BOOL32 __stdcall pdfSetAnnotSubjectA(PPDF IPDF, uint32_t Handle, const char* Value);
BOOL32 __stdcall pdfSetAnnotSubjectW(PPDF IPDF, uint32_t Handle, const wchar_t* Value);
Delphi
function pdfSetAnnotStringA(const IPDF: PPDF; Handle: Cardinal; StringType: Integer; const Value: PAnsiChar): LongBool; stdcall;
function pdfSetAnnotStringW(const IPDF: PPDF; Handle: Cardinal; StringType: Integer; const Value: PWideChar): LongBool; stdcall;
function pdfSetAnnotSubjectA(const IPDF: PPDF; Handle: Cardinal; const Value: PAnsiChar): LongBool; stdcall;
function pdfSetAnnotSubjectW(const IPDF: PPDF; Handle: Cardinal; const Value: PWideChar): LongBool; stdcall;
Purpose. Set one of several text fields on an annotation (pdfSetAnnotString's StringType selects among Contents/Author/etc — a generic multi-field setter), or specifically the /Subject field (pdfSetAnnotSubject, a dedicated convenience for that one field).
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
Handle | Document-wide annotation handle. |
StringType | *(SetAnnotString only)* Which text field to set. |
Value | The new string. |
Return value. True if Handle resolves; False otherwise.
C# (P/Invoke)
wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Annotations
Category
Annotations
Exported names
pdfSetAnnotSubjectA
pdfSetAnnotSubjectW
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.