API referenceText

pdfIsBidiText

Quick check for whether AText contains any characters from a

CategoryText introspection
Notea coarse Unicode-range heuristic, not a full bidi-class analysis (see Remarks)

Purpose — Quick check for whether AText contains any characters from a right-to-left script block.

Description — Scans every UTF-16 code unit and returns true as soon as one falls in U+0590..U+08FF (Hebrew, Arabic, Syriac, Thaana, NKo, Samaritan, Mandaic, and adjacent blocks), U+FB1D..U+FDFF (Hebrew/Arabic presentation forms A), or U+FE70..U+FEFF (Arabic presentation forms B).

Declarations

C
int32_t __stdcall pdfIsBidiText(PPDF IPDF, const wchar_t* AText);
Delphi
function pdfIsBidiText(const IPDF: PPDF; const AText: PWideChar): Integer; stdcall; external 'LumasPdf.dll';

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle (only checked for validity — the result doesn't depend on document state).
ATextPWideCharText to scan. NULL returns 0.

Return value1 if any code unit falls in the scanned ranges; 0 otherwise (including NULL/empty input or an invalid handle).

Remarks — This is a fixed code-block range check, not a full Unicode Bidi_Class property lookup (UAX#9) — it will correctly flag Hebrew/Arabic text but does not attempt to classify weak/neutral characters or other RTL-adjacent scripts outside these specific ranges. For the actual reordering logic driven by FBidiMode, see pdfWriteText's Unicode robustness table.

See alsopdfWriteText

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfIsBidiText(IntPtr IPDF, [MarshalAs(UnmanagedType.LPWStr)] string AText);
Area
Text
Category

Core

Exported names

pdfIsBidiText

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.