Class PdfCleanUpRenderListener

    • Field Detail

      • CLEANED_AREA_FILL_COLOR

        private static final java.awt.Color CLEANED_AREA_FILL_COLOR
      • strNumber

        private int strNumber
      • unfilteredCurrentPath

        private Path unfilteredCurrentPath
      • currentStrokePath

        private Path currentStrokePath
      • currentFillPath

        private Path currentFillPath
      • newClippingPath

        private Path newClippingPath
      • clipPath

        private boolean clipPath
      • clippingRule

        private int clippingRule
    • Method Detail

      • renderText

        public void renderText​(TextRenderInfo renderInfo)
        Description copied from interface: RenderListener
        Called when text should be rendered
        Specified by:
        renderText in interface RenderListener
        Parameters:
        renderInfo - information specifying what to render
      • renderImage

        public void renderImage​(ImageRenderInfo renderInfo)
        Description copied from interface: RenderListener
        Called when image should be rendered
        Specified by:
        renderImage in interface RenderListener
        Parameters:
        renderInfo - information specifying what to render
      • modifyPath

        public void modifyPath​(PathConstructionRenderInfo renderInfo)
        Description copied from interface: ExtRenderListener
        Called when the current path is being modified. E.g. new segment is being added, new subpath is being started etc.
        Specified by:
        modifyPath in interface ExtRenderListener
        Parameters:
        renderInfo - Contains information about the path segment being added to the current path.
      • renderPath

        public Path renderPath​(PathPaintingRenderInfo renderInfo)
        Description copied from interface: ExtRenderListener
        Called when the current path should be rendered.
        Specified by:
        renderPath in interface ExtRenderListener
        Parameters:
        renderInfo - Contains information about the current path which should be rendered.
        Returns:
        The path which can be used as a new clipping path.
      • isClipped

        public boolean isClipped()
      • setClipped

        public void setClipped​(boolean clipPath)
      • getClippingRule

        public int getClippingRule()
      • getCurrentStrokePath

        public Path getCurrentStrokePath()
      • getCurrentFillPath

        public Path getCurrentFillPath()
      • getNewClipPath

        public Path getNewClipPath()
      • popContext

        public void popContext()
      • clearChunks

        public void clearChunks()
      • getImageAreasToBeCleaned

        private java.util.List<Rectangle> getImageAreasToBeCleaned​(ImageRenderInfo renderInfo)
        Returns:
        null if the image is not allowed (either it is fully covered or ctm == null). List of covered image areas otherwise.
      • processImage

        private byte[] processImage​(byte[] imageBytes,
                                    java.util.List<Rectangle> areasToBeCleaned)
      • cleanImage

        private void cleanImage​(java.awt.image.BufferedImage image,
                                java.util.List<Rectangle> areasToBeCleaned)
      • getJPGBytes

        private byte[] getJPGBytes​(java.awt.image.BufferedImage image)
      • filterCurrentPath

        private Path filterCurrentPath​(Matrix ctm,
                                       boolean stroke,
                                       int fillingRule,
                                       float lineWidth,
                                       int lineCapStyle,
                                       int lineJoinStyle,
                                       float miterLimit,
                                       LineDashPattern lineDashPattern)
        Parameters:
        fillingRule - If the path is contour, pass any value.
      • closeOutputStream

        private void closeOutputStream​(java.io.OutputStream os)