Class DrawingUtil
java.lang.Object
io.keikai.doc.io.schema.pdf.utils.DrawingUtil
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddrawCircle(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x, float y, float r, Color c) Draw a circle.static voiddrawDashedLine(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x1, float y1, float x2, float y2, float w, Color c) Draw a dashed line.static voiddrawDottedLine(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x1, float y1, float x2, float y2, float w, Color c) Draw a dotted line.static voiddrawDoubleLine(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x1, float y1, float x2, float y2, float w, Color c) Draw a double line.static voiddrawLine(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x1, float y1, float x2, float y2, float w, Color c) Draw a line.static voiddrawNotDef(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 voiddrawRect(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x, float y, float w, float h, Color c) Draw a rectangle.
-
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 streamx- the x coordinate of the top-left cornery- the y coordinate of the top-left cornerw- the width of the rectangleh- the height of the rectanglec- 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 streamx- the x coordinate of the centery- the y coordinate of the centerr- the radius of the circlec- 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 streamx1- the start x coordinatey1- the start y coordinatex2- the end x coordinatey2- the end y coordinatew- the width of the borderc- 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 streamx1- the start x coordinatey1- the start y coordinatex2- the end x coordinatey2- the end y coordinatew- the width of the borderc- 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 streamx1- the start x coordinatey1- the start y coordinatex2- the end x coordinatey2- the end y coordinatew- the width of the borderc- 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 streamx1- the start x coordinatey1- the start y coordinatex2- the end x coordinatey2- the end y coordinatew- the width of the borderc- 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 streamx- the x coordinatey- the y coordinatew- the width
-