int32_t __stdcall pdfCreateStdPattern(PPDF IPDF, int32_t Pattern, double LineWidth, double Distance, uint32_t LineColor, uint32_t BackColor);
function pdfCreateStdPattern(const IPDF: PPDF; Pattern: Integer; LineWidth, Distance: Double; LineColor, BackColor: Cardinal): Integer; stdcall;
Purpose. Register one of 6 built-in hatch-style tiling patterns (horizontal/vertical/diagonal lines, crosshatch, etc.) without needing a pdfBeginPattern/pdfEndPattern capture.
Description. Pattern must be 0..5 (the specific 6 built-in kinds); any other value fails. Distance (line spacing) defaults to 8 and LineWidth defaults to 0.5 when a non-positive value is passed — these are silent substitutions, not failures. Registers a new pattern entry with an auto-allocated handle and alias, storing the kind/geometry/ colors for later serialization as a real PDF tiling pattern (the actual hatch geometry is generated at output time from Kind/LineWidth/ Distance, not drawn by the caller).
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
Pattern | Built-in hatch kind, 0..5; any other value fails. |
LineWidth | Hatch line stroke width; <= 0 silently substitutes 0.5. |
Distance | Spacing between hatch lines; <= 0 silently substitutes 8. |
LineColor | Packed color of the hatch lines. |
BackColor | Packed background fill color of the tile. |
Return value. The new pattern handle on success; -1 if Pattern is outside 0..5.
See also. pdfBeginPattern (a fully custom alternative).
C# (P/Invoke)
public static extern int pdfCreateStdPattern(IntPtr IPDF, int Pattern, double LineWidth, double Distance, uint LineColor, uint BackColor);
Object Creation
pdfCreateStdPattern
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.