NewGraphicsState
Vector graphics, Text, Page layout
Description
Creates or reuses a PDF ExtGState that can combine fill transparency, stroke transparency, line width, line cap, line join, and miter limit settings for later application with SetGraphicsState
Syntax
Delphi
Function TPDFlib.NewGraphicsState(FillTransparency, StrokeTransparency: Integer; LineWidth: Double; LineCap, LineJoin: Integer; MiterLimit: Double): Integer;
ActiveX
Function PDFlib::NewGraphicsState(FillTransparency As Long, StrokeTransparency As Long, LineWidth As Double, LineCap As Long, LineJoin As Long, MiterLimit As Double) As Long
DLL
int DLNewGraphicsState(int InstanceID, int FillTransparency, int StrokeTransparency, double LineWidth, int LineCap, int LineJoin, double MiterLimit);
Parameters
| FillTransparency | Fill transparency percentage, where 0 is opaque and 100 is invisible, or -1 to omit /ca |
|---|---|
| StrokeTransparency | Stroke transparency percentage, where 0 is opaque and 100 is invisible, or -1 to omit /CA |
| LineWidth | Line width in the current measurement units, 0 for a PDF hairline, or -1 to omit /LW |
| LineCap | Line cap style 0 = butt, 1 = round, 2 = projecting square, or -1 to omit /LC |
| LineJoin | Line join style 0 = miter, 1 = round, 2 = bevel, or -1 to omit /LJ |
| MiterLimit | Miter limit ratio greater than 0, or -1 to omit /ML |
Return values
| 0 | No valid graphics-state property was supplied, a parameter was out of range, or transparency is not allowed in the current PDF/A mode |
|---|---|
| >0 | A reusable graphics-state ID for the selected document |
Remarks
Identical settings reuse the same ExtGState object instead of writing duplicate resource dictionaries
Transparency entries automatically raise the effective document version to PDF 1.4; line-state-only entries raise it to PDF 1.3
The returned ID belongs to the current document and should be passed to SetGraphicsState before drawing content that should use those settings