API referenceGraphics

pdfGetTempPath

Read the OS-level temp directory the SDK would use for

C
const char* __stdcall pdfGetTempPathA(PPDF IPDF);
const wchar_t* __stdcall pdfGetTempPathW(PPDF IPDF);
int32_t __stdcall pdfTestTempPath(PPDF IPDF);
Delphi
function pdfGetTempPathA(const IPDF: PPDF): PAnsiChar; stdcall;
function pdfGetTempPathW(const IPDF: PPDF): PWideChar; stdcall;
function pdfTestTempPath(const IPDF: PPDF): Integer; stdcall;

Purpose. Read the OS-level temp directory the SDK would use for scratch files, and verify it is actually writable.

Description. Both getters return TPath.GetTempPath (the standard Windows user-profile temp directory) — this is a process/OS-level query, not a per-document setting: there is no matching setter anywhere in the ABI to redirect where the SDK writes scratch files, despite IPDF being accepted as a parameter (it is not actually consulted — the value is identical for every document handle, including an invalid one). The returned pointer is backed by a module-level string variable (GTempRetA/GTempRetW) that is overwritten on every call — same "engine-owned buffer, valid until next call" lifetime convention used throughout this SDK's string-returning getters (do not cache the pointer across another call on any document). pdfTestTempPath verifies real write access by creating and deleting a small probe file in that directory, rather than just checking directory existence.

Parameters.

ParameterDescription
IPDFAccepted but not consulted — the same OS temp path is returned regardless of handle.

Return value. pdfGetTempPathA/W: the temp directory path (never null — always resolves to the OS temp path). pdfTestTempPath: 1 if the directory exists and a probe file could be created and deleted there; 0 otherwise.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern IntPtr pdfGetTempPathW(IntPtr IPDF);
public static extern IntPtr pdfGetTempPath(IntPtr IPDF);
public static extern IntPtr pdfGetTempPathA(IntPtr IPDF);
Area
Graphics
Category

Getters

Exported names

pdfGetTempPathW pdfGetTempPath pdfGetTempPathA

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.