PdfStrokeFormat Class
Represents formatting properties that affect stroking of PDF textual or geometrical content.
- Inheritance:
- System.ObjectPdfStrokeFormat
Remarks
The PdfStrokeFormat is always applicable to PdfFormContent, is applicable to PdfTextContent and PdfPathContent if IsApplied is true, and is not applicable for any other PdfVisualContentElement.
If the PdfStrokeFormat is not applicable, then stroke-related graphics state parameters won't be written when writing the associated PdfVisualContentElement to the underlying content stream.
Properties
Color
Gets or sets the stroke color.
Initial value: Black.
Property Value
The stroke color.
Remarks
If Space or Pattern of a PdfColor value that is being set is associated with another PdfDocument, this property setter will automatically clone it and associate the clone with the current PdfDocument.
See Also
DashPattern
Gets or sets the dash pattern to be used when paths are stroked (see 8.4.3.6, "Line Dash Pattern").
Initial value: Solid.
public PdfLineDashPattern DashPattern { get; set; }
Public Property DashPattern As PdfLineDashPattern
Property Value
The dash pattern to be used when paths are stroked.
See Also
IsAdjusted
(PDF 1.2) Gets or sets a value indicating whether to compensate for possible rasterization effects when stroking a path with a line width that is small relative to the pixel resolution of the output device (see 10.6.5, "Automatic Stroke Adjustment").
Initial value: false.
Property Value
- System.Boolean
true to compensate for possible rasterization effects when stroking a path with a line width that is small relative to the pixel resolution of the output device; otherwise, false.
Remarks
note
This is considered a device-independent parameter, even though the details of its effects are device-dependent.
See Also
IsApplied
Gets or sets a value indicating whether the current PDF textual or geometrical content is stroked.
Initial value: false.
Property Value
- System.Boolean
true if the current PDF textual or geometrical content is stroked; otherwise, false.
See Also
LineCap
Gets or sets the line cap style that specifies the shape used at the ends of open PdfSubpaths (and dashes, if any) when they are stroked.
Initial value: Butt.
Property Value
The line cap style that specifies the shape used at the ends of open PdfSubpaths (and dashes, if any) when they are stroked.
Exceptions
See Also
LineJoin
Gets or sets the line join style that specifies the shape to be used at the corners of PdfSubpaths that are stroked.
Initial value: Miter.
Property Value
The line join style that specifies the shape to be used at the corners of PdfSubpaths that are stroked.
Remarks
The LineJoin is significant only at points where consecutive PdfLineSegments of a PdfSubpath connect at an angle; PdfLineSegments that meet or intersect fortuitously shall receive no special treatment.
Exceptions
See Also
MiterLimit
Gets or sets the maximum length of mitered line joins for stroked PdfSubpaths (see 8.4.3.5, "Miter Limit").
Initial value: 10.0 (for a miter cutoff below approximately 11.5 degrees).
Property Value
- System.Double
The maximum length of mitered line joins for stroked PdfSubpaths.
Remarks
The MiterLimit limits the length of "spikes" produced when PdfLineSegments join at sharp angles.
Exceptions
- System.ArgumentOutOfRangeException
Value is less than 1.
- System.ArgumentException
Value is either System.Double.NaN, System.Double.NegativeInfinity or System.Double.PositiveInfinity.
See Also
Opacity
Gets or sets the stroke opacity.
Initial value: 1.0.
Property Value
- System.Double
The stroke opacity.
Remarks
A value of 1 specifies that the stroke is completely opaque; a value of 0 specifies that it is completely transparent.
Exceptions
- System.ArgumentOutOfRangeException
Value is not between 0 and 1 (inclusive).
See Also
Width
Gets or sets the thickness, in user space units, of paths to be stroked (see 8.4.3.2, "Line Width").
Initial value: 1.0.
Property Value
- System.Double
The thickness, in user space units, of paths to be stroked.
Remarks
The Width shall be a non-negative number expressed in user space units; stroking a path shall entail painting all points whose perpendicular distance from the path in user space is less than or equal to half the line width. The effect produced in device space depends on the current transformation matrix (CTM) in effect at the time the path is stroked. If the CTM specifies scaling by different factors in the horizontal and vertical dimensions, the thickness of stroked lines in device space shall vary according to their orientation. The actual line width achieved can differ from the requested width by as much as 2 device pixels, depending on the positions of lines with respect to the pixel grid. Automatic stroke adjustment may be used to ensure uniform line width; see 10.6.5, "Automatic Stroke Adjustment".
A line width of 0 shall denote the thinnest line that can be rendered at device resolution: 1 device pixel wide. However, some devices cannot reproduce 1-pixel lines, and on high-resolution devices, they are nearly invisible. Since the results of rendering such zero-width lines are device-dependent, they should not be used.
Exceptions
- System.ArgumentOutOfRangeException
Value is negative.
- System.ArgumentException
Value is either System.Double.NaN, System.Double.NegativeInfinity or System.Double.PositiveInfinity.