Purpose — pdfCloseFile plus encryption in one call.
Description — If an open and/or owner password (or a restriction mask) is supplied, the Standard Security Handler is applied with the requested key length before closing; with all-empty parameters it behaves exactly like pdfCloseFile.
C
BOOL32 __stdcall pdfCloseFileEx(PPDF IPDF, const char* OpenPwd,
const char* OwnerPwd, int32_t KeyLen,
uint32_t Restrict);
Parameters — OpenPwd/OwnerPwd (UTF-8, may be NULL/empty), KeyLen (TKeyLen ordinal — RC4-40/RC4-128/AES-128 family, Volume 11), Restrict (permission mask, Volume 11).
Return value — as pdfCloseFile.
C# (P/Invoke)
wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Import & Output APIs
Category
Core
Exported names
pdfCloseFileEx
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.