API referenceAnnotations

pdfSetLineAnnotPoints

Create a Line annotation between two points with optional end

C
int32_t __stdcall pdfLineAnnotA(PPDF IPDF, double x1, double y1, double x2, double y2, double LineWidth, TLineEndStyle lStart, TLineEndStyle lEnd, uint32_t FillColor, uint32_t StrokeColor, TPDFColorSpace CS, const char* Author, const char* Subject, const char* Content);
BOOL32 __stdcall pdfSetLineAnnotParms(PPDF IPDF, uint32_t Handle, int32_t FontHandle, double FontSize, PLineAnnotParms Parms);
BOOL32 __stdcall pdfSetLineAnnotPoints(PPDF IPDF, uint32_t Handle, PFltPoint P1, PFltPoint P2);
Delphi
function pdfLineAnnotA(const IPDF: PPDF; x1, y1, x2, y2, LineWidth: Double; lStart, lEnd: TLineEndStyle; FillColor, StrokeColor: Cardinal; CS: TPDFColorSpace; const Author, Subject, Content: PAnsiChar): Integer; stdcall;
function pdfSetLineAnnotParms(const IPDF: PPDF; Handle: Cardinal; FontHandle: Integer; FontSize: Double; Parms: PLineAnnotParms): LongBool; stdcall;
function pdfSetLineAnnotPoints(const IPDF: PPDF; Handle: Cardinal; P1, P2: PFltPoint): LongBool; stdcall;

Purpose. Create a Line annotation between two points with optional end decorations (pdfLineAnnot); adjust an existing Line annotation's caption/ leader-line/measurement details (pdfSetLineAnnotParms) or endpoints (pdfSetLineAnnotPoints) after creation.

Description. pdfLineAnnot's creator call notably drops lStart/lEnd at creation time tooAddLineAnnot is called without either end-style argument; the line-end decorations must be applied afterward via pdfSetAnnotLineEndStyle (below) rather than at creation. pdfSetLineAnnotParms requires a non-null Parms pointer (a caption/ leader-line/measurement-ratio struct) and an associated font (FontHandle/ FontSize) for the caption text. pdfSetLineAnnotPoints requires both P1 and P2 non-null.

Parameters.

ParameterDescription
IPDFDocument handle.
x1,y1,x2,y2*(creator only)* Line endpoints.
LineWidthStroke width.
lStart, lEndAccepted by the creator's ABI but dropped — use pdfSetAnnotLineEndStyle after creation instead.
FillColor, StrokeColorPacked colors (CS dropped, always RGB).
Handle*(Parms/Points only)* The Line annotation to modify.
FontHandle, FontSize, Parms*(Parms only)* Caption font and detail struct.
P1, P2*(Points only)* New endpoints.

Return value. pdfLineAnnot: the new handle; 0 on failure. pdfSetLineAnnotParms/Points: True if Handle resolves and required pointers are non-null; False otherwise.

See also. pdfSetAnnotLineEndStyle, pdfSetAnnotLineDashPattern.

C# (P/Invoke)

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

Setters

Exported names

pdfSetLineAnnotPoints

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.