Package com.lowagie.text.pdf
Class PdfGraphics2D
java.lang.Object
java.awt.Graphics
java.awt.Graphics2D
com.lowagie.text.pdf.PdfGraphics2D
- Direct Known Subclasses:
PdfPrinterGraphics2D
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPdfGraphics2D(PdfContentByte cb, float width, float height, FontMapper fontMapper, boolean onlyShapes, boolean convertImagesToJPEG, float quality) Constructor for PDFGraphics2D. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRenderingHints(Map hints) static doubleasPoints(double d, int i) Calculates position and/or stroke thickness depending on the font sizevoidclearRect(int x, int y, int width, int height) voidvoidclipRect(int x, int y, int width, int height) voidcopyArea(int x, int y, int width, int height, int dx, int dy) create()voiddispose()protected voidThis routine goes through the attributes and sets the font before calling the actual string drawing routinevoidvoiddrawArc(int x, int y, int width, int height, int startAngle, int arcAngle) voiddrawGlyphVector(GlyphVector g, float x, float y) voiddrawImage(BufferedImage img, BufferedImageOp op, int x, int y) booleandrawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer) booleandrawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer) booleandrawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer) booleandrawImage(Image img, int x, int y, int width, int height, ImageObserver observer) booleandrawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer) booleandrawImage(Image img, int x, int y, ImageObserver observer) booleandrawImage(Image img, AffineTransform xform, ImageObserver obs) voiddrawLine(int x1, int y1, int x2, int y2) voiddrawOval(int x, int y, int width, int height) voiddrawPolygon(int[] xPoints, int[] yPoints, int nPoints) voiddrawPolyline(int[] x, int[] y, int nPoints) voiddrawRect(int x, int y, int width, int height) voiddrawRenderableImage(RenderableImage img, AffineTransform xform) voiddrawRenderedImage(RenderedImage img, AffineTransform xform) voiddrawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) voiddrawString(String s, float x, float y) voiddrawString(String s, int x, int y) voiddrawString(AttributedCharacterIterator iter, float x, float y) voiddrawString(AttributedCharacterIterator iterator, int x, int y) voidvoidfillArc(int x, int y, int width, int height, int startAngle, int arcAngle) voidfillOval(int x, int y, int width, int height) voidfillPolygon(int[] xPoints, int[] yPoints, int nPoints) voidfillRect(int x, int y, int width, int height) voidfillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) getClip()getColor()getFont()getPaint()Method contributed by Alexej Suchovbooleanvoidrotate(double theta) voidrotate(double theta, double x, double y) voidscale(double sx, double sy) voidsetBackground(Color color) voidsetClip(int x, int y, int width, int height) voidvoidvoidsetComposite(Composite comp) Method contributed by Alexej SuchovvoidSets the current font.voidMethod contributed by Alexej SuchovvoidvoidsetRenderingHint(RenderingHints.Key arg0, Object arg1) Sets a rendering hintvoidsetRenderingHints(Map hints) voidvoidvoidsetXORMode(Color c1) voidshear(double shx, double shy) voidvoidtranslate(double tx, double ty) voidtranslate(int x, int y) Methods inherited from class java.awt.Graphics2D
draw3DRect, fill3DRectMethods inherited from class java.awt.Graphics
create, drawBytes, drawChars, drawPolygon, fillPolygon, finalize, getClipBounds, getClipRect, getFontMetrics, hitClip, toString
-
Field Details
-
underline
protected boolean underline -
fillGState
-
strokeGState
-
currentFillGState
protected int currentFillGState -
currentStrokeGState
protected int currentStrokeGState -
AFM_DIVISOR
public static final int AFM_DIVISOR- See Also:
-
-
Constructor Details
-
PdfGraphics2D
protected PdfGraphics2D(PdfContentByte cb, float width, float height, FontMapper fontMapper, boolean onlyShapes, boolean convertImagesToJPEG, float quality) Constructor for PDFGraphics2D.
-
-
Method Details
-
draw
- Specified by:
drawin classGraphics2D- See Also:
-
drawImage
- Specified by:
drawImagein classGraphics2D- See Also:
-
drawImage
- Specified by:
drawImagein classGraphics2D- See Also:
-
drawRenderedImage
- Specified by:
drawRenderedImagein classGraphics2D- See Also:
-
drawRenderableImage
- Specified by:
drawRenderableImagein classGraphics2D- See Also:
-
drawString
- Specified by:
drawStringin classGraphics2D- See Also:
-
asPoints
public static double asPoints(double d, int i) Calculates position and/or stroke thickness depending on the font size- Parameters:
d- value to be convertedi- font size- Returns:
- position and/or stroke thickness depending on the font size
-
doAttributes
This routine goes through the attributes and sets the font before calling the actual string drawing routine- Parameters:
iter-
-
drawString
- Specified by:
drawStringin classGraphics2D- See Also:
-
drawString
- Specified by:
drawStringin classGraphics2D- See Also:
-
drawString
- Specified by:
drawStringin classGraphics2D- See Also:
-
drawGlyphVector
- Specified by:
drawGlyphVectorin classGraphics2D- See Also:
-
fill
- Specified by:
fillin classGraphics2D- See Also:
-
hit
- Specified by:
hitin classGraphics2D- See Also:
-
getDeviceConfiguration
- Specified by:
getDeviceConfigurationin classGraphics2D- See Also:
-
setComposite
Method contributed by Alexej Suchov- Specified by:
setCompositein classGraphics2D- See Also:
-
setPaint
Method contributed by Alexej Suchov- Specified by:
setPaintin classGraphics2D- See Also:
-
setStroke
- Specified by:
setStrokein classGraphics2D- See Also:
-
setRenderingHint
Sets a rendering hint- Specified by:
setRenderingHintin classGraphics2D- Parameters:
arg0-arg1-
-
getRenderingHint
- Specified by:
getRenderingHintin classGraphics2D- Parameters:
arg0- a key- Returns:
- the rendering hint
-
setRenderingHints
- Specified by:
setRenderingHintsin classGraphics2D- See Also:
-
addRenderingHints
- Specified by:
addRenderingHintsin classGraphics2D- See Also:
-
getRenderingHints
- Specified by:
getRenderingHintsin classGraphics2D- See Also:
-
translate
public void translate(int x, int y) - Specified by:
translatein classGraphics2D- See Also:
-
translate
public void translate(double tx, double ty) - Specified by:
translatein classGraphics2D- See Also:
-
rotate
public void rotate(double theta) - Specified by:
rotatein classGraphics2D- See Also:
-
rotate
public void rotate(double theta, double x, double y) - Specified by:
rotatein classGraphics2D- See Also:
-
scale
public void scale(double sx, double sy) - Specified by:
scalein classGraphics2D- See Also:
-
shear
public void shear(double shx, double shy) - Specified by:
shearin classGraphics2D- See Also:
-
transform
- Specified by:
transformin classGraphics2D- See Also:
-
setTransform
- Specified by:
setTransformin classGraphics2D- See Also:
-
getTransform
- Specified by:
getTransformin classGraphics2D- See Also:
-
getPaint
Method contributed by Alexej Suchov- Specified by:
getPaintin classGraphics2D- See Also:
-
getComposite
- Specified by:
getCompositein classGraphics2D- See Also:
-
setBackground
- Specified by:
setBackgroundin classGraphics2D- See Also:
-
getBackground
- Specified by:
getBackgroundin classGraphics2D- See Also:
-
getStroke
- Specified by:
getStrokein classGraphics2D- See Also:
-
getFontRenderContext
- Specified by:
getFontRenderContextin classGraphics2D- See Also:
-
create
-
getContent
-
getColor
-
setColor
-
setPaintMode
public void setPaintMode()- Specified by:
setPaintModein classGraphics- See Also:
-
setXORMode
- Specified by:
setXORModein classGraphics- See Also:
-
getFont
-
setFont
Sets the current font. -
getFontMetrics
- Specified by:
getFontMetricsin classGraphics- See Also:
-
getClipBounds
- Specified by:
getClipBoundsin classGraphics- See Also:
-
clipRect
public void clipRect(int x, int y, int width, int height) -
setClip
public void setClip(int x, int y, int width, int height) -
clip
- Specified by:
clipin classGraphics2D- See Also:
-
getClip
-
setClip
-
copyArea
public void copyArea(int x, int y, int width, int height, int dx, int dy) -
drawLine
public void drawLine(int x1, int y1, int x2, int y2) -
drawRect
public void drawRect(int x, int y, int width, int height) -
fillRect
public void fillRect(int x, int y, int width, int height) -
clearRect
public void clearRect(int x, int y, int width, int height) -
drawRoundRect
public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) - Specified by:
drawRoundRectin classGraphics- See Also:
-
fillRoundRect
public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) - Specified by:
fillRoundRectin classGraphics- See Also:
-
drawOval
public void drawOval(int x, int y, int width, int height) -
fillOval
public void fillOval(int x, int y, int width, int height) -
drawArc
public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle) -
fillArc
public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle) -
drawPolyline
public void drawPolyline(int[] x, int[] y, int nPoints) - Specified by:
drawPolylinein classGraphics- See Also:
-
drawPolygon
public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints) - Specified by:
drawPolygonin classGraphics- See Also:
-
fillPolygon
public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints) - Specified by:
fillPolygonin classGraphics- See Also:
-
drawImage
-
drawImage
-
drawImage
-
drawImage
public boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer) -
drawImage
public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer) -
drawImage
public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer) -
dispose
public void dispose()
-