| Category | Document metadata |
|---|---|
| Exported names | pdfSetDocInfoA, pdfSetDocInfoW |
| Note | with the diCompany serialization gap (see chapter note) |
Purpose — Set a standard document-info field (Author, Title, Subject, etc.).
Description — Requires an already-open document (pdfCreateNewPDF…/pdfOpenOutputFile… first) — fails silently otherwise. NULL/empty Value is rejected.
Declarations
C
BOOL32 __stdcall pdfSetDocInfoA(PPDF IPDF, TDocumentInfo DInfo, const char* Value);
BOOL32 __stdcall pdfSetDocInfoW(PPDF IPDF, TDocumentInfo DInfo, const wchar_t* Value);
Delphi
function pdfSetDocInfoA(const IPDF: PPDF; DInfo: TDocumentInfo; const Value: PAnsiChar): LongBool; stdcall; external 'LumasPdf.dll';
function pdfSetDocInfoW(const IPDF: PPDF; DInfo: TDocumentInfo; const Value: PWideChar): LongBool; stdcall; external 'LumasPdf.dll';
Parameters
| Parameter | Type | Description |
|---|---|---|
IPDF | PPDF | Instance handle with an open document. |
DInfo | TDocumentInfo | Field to set. diCompany sets a value that will never serialize — see the chapter note. diCustom should not be used here; use pdfSetDocInfoEx (though it has its own gap). |
Value | string | New value. NULL is rejected. |
Return value — TRUE on success; FALSE if no document is open, Value is NULL, or the handle is invalid.
See also — pdfGetDocInfo, pdfSetDocInfoEx
C# (P/Invoke)
wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Core SDK
Category
Setters
Exported names
pdfSetDocInfoA
pdfSetDocInfoW
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.