public class Stroke extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Stroke.CapStyle
Enum for the PDF cap styles.
|
static class |
Stroke.DashPattern
Describes a PDF dash pattern.
|
static class |
Stroke.JoinStyle
Enum for the PDF join styles.
|
static class |
Stroke.StrokeBuilder
A builder providing a fluent interface for creating a stroke.
|
| Constructor and Description |
|---|
Stroke()
Creates a Stroke with line width 1, cap style
Stroke.CapStyle.Cap, join style Stroke.JoinStyle.Miter, and no dash
pattern. |
Stroke(float lineWidth)
Creates a Stroke with the given line width, cap style
Stroke.CapStyle.Cap, join style Stroke.JoinStyle.Miter, and no dash
pattern. |
Stroke(Stroke.CapStyle capStyle,
Stroke.JoinStyle joinStyle,
Stroke.DashPattern dashPattern,
float lineWidth)
Creates a stroke with the given attributes.
|
| Modifier and Type | Method and Description |
|---|---|
void |
applyTo(org.apache.pdfbox.pdmodel.PDPageContentStream contentStream)
Applies this stroke to the given content stream.
|
static Stroke.StrokeBuilder |
builder()
Creates a stroke builder providing a fluent interface for creating a stroke.
|
Stroke.CapStyle |
getCapStyle() |
Stroke.DashPattern |
getDashPattern() |
Stroke.JoinStyle |
getJoinStyle() |
float |
getLineWidth() |
public Stroke()
Stroke.CapStyle.Cap, join style Stroke.JoinStyle.Miter, and no dash
pattern.public Stroke(float lineWidth)
Stroke.CapStyle.Cap, join style Stroke.JoinStyle.Miter, and no dash
pattern.lineWidth - the line width.public Stroke(Stroke.CapStyle capStyle, Stroke.JoinStyle joinStyle, Stroke.DashPattern dashPattern, float lineWidth)
capStyle - the cap style.joinStyle - the join style.dashPattern - the dash pattern.lineWidth - the line width.public Stroke.CapStyle getCapStyle()
public Stroke.JoinStyle getJoinStyle()
public Stroke.DashPattern getDashPattern()
public float getLineWidth()
public void applyTo(org.apache.pdfbox.pdmodel.PDPageContentStream contentStream)
throws IOException
contentStream - the content stream to apply this stroke to.IOException - by PDFBox.public static Stroke.StrokeBuilder builder()
Copyright © 2022. All rights reserved.