Class PdfBoxGraphics2DPaintApplier

    • Constructor Detail

      • PdfBoxGraphics2DPaintApplier

        public PdfBoxGraphics2DPaintApplier()
    • Method Detail

      • applyPaint

        public org.apache.pdfbox.pdmodel.graphics.shading.PDShading applyPaint​(Paint paint,
                                                                               org.apache.pdfbox.pdmodel.PDPageContentStream contentStream,
                                                                               AffineTransform tf,
                                                                               IPdfBoxGraphics2DPaintApplier.IPaintEnv env)
                                                                        throws IOException
        Description copied from interface: IPdfBoxGraphics2DPaintApplier
        Apply the paint on the ContentStream
        Specified by:
        applyPaint in interface IPdfBoxGraphics2DPaintApplier
        Parameters:
        paint - the paint which should be applied
        contentStream - the content stream to apply the paint on
        tf - the current transform of the Graphics2D relative to the contentStream default coordinate space. This is always a copy of the current transform, so we can modify it.
        env - Environment for mapping the paint.
        Returns:
        null or a PDShading which should be used to fill a shape.
        Throws:
        IOException - if its not possible to write the paint into the contentStream
      • getPropertyValue

        protected static <T> T getPropertyValue​(Object obj,
                                                String propertyGetter)
        Get a property value from an object using reflection
        Type Parameters:
        T - the type of the property you want to get.
        Parameters:
        obj - The object to get a property from.
        propertyGetter - method name of the getter, i.e. "getXY".
        Returns:
        the value read from the object