Class DrawingUtil
- java.lang.Object
-
- io.keikai.doc.io.schema.pdf.utils.DrawingUtil
-
public class DrawingUtil extends java.lang.ObjectInternal 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 DrawingUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voiddrawCircle(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x, float y, float r, java.awt.Color c)Draw a circle.static voiddrawDashedLine(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x1, float y1, float x2, float y2, float w, java.awt.Color c)Draw a dashed line.static voiddrawDottedLine(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x1, float y1, float x2, float y2, float w, java.awt.Color c)Draw a dotted line.static voiddrawDoubleLine(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x1, float y1, float x2, float y2, float w, java.awt.Color c)Draw a double line.static voiddrawLine(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x1, float y1, float x2, float y2, float w, java.awt.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, java.awt.Color c)Draw a rectangle.
-
-
-
Method Detail
-
drawRect
public static void drawRect(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x, float y, float w, float h, java.awt.Color c) throws java.io.IOExceptionDraw 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- Throws:
java.io.IOException- if an I/O error occurs
-
drawCircle
public static void drawCircle(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x, float y, float r, java.awt.Color c) throws java.io.IOExceptionDraw 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- Throws:
java.io.IOException- if an I/O error occurs
-
drawLine
public static void drawLine(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x1, float y1, float x2, float y2, float w, java.awt.Color c) throws java.io.IOExceptionDraw 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- Throws:
java.io.IOException- if an I/O error occurs
-
drawDoubleLine
public static void drawDoubleLine(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x1, float y1, float x2, float y2, float w, java.awt.Color c) throws java.io.IOExceptionDraw 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- Throws:
java.io.IOException- if an I/O error occurs
-
drawDashedLine
public static void drawDashedLine(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x1, float y1, float x2, float y2, float w, java.awt.Color c) throws java.io.IOExceptionDraw 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- Throws:
java.io.IOException- if an I/O error occurs
-
drawDottedLine
public static void drawDottedLine(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x1, float y1, float x2, float y2, float w, java.awt.Color c) throws java.io.IOExceptionDraw 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- Throws:
java.io.IOException- if an I/O error occurs
-
drawNotDef
public static void drawNotDef(org.apache.pdfbox.pdmodel.PDPageContentStream cs, float x, float y, float w) throws java.io.IOExceptionDraw 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- Throws:
java.io.IOException- if an I/O error occurs
-
-