Class ASRectangle
java.lang.Object
com.adobe.internal.pdftoolkit.core.types.ASObject
com.adobe.internal.pdftoolkit.core.types.ASRectangle
ASRectangle represents an non-COS PDF rectangle.
-
Constructor Summary
ConstructorsConstructorDescriptionASRectangle(double[] coords) ASRectangle(double left, double bottom, double right, double top) ASRectangle(ASCoordinate ll, ASCoordinate ur) ASRectangle(ASRectangle rect) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptiondoublebottom()booleancontains(ASRectangle rect) Returns true if the supplied PDFRectangle is contained in the current PDFRectangle.double[]Get the coordinate values of the rectangle's cornersbooleanbooleanhasNonZeroDimensions(double epsilon) doubleheight()doubleleft()ll()lr()Creates a new ASRectangle with normalized coordinates.doubleright()doubletop()toString()ul()ur()doublewidth()voidwrite(OutputByteStream outputByteStream) Writes the ASRectangle in to the given OutputStream in the format expected by the PDF Spec.
-
Constructor Details
-
ASRectangle
- Parameters:
ll- lower-left corner of the rectangleur- upper-right corner of the rectangle
-
ASRectangle
public ASRectangle(double left, double bottom, double right, double top) - Parameters:
left- x coordinate of the left side of the rectanglebottom- y coordinate of the bottom side of the rectangleright- x coordinate of the right side of the rectangletop- y coordinate of the top side of the rectangle
-
ASRectangle
- Parameters:
coords- an array of the coordinates in the form [left, bottom, right, top]- Throws:
PDFInvalidParameterException
-
ASRectangle
Copy constructor.- Parameters:
rect-
-
-
Method Details
-
toString
-
write
Writes the ASRectangle in to the given OutputStream in the format expected by the PDF Spec.- Specified by:
writein classASObject- Parameters:
outputByteStream- OutputByteStream to write to.- Throws:
PDFIOException- exception from OutputStream
-
getValues
public double[] getValues()Get the coordinate values of the rectangle's corners- Returns:
- an array of the format [left, bottom, right, top]
-
ll
-
lr
-
ur
-
ul
-
left
public double left() -
bottom
public double bottom() -
right
public double right() -
top
public double top() -
width
public double width() -
height
public double height() -
transform
-
hasNonZeroDimensions
public boolean hasNonZeroDimensions() -
hasNonZeroDimensions
public boolean hasNonZeroDimensions(double epsilon) -
contains
public boolean contains(ASRectangle rect) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException Returns true if the supplied PDFRectangle is contained in the current PDFRectangle.- Parameters:
rect-- Returns:
- boolean
- Throws:
PDFSecurityExceptionPDFIOExceptionPDFInvalidDocumentException
-
normalized
public ASRectangle normalized() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityExceptionCreates a new ASRectangle with normalized coordinates. The new ASRectangle will have the following properties:- left invalid input: '<'= right
- bottomw invalid input: '<'= top
- Returns:
- a new ASRectangle with normalized coordinates
- Throws:
PDFInvalidDocumentExceptionPDFIOExceptionPDFSecurityException
-