Example usage for com.itextpdf.text.pdf.parser PathConstructionRenderInfo LINETO

List of usage examples for com.itextpdf.text.pdf.parser PathConstructionRenderInfo LINETO

Introduction

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

Prototype

int LINETO

To view the source code for com.itextpdf.text.pdf.parser PathConstructionRenderInfo LINETO.

Click Source Link

Document

See com.itextpdf.text.pdf.parser.Path#lineTo(float,float)

Usage

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

License:Open Source License

public void modifyPath(PathConstructionRenderInfo renderInfo) {
    List<Float> segmentData = renderInfo.getSegmentData();

    switch (renderInfo.getOperation()) {
    case PathConstructionRenderInfo.MOVETO:
        unfilteredCurrentPath.moveTo(segmentData.get(0), segmentData.get(1));
        break;/*from   w  ww  .jav  a  2 s .com*/

    case PathConstructionRenderInfo.LINETO:
        unfilteredCurrentPath.lineTo(segmentData.get(0), segmentData.get(1));
        break;

    case PathConstructionRenderInfo.CURVE_123:
        unfilteredCurrentPath.curveTo(segmentData.get(0), segmentData.get(1), segmentData.get(2),
                segmentData.get(3), segmentData.get(4), segmentData.get(5));
        break;

    case PathConstructionRenderInfo.CURVE_23:
        unfilteredCurrentPath.curveTo(segmentData.get(0), segmentData.get(1), segmentData.get(2),
                segmentData.get(3));
        break;

    case PathConstructionRenderInfo.CURVE_13:
        unfilteredCurrentPath.curveFromTo(segmentData.get(0), segmentData.get(1), segmentData.get(2),
                segmentData.get(3));
        break;

    case PathConstructionRenderInfo.CLOSE:
        unfilteredCurrentPath.closeSubpath();
        break;

    case PathConstructionRenderInfo.RECT:
        unfilteredCurrentPath.rectangle(segmentData.get(0), segmentData.get(1), segmentData.get(2),
                segmentData.get(3));
        break;
    }
}