API referenceCore SDK

pdfStrLen

Null-terminated string length — a pure utility taking no

C
int32_t __stdcall pdfStrLenA(const char* AStr);
int32_t __stdcall pdfStrLenW(const wchar_t* AStr);
Delphi
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.

ParameterDescription
AStrThe null-terminated string to measure.

Return value. The string's length in characters (excluding the terminator); 0 if AStr is nil.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfStrLenA([MarshalAs(UnmanagedType.LPStr)] string AStr);
public static extern int pdfStrLenW([MarshalAs(UnmanagedType.LPWStr)] string AStr);
Area
Core SDK
Category

Core

Exported names

pdfStrLenA pdfStrLenW

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.