Package org.openpdf.text.pdf
Class PdfRectangle
java.lang.Object
org.openpdf.text.pdf.PdfObject
org.openpdf.text.pdf.PdfArray
org.openpdf.text.pdf.PdfRectangle
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).
- See Also:
-
Field Summary
Fields inherited from class org.openpdf.text.pdf.PdfObject
ARRAY, BOOLEAN, bytes, DICTIONARY, INDIRECT, NAME, NOTHING, NULL, NUMBER, STREAM, STRING, TEXT_PDFDOCENCODING, TEXT_UNICODE, type -
Constructor Summary
ConstructorsConstructorDescriptionPdfRectangle(float llx, float lly, float urx, float ury) PdfRectangle(float llx, float lly, float urx, float ury, int rotation) Constructs aPdfRectangle-object.PdfRectangle(Rectangle rectangle) PdfRectangle(Rectangle rectangle, int rotation) Constructs aPdfRectangle-object with aRectangle-object. -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(int[] values) Block changes to the underlying PdfArraybooleanOverrides theadd-method inPdfArrayin order to prevent the adding of extra object to the array.floatbottom()Returns the lower left y-coordinate.floatleft()Returns the lower left x-coordinate.floatright()Returns the upper right x-coordinate.floattop()Returns the upper right y-coordinate.Methods inherited from class org.openpdf.text.pdf.PdfArray
contains, getAsName, getDirectObject, getPdfObject, isEmpty, size, toPdf, toStringMethods inherited from class org.openpdf.text.pdf.PdfObject
canBeInObjStm, getBytes, isArray, isDictionary, isName, isNull, isNumber, isString, setContent, type
-
Constructor Details
-
PdfRectangle
public 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 yrotation- the rotation angle- Since:
- rugPdf0.10
-
PdfRectangle
public PdfRectangle(float llx, float lly, float urx, float ury) -
PdfRectangle
Constructs aPdfRectangle-object with aRectangle-object.- Parameters:
rectangle- aRectanglerotation- the rotation angle
-
PdfRectangle
-
-
Method Details
-
add
Overrides theadd-method inPdfArrayin order to prevent the adding of extra object to the array. -
add
public boolean add(int[] values) 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
-