API referenceText

pdfConvToFreeTextCallout

Convert an existing Line annotation into a FreeText annotation

CategoryAnnotation conversion

Purpose — Convert an existing Line annotation into a FreeText annotation with a callout leader line pointing back to the original line's start point.

Description — Requires Handle to name an existing Line annotation (created via pdfLineAnnot) with at least 2 points in its /L array; fails immediately otherwise. On success, rewrites the annotation dictionary in place: /Subtype changes from Line to FreeText, /IT is set to FreeTextCallout, and a 3-point /CL (callout line) array is built as [StartX, StartY, StartX+KneeOffset, StartY, ex, ey] — where (ex, ey) is the original line annotation's start point (/L's first two values), now serving as the callout's terminal point (the tip that points at the annotated content). /LE (line-ending style, e.g. arrowhead) is set from EndStyle.

Declarations

C
BOOL32 __stdcall pdfConvToFreeTextCallout(PPDF IPDF, uint32_t Handle, float StartX, float StartY, float KneeOffset, TLineEndStyle EndStyle);
Delphi
function pdfConvToFreeTextCallout(const IPDF: PPDF; Handle: Cardinal; StartX, StartY, KneeOffset: Single; EndStyle: TLineEndStyle): LongBool; stdcall; external 'LumasPdf.dll';

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
HandleCardinalHandle of an existing Line annotation. Fails if it doesn't exist or isn't a Line annotation.
StartX, StartYSingleNew callout leader's start point (the text-box end of the leader).
KneeOffsetSingleHorizontal offset for the callout's "knee" (bend point) — the leader goes Start → (Start.X+KneeOffset, Start.Y) → original line's start.
EndStyleTLineEndStyleLine-ending decoration (arrow, circle, etc.) at the pointed-to end; out-of-range values default to 0 (None).

Return valueTRUE on success; FALSE if Handle isn't a valid Line annotation with a usable /L array.

Remarks — This mutates the annotation in place — the same handle now refers to a FreeText annotation; there is no separate handle for the converted result. The annotation's actual text content (the /Contents / appearance) is unaffected by this call — set it via the normal annotation text APIs before or after conversion.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Text
Category

Conversion

Exported names

pdfConvToFreeTextCallout

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.