Example usage for com.itextpdf.text.pdf.parser Path isEmpty

List of usage examples for com.itextpdf.text.pdf.parser Path isEmpty

Introduction

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

Prototype

public boolean isEmpty() 

Source Link

Document

Path is empty if it contains no subpaths.

Usage

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

License:Open Source License

private void writePath(Path path, byte[] pathPaintingOperator, PdfContentByte canvas) throws IOException {
    if (path.isEmpty()) {
        return;/*from   ww w .j a  v  a  2  s  . c  om*/
    }

    for (Subpath subpath : path.getSubpaths()) {
        writeMoveTo(subpath.getStartPoint(), canvas);

        for (Shape segment : subpath.getSegments()) {
            if (segment instanceof BezierCurve) {
                writeBezierCurve((BezierCurve) segment, canvas);
            } else {
                writeLine((Line) segment, canvas);
            }
        }

        if (subpath.isClosed()) {
            canvas.getInternalBuffer().append(h);
        }
    }

    if (pathPaintingOperator != null) {
        canvas.getInternalBuffer().append(pathPaintingOperator);
    }
}