API referenceGraphics

pdfSetLineWidth

Set/get the current stroke line width, in user-space units

C
double __stdcall pdfGetLineWidth(PPDF IPDF);
BOOL32 __stdcall pdfSetLineWidth(PPDF IPDF, double Value);
Delphi
function pdfGetLineWidth(const IPDF: PPDF): Double; stdcall;
function pdfSetLineWidth(const IPDF: PPDF; Value: Double): LongBool; stdcall;

Purpose. Set/get the current stroke line width, in user-space units (points, absent a scaling CTM).

Description. Caches into FCurLineWidth and emits a w line-width operator via WriteLineWidth immediately — real, same pattern as cap/join. No range clamping is applied (unlike pdfSetOpacity below); a negative or zero width is passed through to the content stream unmodified, at the PDF viewer's discretion to interpret (0 conventionally renders a device-thinnest line).

Parameters.

ParameterDescription
IPDFDocument handle.
ValueLine width in user-space units; not validated.

Return value. pdfSetLineWidth: True on success, False if no current content stream. pdfGetLineWidth: the cached current width; 0.0 if IPDF is invalid.

See also. pdfSetLineDashPattern2.

C# (P/Invoke)

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

Setters

Exported names

pdfSetLineWidth

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.