C
int32_t __stdcall pdfCircleAnnotA(PPDF IPDF, double PosX, double PosY, double Width, double Height, double LineWidth, uint32_t FillColor, uint32_t StrokeColor, TPDFColorSpace CS, const char* Author, const char* Subject, const char* Comment);
int32_t __stdcall pdfSquareAnnotA(PPDF IPDF, double PosX, double PosY, double Width, double Height, double LineWidth, uint32_t FillColor, uint32_t StrokeColor, TPDFColorSpace CS, const char* Author, const char* Subject, const char* Comment);
Delphi
function pdfCircleAnnotA(const IPDF: PPDF; PosX, PosY, Width, Height, LineWidth: Double; FillColor, StrokeColor: Cardinal; CS: TPDFColorSpace; const Author, Subject, Comment: PAnsiChar): Integer; stdcall;
function pdfSquareAnnotA(const IPDF: PPDF; PosX, PosY, Width, Height, LineWidth: Double; FillColor, StrokeColor: Cardinal; CS: TPDFColorSpace; const Author, Subject, Comment: PAnsiChar): Integer; stdcall;
Purpose. Create a Circle (ellipse-inscribed-in-bbox) or Square (rectangle) markup annotation.
Description. Both are the literal same underlying function (AddShapeAnnot) with a boolean IsCircle discriminator baked in per entry point — there is no behavioral difference beyond the resulting /Subtype (Circle vs Square) and how the shared bbox is interpreted geometrically at render time.
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
PosX, PosY, Width, Height | Bounding box. |
LineWidth | Border stroke width. |
FillColor, StrokeColor | Packed colors (CS dropped, always RGB). |
Author, Subject, Comment | /T, /Subj, /Contents. |
Return value. The new annotation's handle; 0 on failure.
C# (P/Invoke)
wrappers/dotnet/LumasPdf.cs
public static extern int pdfSquareAnnotA(IntPtr IPDF, double PosX, double PosY, double Width, double Height, double LineWidth, uint FillColor, uint StrokeColor, TPDFColorSpace CS, [MarshalAs(UnmanagedType.LPStr)] string Author, [MarshalAs(UnmanagedType.LPStr)] string Subject, [MarshalAs(UnmanagedType.LPStr)] string Comment);
public static extern int pdfSquareAnnotW(IntPtr IPDF, double PosX, double PosY, double Width, double Height, double LineWidth, uint FillColor, uint StrokeColor, TPDFColorSpace CS, [MarshalAs(UnmanagedType.LPWStr)] string Author, [MarshalAs(UnmanagedType.LPWStr)] string Subject, [MarshalAs(UnmanagedType.LPWStr)] string Comment);
Area
Annotations
Category
Core
Exported names
pdfSquareAnnotA
pdfSquareAnnotW
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.