int32_t __stdcall pdfStrLenA(const char* AStr);
int32_t __stdcall pdfStrLenW(const wchar_t* AStr);
function pdfStrLenA(const AStr: PAnsiChar): Integer; stdcall;
function pdfStrLenW(const AStr: PWideChar): Integer; stdcall;
Purpose. Null-terminated string length — a pure utility taking no IPDF parameter at all, unlike every other function in this chapter.
Description. A simple manual pointer-walk to the terminating null; no document state involved whatsoever. Provided purely for ABI/LumasPDF- convention completeness (callers in some language bindings may lack a native strlen/wcslen equivalent readily bound).
Parameters.
| Parameter | Description |
|---|---|
AStr | The null-terminated string to measure. |
Return value. The string's length in characters (excluding the terminator); 0 if AStr is nil.
C# (P/Invoke)
public static extern int pdfStrLenA([MarshalAs(UnmanagedType.LPStr)] string AStr);
public static extern int pdfStrLenW([MarshalAs(UnmanagedType.LPWStr)] string AStr);
Core
pdfStrLenA
pdfStrLenW
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.