public class Graphic extends PdfContentByte implements Element
Graphic
element can contain several geometric figures (curves, lines,...).
If you want to use this Element
, please read the Sections 8.4 and 8.5 of
the PDF Reference Manual version 1.3 first.
Element
Modifier and Type | Field and Description |
---|---|
private java.util.HashMap |
attributes
Contains some of the attributes for this Graphic.
|
static java.lang.String |
BORDER
This is a type of Graphic.
|
static java.lang.String |
HORIZONTAL_LINE
This is a type of Graphic.
|
ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, content, layerDepth, LINE_CAP_BUTT, LINE_CAP_PROJECTING_SQUARE, LINE_CAP_ROUND, LINE_JOIN_BEVEL, LINE_JOIN_MITER, LINE_JOIN_ROUND, pdf, separator, state, stateList, TEXT_RENDER_MODE_CLIP, TEXT_RENDER_MODE_FILL, TEXT_RENDER_MODE_FILL_CLIP, TEXT_RENDER_MODE_FILL_STROKE, TEXT_RENDER_MODE_FILL_STROKE_CLIP, TEXT_RENDER_MODE_INVISIBLE, TEXT_RENDER_MODE_STROKE, TEXT_RENDER_MODE_STROKE_CLIP, writer
ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANCHOR, ANNOTATION, AUTHOR, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CELL, CHAPTER, CHUNK, CREATIONDATE, CREATOR, GRAPHIC, HEADER, IMGRAW, IMGTEMPLATE, JPEG, KEYWORDS, LIST, LISTITEM, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE
Constructor and Description |
---|
Graphic()
Constructs a
Graphic -object. |
Modifier and Type | Method and Description |
---|---|
void |
drawBorder(float lineWidth,
java.awt.Color color,
float llx,
float lly,
float urx,
float ury)
Draws a border
|
void |
drawHorizontalLine(float lineWidth,
java.awt.Color color,
float x1,
float x2,
float y)
draws a horizontal line.
|
java.util.ArrayList |
getChunks()
Gets all the chunks in this element.
|
boolean |
process(ElementListener listener)
Processes the element by adding it (or the different parts) to an
ElementListener . |
void |
processAttributes(float llx,
float lly,
float urx,
float ury,
float y)
Processes the attributes of this object.
|
void |
setBorder(float linewidth,
float extraSpace)
Orders this graphic to draw a horizontal line.
|
void |
setBorder(float linewidth,
float extraSpace,
java.awt.Color color)
Orders this graphic to draw a horizontal line.
|
void |
setHorizontalLine(float linewidth,
float percentage)
Orders this graphic to draw a horizontal, centered line.
|
void |
setHorizontalLine(float linewidth,
float percentage,
java.awt.Color color)
Orders this graphic to draw a horizontal, centered line.
|
void |
setHorizontalLine(float linewidth,
float percentage,
java.awt.Color color,
int align)
Orders this graphic to draw a horizontal, centered line.
|
void |
setHorizontalLine(float linewidth,
float percentage,
int align)
Orders this graphic to draw a horizontal line with some alignment.
|
int |
type()
Gets the type of the text element.
|
add, addImage, addImage, addImage, addImage, addOutline, addOutline, addPSXObject, addTemplate, addTemplate, arc, beginLayer, beginMarkedContentSequence, beginMarkedContentSequence, beginMarkedContentSequence, beginText, bezierArc, checkWriter, circle, clip, closePath, closePathEoFillStroke, closePathFillStroke, closePathStroke, concatCTM, createAppearance, createGraphics, createGraphics, createGraphics, createGraphics, createGraphicsShapes, createGraphicsShapes, createPattern, createPattern, createPattern, createPattern, createPrinterGraphics, createPrinterGraphics, createPrinterGraphics, createPrinterGraphics, createPrinterGraphicsShapes, createPrinterGraphicsShapes, createTemplate, curveFromTo, curveTo, curveTo, drawButton, drawRadioField, drawTextField, ellipse, endLayer, endMarkedContentSequence, endText, eoClip, eoFill, eoFillStroke, fill, fillStroke, getCharacterSpacing, getDuplicate, getEffectiveStringWidth, getHorizontalScaling, getInternalBuffer, getKernArray, getLeading, getPdfDocument, getPdfWriter, getRootOutline, getWordSpacing, getXTLM, getYTLM, lineTo, localDestination, localGoto, moveText, moveTextWithLeading, moveTo, newlineShowText, newlineShowText, newlineText, newPath, paintShading, paintShading, rectangle, rectangle, remoteGoto, remoteGoto, reset, resetCMYKColorFill, resetCMYKColorStroke, resetGrayFill, resetGrayStroke, resetRGBColorFill, resetRGBColorStroke, restoreState, roundRectangle, saveState, setAction, setCharacterSpacing, setCMYKColorFill, setCMYKColorFillF, setCMYKColorStroke, setCMYKColorStrokeF, setColorFill, setColorFill, setColorStroke, setColorStroke, setDefaultColorspace, setFlatness, setFontAndSize, setGrayFill, setGrayStroke, setGState, setHorizontalScaling, setLeading, setLineCap, setLineDash, setLineDash, setLineDash, setLineDash, setLineJoin, setLineWidth, setLiteral, setLiteral, setLiteral, setMiterLimit, setPatternFill, setPatternFill, setPatternFill, setPatternStroke, setPatternStroke, setPatternStroke, setRGBColorFill, setRGBColorFillF, setRGBColorStroke, setRGBColorStrokeF, setShadingFill, setShadingStroke, setTextMatrix, setTextMatrix, setTextRenderingMode, setTextRise, setWordSpacing, showText, showText, showTextAligned, showTextAlignedKerned, showTextKerned, stroke, toPdf, toString, transform, variableRectangle
public static final java.lang.String HORIZONTAL_LINE
public static final java.lang.String BORDER
private java.util.HashMap attributes
public boolean process(ElementListener listener)
ElementListener
.public int type()
public java.util.ArrayList getChunks()
public void setHorizontalLine(float linewidth, float percentage)
linewidth
- the line widthpercentage
- the percentage horizontal width in relation to the margins or if negative, an absolute valuepublic void setHorizontalLine(float linewidth, float percentage, int align)
linewidth
- the line widthpercentage
- the percentage horizontal width in relation to the margins or if negative, an absolute valuealign
- the line alignmentpublic void setHorizontalLine(float linewidth, float percentage, java.awt.Color color)
linewidth
- the line widthpercentage
- the percentage horizontal width in relation to the margins or if negative, an absolute valuecolor
- the color of the linepublic void setHorizontalLine(float linewidth, float percentage, java.awt.Color color, int align)
linewidth
- the line widthpercentage
- the percentage horizontal width in relation to the margins or if negative, an absolute valuecolor
- the color of the linealign
- the line alignmentpublic void drawHorizontalLine(float lineWidth, java.awt.Color color, float x1, float x2, float y)
lineWidth
- width of the linecolor
- color of the linex1
- start position of the linex2
- end position of the liney
- y-coordinate of the linepublic void setBorder(float linewidth, float extraSpace)
linewidth
- linewidth of the borderextraSpace
- extraspace needed as marging on the pagepublic void setBorder(float linewidth, float extraSpace, java.awt.Color color)
linewidth
- linewidth of the borderextraSpace
- extraspace needed as marging on the pagecolor
- color of the borderboxpublic void drawBorder(float lineWidth, java.awt.Color color, float llx, float lly, float urx, float ury)
lineWidth
- linewidth of the bordercolor
- color of the borderboxllx
- lower left x coordinatelly
- lower left y coordinateurx
- upper right x coordinateury
- upper right y coordinatepublic void processAttributes(float llx, float lly, float urx, float ury, float y)
llx
- lower left x coordinatelly
- lower left y coordinateurx
- upper right x coordinateury
- upper right y coordinatey
-