pdfConvToFreeTextCallout
Convert an existing Line annotation into a FreeText annotation
| Category | Annotation 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
BOOL32 __stdcall pdfConvToFreeTextCallout(PPDF IPDF, uint32_t Handle, float StartX, float StartY, float KneeOffset, TLineEndStyle EndStyle);
function pdfConvToFreeTextCallout(const IPDF: PPDF; Handle: Cardinal; StartX, StartY, KneeOffset: Single; EndStyle: TLineEndStyle): LongBool; stdcall; external 'LumasPdf.dll';
Parameters
| Parameter | Type | Description |
|---|---|---|
IPDF | PPDF | Instance handle. |
Handle | Cardinal | Handle of an existing Line annotation. Fails if it doesn't exist or isn't a Line annotation. |
StartX, StartY | Single | New callout leader's start point (the text-box end of the leader). |
KneeOffset | Single | Horizontal offset for the callout's "knee" (bend point) — the leader goes Start → (Start.X+KneeOffset, Start.Y) → original line's start. |
EndStyle | TLineEndStyle | Line-ending decoration (arrow, circle, etc.) at the pointed-to end; out-of-range values default to 0 (None). |
Return value — TRUE 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)
[return: MarshalAs(UnmanagedType.Bool)]
Conversion
pdfConvToFreeTextCallout
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.