API referenceCore SDK

pdfSetDocInfo

Set a standard document-info field (Author, Title, Subject,

CategoryDocument metadata
Exported namespdfSetDocInfoA, pdfSetDocInfoW
Notewith 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

ParameterTypeDescription
IPDFPPDFInstance handle with an open document.
DInfoTDocumentInfoField 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).
ValuestringNew value. NULL is rejected.

Return valueTRUE on success; FALSE if no document is open, Value is NULL, or the handle is invalid.

See alsopdfGetDocInfo, 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.