Class DrawingUtil

java.lang.Object
io.keikai.doc.io.schema.pdf.utils.DrawingUtil

public class DrawingUtil extends Object
Internal Use Only.

Utility class for drawing shapes in a PDF document.

This class provides methods to draw shapes, lines, circle, etc.

Author:
jamson
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    drawCircle(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x, float y, float r, Color c)
    Draw a circle.
    static void
    drawDashedLine(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x1, float y1, float x2, float y2, float w, Color c)
    Draw a dashed line.
    static void
    drawDottedLine(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x1, float y1, float x2, float y2, float w, Color c)
    Draw a dotted line.
    static void
    drawDoubleLine(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x1, float y1, float x2, float y2, float w, Color c)
    Draw a double line.
    static void
    drawLine(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x1, float y1, float x2, float y2, float w, Color c)
    Draw a line.
    static void
    drawNotDef(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x, float y, float w)
    Draw a not-defined figure, this method should ONLY invoke while drawing a text.
    static void
    drawRect(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x, float y, float w, float h, Color c)
    Draw a rectangle.

    Methods inherited from class java.lang.Object

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

    • DrawingUtil

      public DrawingUtil()
  • Method Details

    • drawRect

      public static void drawRect(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x, float y, float w, float h, Color c)
      Draw a rectangle.
      Parameters:
      cs - the content stream
      x - the x coordinate of the top-left corner
      y - the y coordinate of the top-left corner
      w - the width of the rectangle
      h - the height of the rectangle
      c - the color of the rectangle
    • drawCircle

      public static void drawCircle(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x, float y, float r, Color c)
      Draw a circle.
      Parameters:
      cs - the content stream
      x - the x coordinate of the center
      y - the y coordinate of the center
      r - the radius of the circle
      c - the color of the circle
    • drawLine

      public static void drawLine(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x1, float y1, float x2, float y2, float w, Color c)
      Draw a line.
      Parameters:
      cs - the content stream
      x1 - the start x coordinate
      y1 - the start y coordinate
      x2 - the end x coordinate
      y2 - the end y coordinate
      w - the width of the border
      c - the color of the border
    • drawDoubleLine

      public static void drawDoubleLine(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x1, float y1, float x2, float y2, float w, Color c)
      Draw a double line.
      Parameters:
      cs - the content stream
      x1 - the start x coordinate
      y1 - the start y coordinate
      x2 - the end x coordinate
      y2 - the end y coordinate
      w - the width of the border
      c - the color of the border
    • drawDashedLine

      public static void drawDashedLine(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x1, float y1, float x2, float y2, float w, Color c)
      Draw a dashed line.
      Parameters:
      cs - the content stream
      x1 - the start x coordinate
      y1 - the start y coordinate
      x2 - the end x coordinate
      y2 - the end y coordinate
      w - the width of the border
      c - the color of the border
    • drawDottedLine

      public static void drawDottedLine(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x1, float y1, float x2, float y2, float w, Color c)
      Draw a dotted line.
      Parameters:
      cs - the content stream
      x1 - the start x coordinate
      y1 - the start y coordinate
      x2 - the end x coordinate
      y2 - the end y coordinate
      w - the width of the border
      c - the color of the border
    • drawNotDef

      public static void drawNotDef(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x, float y, float w)
      Draw a not-defined figure, this method should ONLY invoke while drawing a text.
      Parameters:
      cs - the content stream
      x - the x coordinate
      y - the y coordinate
      w - the width