API referenceImport & Output APIs

pdfSaveStyle

Save the current text/graphics style under a name.

Exported namespdfSaveStyle (bare = ANSI), pdfSaveStyleA, pdfSaveStyleW
AvailabilityPartial — snapshot store only (see Description)

Purpose — Save the current text/graphics style under a name.

Description — Snapshots font (index/size/style), character/word spacing, leading, text rise, text draw mode, line width/cap/join/miter, fill & stroke colors and color spaces into a named slot (name is case-insensitive; saving an existing name overwrites). pdfRemoveStyle deletes a slot. ⚠ No API applies a saved style yet — the store is write/remove-only in this build; treat it as reserved.

C
int32_t __stdcall pdfSaveStyleA(PPDF IPDF, const char*    StyleName);
int32_t __stdcall pdfSaveStyleW(PPDF IPDF, const wchar_t* StyleName);

Return value1 on success; 0 for an empty name or invalid handle.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfSaveStyleW(IntPtr IPDF, IntPtr StyleName);
public static extern int pdfSaveStyle(IntPtr IPDF, IntPtr StyleName);
public static extern int pdfSaveStyleA(IntPtr IPDF, IntPtr StyleName);
Area
Import & Output APIs
Category

Core

Exported names

pdfSaveStyleW pdfSaveStyle pdfSaveStyleA

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.