List of usage examples for com.itextpdf.text.pdf.parser Subpath isSinglePointOpen
public boolean isSinglePointOpen()
From source file:mkl.testarea.itext5.pdfcleanup.PdfCleanUpRegionFilter.java
License:Open Source License
/** * Adds all subpaths of the path to the {@link ClipperOffset} object with one * note: it doesn't add degenerate subpaths. * * @return {@link java.util.List} consisting of all degenerate subpaths of the path. *//* w w w .jav a2s . c o m*/ private static List<Subpath> addPath(ClipperOffset offset, Path path, JoinType joinType, EndType endType) { List<Subpath> degenerateSubpaths = new ArrayList<Subpath>(); for (Subpath subpath : path.getSubpaths()) { if (subpath.isDegenerate()) { degenerateSubpaths.add(subpath); continue; } if (!subpath.isSinglePointClosed() && !subpath.isSinglePointOpen()) { EndType et; if (subpath.isClosed()) { // Offsetting is never used for path being filled et = EndType.CLOSED_LINE; } else { et = endType; } List<Point2D> linearApproxPoints = subpath.getPiecewiseLinearApproximation(); offset.addPath(convertToIntPoints(linearApproxPoints), joinType, et); } } return degenerateSubpaths; }
From source file:mkl.testarea.itext5.pdfcleanup.PdfCleanUpRegionFilter.java
License:Open Source License
private static void addPath(Clipper clipper, Path path) { for (Subpath subpath : path.getSubpaths()) { if (!subpath.isSinglePointClosed() && !subpath.isSinglePointOpen()) { List<Point2D> linearApproxPoints = subpath.getPiecewiseLinearApproximation(); clipper.addPath(convertToIntPoints(linearApproxPoints), PolyType.SUBJECT, subpath.isClosed()); }// w w w. j a v a 2 s. com } }