API referenceGraphics

pdfGetLineCapStyle

Set/get the current line-cap style (TLineCapStyle:

C
int32_t __stdcall pdfGetLineCapStyle(PPDF IPDF);
BOOL32 __stdcall pdfSetLineCapStyle(PPDF IPDF, int32_t Style);
Delphi
function pdfGetLineCapStyle(const IPDF: PPDF): Integer; stdcall;
function pdfSetLineCapStyle(const IPDF: PPDF; Style: Integer): LongBool; stdcall;

Purpose. Set/get the current line-cap style (TLineCapStyle: 0=Butt, 1=Round, 2=Square) applied to subsequently stroked paths.

Description. pdfSetLineCapStyle both caches Style into FCurLineCap (so pdfGetLineCapStyle can read it back) and immediately emits a J line-cap operator into the current content stream via WriteLineCap — unlike the "write-only" state fields found elsewhere in this SDK, this one is genuinely real and takes effect on the very next stroke. Requires an open current content stream; fails if none is active.

Parameters.

ParameterDescription
IPDFDocument handle.
Style0=Butt cap, 1=Round cap, 2=Square cap.

Return value. pdfSetLineCapStyle: True on success, False if no current content stream. pdfGetLineCapStyle: the cached current style; 0 if IPDF is invalid.

See also. pdfGetLineJoinStyle, psrGetLineCapStyle (unrelated packed-bitfield mechanism, do not confuse).

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfGetLineCapStyle(IntPtr IPDF);
Area
Graphics
Category

Getters

Exported names

pdfGetLineCapStyle

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.