Package com.aowagie.text.pdf
Class PdfRectangle
- java.lang.Object
-
- com.aowagie.text.pdf.PdfObject
-
- com.aowagie.text.pdf.PdfArray
-
- com.aowagie.text.pdf.PdfRectangle
-
public class PdfRectangle extends PdfArray
PdfRectangle
is the PDF Rectangle object.Rectangles are used to describe locations on the page and bounding boxes for several objects in PDF, such as fonts. A rectangle is represented as an
array
of four numbers, specifying the lower left x, lower left y, upper right x, and upper right y coordinates of the rectangle, in that order.
This object is described in the 'Portable Document Format Reference Manual version 1.3' section 7.1 (page 183).
-
-
Field Summary
Fields Modifier and Type Field Description private float
llx
lower left xprivate float
lly
lower left yprivate float
urx
upper right xprivate float
ury
upper right y-
Fields inherited from class com.aowagie.text.pdf.PdfObject
ARRAY, BOOLEAN, bytes, DICTIONARY, INDIRECT, NAME, NOTHING, NULL, NUMBER, STREAM, STRING, TEXT_PDFDOCENCODING, TEXT_UNICODE, type
-
-
Constructor Summary
Constructors Modifier Constructor Description PdfRectangle(float llx, float lly, float urx, float ury)
private
PdfRectangle(float llx, float lly, float urx, float ury, int rotation)
Constructs aPdfRectangle
-object.(package private)
PdfRectangle(Rectangle rectangle)
(package private)
PdfRectangle(Rectangle rectangle, int rotation)
Constructs aPdfRectangle
-object with aRectangle
-object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(float[] values)
Block changes to the underlying PdfArrayboolean
add(int[] values)
Block changes to the underlying PdfArrayboolean
add(PdfObject object)
Overrides theadd
-method inPdfArray
in order to prevent the adding of extra object to the array.void
addFirst(PdfObject object)
Block changes to the underlying PdfArrayfloat
bottom()
Returns the lower left y-coordinate.Rectangle
getRectangle()
Returns the high level version of this PdfRectanglefloat
left()
Returns the lower left x-coordinate.float
right()
Returns the upper right x-coordinate.float
top()
Returns the upper right y-coordinate.-
Methods inherited from class com.aowagie.text.pdf.PdfArray
add, contains, getArrayList, getAsDict, getAsIndirectObject, getAsName, getAsNumber, getAsString, getDirectObject, getPdfObject, isEmpty, listIterator, remove, set, size, toPdf, toString
-
Methods inherited from class com.aowagie.text.pdf.PdfObject
canBeInObjStm, getBytes, getIndRef, isArray, isBoolean, isDictionary, isIndirect, isName, isNull, isNumber, isStream, isString, setContent, setIndRef, type
-
-
-
-
Constructor Detail
-
PdfRectangle
private PdfRectangle(float llx, float lly, float urx, float ury, int rotation)
Constructs aPdfRectangle
-object.- Parameters:
llx
- lower left xlly
- lower left yurx
- upper right xury
- upper right y- Since:
- rugPdf0.10
-
PdfRectangle
public PdfRectangle(float llx, float lly, float urx, float ury)
-
PdfRectangle
PdfRectangle(Rectangle rectangle, int rotation)
Constructs aPdfRectangle
-object with aRectangle
-object.- Parameters:
rectangle
- aRectangle
-
PdfRectangle
PdfRectangle(Rectangle rectangle)
-
-
Method Detail
-
getRectangle
public Rectangle getRectangle()
Returns the high level version of this PdfRectangle- Returns:
- this PdfRectangle translated to class Rectangle
-
add
public boolean add(PdfObject object)
Overrides theadd
-method inPdfArray
in order to prevent the adding of extra object to the array.
-
add
public boolean add(float[] values)
Block changes to the underlying PdfArray
-
add
public boolean add(int[] values)
Block changes to the underlying PdfArray
-
addFirst
public void addFirst(PdfObject object)
Block changes to the underlying PdfArray
-
left
public float left()
Returns the lower left x-coordinate.- Returns:
- the lower left x-coordinate
-
right
public float right()
Returns the upper right x-coordinate.- Returns:
- the upper right x-coordinate
-
top
public float top()
Returns the upper right y-coordinate.- Returns:
- the upper right y-coordinate
-
bottom
public float bottom()
Returns the lower left y-coordinate.- Returns:
- the lower left y-coordinate
-
-