public abstract class PdfXObject extends PdfObjectWrapper<PdfStream>
PdfFormXObject
, PdfImageXObject
, Serialized Form
Modifier | Constructor and Description |
---|---|
protected |
PdfXObject(PdfStream pdfObject) |
Modifier and Type | Method and Description |
---|---|
void |
addAssociatedFile(PdfFileSpec fs)
Adds file associated with PDF XObject and identifies the relationship between them.
|
static Rectangle |
calculateProportionallyFitRectangleWithHeight(PdfXObject xObject, float x, float y, float height)
Calculates a rectangle with the specified coordinates and height, and the width is calculated in such a way that the original proportions of the xObject do not change.
|
static Rectangle |
calculateProportionallyFitRectangleWithWidth(PdfXObject xObject, float x, float y, float width)
Calculates a rectangle with the specified coordinates and width, and the height is calculated in such a way that the original proportions of the xObject do not change.
|
PdfArray |
getAssociatedFiles(boolean create)
Returns files associated with XObject.
|
float |
getHeight()
Gets height of XObject.
|
float |
getWidth()
Gets width of XObject.
|
protected boolean |
isWrappedObjectMustBeIndirect()
Defines if the object behind this wrapper must be an indirect object in the resultant document.
|
static PdfXObject |
makeXObject(PdfStream stream)
|
void |
setLayer(IPdfOCG layer)
Sets the layer this XObject belongs to.
|
ensureObjectIsAddedToDocument, ensureUnderlyingObjectHasIndirectReference, flush, getPdfObject, isFlushed, makeIndirect, makeIndirect, markObjectAsIndirect, setForbidRelease, setModified, setPdfObject, unsetForbidRelease
protected PdfXObject(PdfStream pdfObject)
public static PdfXObject makeXObject(PdfStream stream)
stream
- PdfStream
with either PdfName.Form
or PdfName.Image
PdfName.Subtype
PdfFormXObject
or PdfImageXObject
.
public static Rectangle calculateProportionallyFitRectangleWithWidth(PdfXObject xObject, float x, float y, float width)
To calculate the original width and height of the xObject, the BBox and Matrix fields are used. For mor information see paragraph 8.10.1 in ISO-32000-1.
xObject
- the xObject for which we are calculating the rectangle
x
- the x-coordinate of the lower-left corner of the rectangle
y
- the y-coordinate of the lower-left corner of the rectangle
width
- the width of the rectangle
public static Rectangle calculateProportionallyFitRectangleWithHeight(PdfXObject xObject, float x, float y, float height)
To calculate the original width and height of the xObject, the BBox and Matrix fields are used. For mor information see paragraph 8.10.1 in ISO-32000-1.
xObject
- the xObject for which we are calculating the rectangle
x
- the x-coordinate of the lower-left corner of the rectangle
y
- the y-coordinate of the lower-left corner of the rectangle
height
- the height of the rectangle
public void setLayer(IPdfOCG layer)
layer
- the layer this XObject belongs to.
public float getWidth()
public float getHeight()
public void addAssociatedFile(PdfFileSpec fs)
For associated files their associated file specification dictionaries shall include the AFRelationship key
fs
- file specification dictionary of associated file
public PdfArray getAssociatedFiles(boolean create)
create
- defines whether AF arrays will be created if it doesn't exist
protected boolean isWrappedObjectMustBeIndirect()
isWrappedObjectMustBeIndirect
in class PdfObjectWrapper<PdfStream>
Copyright © 1998–2023 iText Group NV. All rights reserved.