GemBox.Pdf
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    PdfStrokeFormat Class

    Namespace:
    GemBox.Pdf.Content
    Assembly:
    GemBox.Pdf.dll

    Represents formatting properties that affect stroking of PDF textual or geometrical content.

    • C#
    • VB.NET
    public sealed class PdfStrokeFormat
    Public NotInheritable Class PdfStrokeFormat
    Inheritance:
    System.Object
    PdfStrokeFormat
    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.

    • C#
    • VB.NET
    public PdfColor Color { get; set; }
    Public Property Color As PdfColor
    Property Value
    PdfColor

    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
    PDF Specification ISO 32000-1:2008, section '8.4 Graphics State'

    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.

    • C#
    • VB.NET
    public PdfLineDashPattern DashPattern { get; set; }
    Public Property DashPattern As PdfLineDashPattern
    Property Value
    PdfLineDashPattern

    The dash pattern to be used when paths are stroked.

    See Also
    PDF Specification ISO 32000-1:2008, section '8.4.3.6 Line Dash Pattern'

    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.

    • C#
    • VB.NET
    public bool IsAdjusted { get; set; }
    Public Property IsAdjusted As Boolean
    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
    PDF Specification ISO 32000-1:2008, section '10.6.5 Automatic Stroke Adjustment'

    IsApplied

    Gets or sets a value indicating whether the current PDF textual or geometrical content is stroked.

    Initial value: false.

    • C#
    • VB.NET
    public bool IsApplied { get; set; }
    Public Property IsApplied As Boolean
    Property Value
    System.Boolean

    true if the current PDF textual or geometrical content is stroked; otherwise, false.

    See Also
    PDF Specification ISO 32000-1:2008, section '8.5.3 Path-Painting Operators'
    PDF Specification ISO 32000-1:2008, section '9.3.6 Text Rendering Mode'

    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.

    • C#
    • VB.NET
    public PdfLineCap LineCap { get; set; }
    Public Property LineCap As PdfLineCap
    Property Value
    PdfLineCap

    The line cap style that specifies the shape used at the ends of open PdfSubpaths (and dashes, if any) when they are stroked.

    Exceptions
    System.ArgumentOutOfRangeException

    Value is not between Butt and Square.

    See Also
    PDF Specification ISO 32000-1:2008, section '8.4.3.3 Line Cap Style'

    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.

    • C#
    • VB.NET
    public PdfLineJoin LineJoin { get; set; }
    Public Property LineJoin As PdfLineJoin
    Property Value
    PdfLineJoin

    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
    System.ArgumentOutOfRangeException

    Value is not between Miter and Bevel.

    See Also
    PDF Specification ISO 32000-1:2008, section '8.4.3.4 Line Join Style'

    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).

    • C#
    • VB.NET
    public double MiterLimit { get; set; }
    Public Property MiterLimit As Double
    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
    PDF Specification ISO 32000-1:2008, section '8.4.3.5 Miter Limit'

    Opacity

    Gets or sets the stroke opacity.

    Initial value: 1.0.

    • C#
    • VB.NET
    public double Opacity { get; set; }
    Public Property Opacity As Double
    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
    PDF Specification ISO 32000-1:2008, section '8.4 Graphics State'

    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.

    • C#
    • VB.NET
    public double Width { get; set; }
    Public Property Width As Double
    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.

    See Also
    PDF Specification ISO 32000-1:2008, section '8.4.3.2 Line Width'

    Examples

    Stroking example

    See Also

    PDF Specification ISO 32000-1:2008, section '8.4 Graphics State'
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.