Class DrawingUtil


  • public class DrawingUtil
    extends java.lang.Object
    Utility class to draw form fields PdfFormField.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.lang.String check  
      protected static java.lang.String circle  
      protected static java.lang.String cross  
      protected static java.lang.String diamond  
      protected static java.lang.String square  
      protected static java.lang.String star  
    • Constructor Summary

      Constructors 
      Constructor Description
      DrawingUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void drawCircle​(PdfCanvas canvas, float centerX, float centerY, float radius)
      Draws a circle with the specified radius.
      static void drawCross​(PdfCanvas canvas, float width, float height, float borderWidth)
      Draws a cross with the specified width and height.
      private static void drawPdfAAppearanceString​(PdfCanvas canvas, float width, float height, float moveX, float moveY, java.lang.String appearanceString)  
      static void drawPdfACheck​(PdfCanvas canvas, float width, float height)
      Draws a PDF A compliant check mark in the specified rectangle.
      static void drawPdfACheck​(PdfCanvas canvas, float width, float height, float moveX, float moveY)
      Draws a PDF A compliant check mark in the specified rectangle.
      static void drawPdfACircle​(PdfCanvas canvas, float width, float height)
      Draws a PDF A compliant circle in the specified rectangle.
      static void drawPdfACircle​(PdfCanvas canvas, float width, float height, float moveX, float moveY)
      Draws a PDF A compliant circle in the specified rectangle.
      static void drawPdfACross​(PdfCanvas canvas, float width, float height)
      Draws a PDF A compliant cross in the specified rectangle.
      static void drawPdfACross​(PdfCanvas canvas, float width, float height, float moveX, float moveY)
      Draws a PDF A compliant cross in the specified rectangle.
      static void drawPdfADiamond​(PdfCanvas canvas, float width, float height)
      Draws a PDF A compliant diamond in the specified rectangle.
      static void drawPdfADiamond​(PdfCanvas canvas, float width, float height, float moveX, float moveY)
      Draws a PDF A compliant diamond in the specified rectangle.
      static void drawPdfASquare​(PdfCanvas canvas, float width, float height)
      Draws a PDF A compliant square in the specified rectangle.
      static void drawPdfASquare​(PdfCanvas canvas, float width, float height, float moveX, float moveY)
      Draws a PDF A compliant square in the specified rectangle.
      static void drawPdfAStar​(PdfCanvas canvas, float width, float height)
      Draws a PDF A compliant star in the specified rectangle.
      static void drawPdfAStar​(PdfCanvas canvas, float width, float height, float moveX, float moveY)
      Draws a PDF A compliant star in the specified rectangle.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DrawingUtil

        public DrawingUtil()
    • Method Detail

      • drawPdfAAppearanceString

        private static void drawPdfAAppearanceString​(PdfCanvas canvas,
                                                     float width,
                                                     float height,
                                                     float moveX,
                                                     float moveY,
                                                     java.lang.String appearanceString)
      • drawPdfACheck

        public static void drawPdfACheck​(PdfCanvas canvas,
                                         float width,
                                         float height,
                                         float moveX,
                                         float moveY)
        Draws a PDF A compliant check mark in the specified rectangle.
        Parameters:
        canvas - the canvas to draw on
        width - the width of the rectangle
        height - the height of the rectangle
        moveX - the x coordinate of the bottom left corner of the rectangle
        moveY - the y coordinate of the bottom left corner of the rectangle
      • drawPdfACheck

        public static void drawPdfACheck​(PdfCanvas canvas,
                                         float width,
                                         float height)
        Draws a PDF A compliant check mark in the specified rectangle.
        Parameters:
        canvas - the canvas to draw on
        width - the width of the rectangle
        height - the height of the rectangle
      • drawPdfACircle

        public static void drawPdfACircle​(PdfCanvas canvas,
                                          float width,
                                          float height,
                                          float moveX,
                                          float moveY)
        Draws a PDF A compliant circle in the specified rectangle.
        Parameters:
        canvas - the canvas to draw on
        width - the width of the rectangle
        height - the height of the rectangle
        moveX - the x coordinate of the bottom left corner of the rectangle
        moveY - the y coordinate of the bottom left corner of the rectangle
      • drawPdfACircle

        public static void drawPdfACircle​(PdfCanvas canvas,
                                          float width,
                                          float height)
        Draws a PDF A compliant circle in the specified rectangle.
        Parameters:
        canvas - the canvas to draw on
        width - the width of the rectangle
        height - the height of the rectangle
      • drawPdfACross

        public static void drawPdfACross​(PdfCanvas canvas,
                                         float width,
                                         float height,
                                         float moveX,
                                         float moveY)
        Draws a PDF A compliant cross in the specified rectangle.
        Parameters:
        canvas - the canvas to draw on
        width - the width of the rectangle
        height - the height of the rectangle
        moveX - the x coordinate of the bottom left corner of the rectangle
        moveY - the y coordinate of the bottom left corner of the rectangle
      • drawPdfACross

        public static void drawPdfACross​(PdfCanvas canvas,
                                         float width,
                                         float height)
        Draws a PDF A compliant cross in the specified rectangle.
        Parameters:
        canvas - the canvas to draw on
        width - the width of the rectangle
        height - the height of the rectangle
      • drawPdfADiamond

        public static void drawPdfADiamond​(PdfCanvas canvas,
                                           float width,
                                           float height,
                                           float moveX,
                                           float moveY)
        Draws a PDF A compliant diamond in the specified rectangle.
        Parameters:
        canvas - the canvas to draw on
        width - the width of the rectangle
        height - the height of the rectangle
        moveX - the x coordinate of the bottom left corner of the rectangle
        moveY - the y coordinate of the bottom left corner of the rectangle
      • drawPdfADiamond

        public static void drawPdfADiamond​(PdfCanvas canvas,
                                           float width,
                                           float height)
        Draws a PDF A compliant diamond in the specified rectangle.
        Parameters:
        canvas - the canvas to draw on
        width - the width of the rectangle
        height - the height of the rectangle
      • drawPdfASquare

        public static void drawPdfASquare​(PdfCanvas canvas,
                                          float width,
                                          float height,
                                          float moveX,
                                          float moveY)
        Draws a PDF A compliant square in the specified rectangle.
        Parameters:
        canvas - the canvas to draw on
        width - the width of the rectangle
        height - the height of the rectangle
        moveX - the x coordinate of the bottom left corner of the rectangle
        moveY - the y coordinate of the bottom left corner of the rectangle
      • drawPdfASquare

        public static void drawPdfASquare​(PdfCanvas canvas,
                                          float width,
                                          float height)
        Draws a PDF A compliant square in the specified rectangle.
        Parameters:
        canvas - the canvas to draw on
        width - the width of the rectangle
        height - the height of the rectangle
      • drawPdfAStar

        public static void drawPdfAStar​(PdfCanvas canvas,
                                        float width,
                                        float height,
                                        float moveX,
                                        float moveY)
        Draws a PDF A compliant star in the specified rectangle.
        Parameters:
        canvas - the canvas to draw on
        width - the width of the rectangle
        height - the height of the rectangle
        moveX - the x coordinate of the bottom left corner of the rectangle
        moveY - the y coordinate of the bottom left corner of the rectangle
      • drawPdfAStar

        public static void drawPdfAStar​(PdfCanvas canvas,
                                        float width,
                                        float height)
        Draws a PDF A compliant star in the specified rectangle.
        Parameters:
        canvas - the canvas to draw on
        width - the width of the rectangle
        height - the height of the rectangle
      • drawCross

        public static void drawCross​(PdfCanvas canvas,
                                     float width,
                                     float height,
                                     float borderWidth)
        Draws a cross with the specified width and height.
        Parameters:
        canvas - the canvas to draw on
        width - the width of the rectangle
        height - the height of the rectangle
        borderWidth - the width of the border
      • drawCircle

        public static void drawCircle​(PdfCanvas canvas,
                                      float centerX,
                                      float centerY,
                                      float radius)
        Draws a circle with the specified radius.
        Parameters:
        canvas - the canvas to draw on
        centerX - the x coordinate of the center of the circle
        centerY - the y coordinate of the center of the circle
        radius - the radius of the circle