API referenceGraphics

pdfRectangle

Draw and immediately paint a rectangle.

CategoryImmediate-paint shapes

Purpose — Draw and immediately paint a rectangle.

Description — Emits the PDF re operator followed by the FillMode paint operator (see the chapter table) in the same call — there is no separate "just build the rectangle path" step through this entry point.

Declarations

C
BOOL32 __stdcall pdfRectangle(PPDF IPDF, double PosX, double PosY, double Width, double Height, int32_t FillMode);
Delphi
function pdfRectangle(const IPDF: PPDF; PosX, PosY, Width, Height: Double; FillMode: Integer): LongBool; stdcall; external 'LumasPdf.dll';

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
PosX, PosYDoubleLower-left corner.
Width, HeightDoubleSize.
FillModeIntegerSee the chapter's shared table.

Return valueTRUE on success; FALSE if no content stream is open.

See alsopdfRoundRect

C# (P/Invoke)

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

Core

Exported names

pdfRectangle

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.