API reference › Import & Output APIs
pdfSaveStyle
Save the current text/graphics style under a name.
| Exported names | pdfSaveStyle (bare = ANSI), pdfSaveStyleA, pdfSaveStyleW |
|---|---|
| Availability | Partial — 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.
int32_t __stdcall pdfSaveStyleA(PPDF IPDF, const char* StyleName);
int32_t __stdcall pdfSaveStyleW(PPDF IPDF, const wchar_t* StyleName);
Return value — 1 on success; 0 for an empty name or invalid handle.
C# (P/Invoke)
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);
Core
pdfSaveStyleW
pdfSaveStyle
pdfSaveStyleA
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.