Example usage for com.itextpdf.text.pdf.parser PathPaintingRenderInfo STROKE

List of usage examples for com.itextpdf.text.pdf.parser PathPaintingRenderInfo STROKE

Introduction

In this page you can find the example usage for com.itextpdf.text.pdf.parser PathPaintingRenderInfo STROKE.

Prototype

int STROKE

To view the source code for com.itextpdf.text.pdf.parser PathPaintingRenderInfo STROKE.

Click Source Link

Document

Value specifying stroke operation to perform on the current path.

Usage

From source file:mkl.testarea.itext5.pdfcleanup.PdfCleanUpRenderListener.java

License:Open Source License

public Path renderPath(PathPaintingRenderInfo renderInfo) {
    boolean stroke = (renderInfo.getOperation() & PathPaintingRenderInfo.STROKE) != 0;
    boolean fill = (renderInfo.getOperation() & PathPaintingRenderInfo.FILL) != 0;

    float lineWidth = renderInfo.getLineWidth();
    int lineCapStyle = renderInfo.getLineCapStyle();
    int lineJoinStyle = renderInfo.getLineJoinStyle();
    float miterLimit = renderInfo.getMiterLimit();
    LineDashPattern lineDashPattern = renderInfo.getLineDashPattern();

    if (stroke) {
        currentStrokePath = filterCurrentPath(renderInfo.getCtm(), true, -1, lineWidth, lineCapStyle,
                lineJoinStyle, miterLimit, lineDashPattern);
    }//from  w  ww .ja  v  a2s  .c o m

    if (fill) {
        currentFillPath = filterCurrentPath(renderInfo.getCtm(), false, renderInfo.getRule(), lineWidth,
                lineCapStyle, lineJoinStyle, miterLimit, lineDashPattern);
    }

    if (clipPath) {
        if (fill && renderInfo.getRule() == clippingRule) {
            newClippingPath = currentFillPath;
        } else {
            newClippingPath = filterCurrentPath(renderInfo.getCtm(), false, clippingRule, lineWidth,
                    lineCapStyle, lineJoinStyle, miterLimit, lineDashPattern);
        }
    }

    unfilteredCurrentPath = new Path();
    return newClippingPath;
}