Table of Contents

Class PdfXObject

Namespace
iText.Kernel.Pdf.Xobject
Assembly
itext.kernel.dll

An abstract wrapper for supported types of XObject.

public abstract class PdfXObject : PdfObjectWrapper<PdfStream>
Inheritance
PdfXObject
Derived
Inherited Members

Constructors

PdfXObject(PdfStream)

protected PdfXObject(PdfStream pdfObject)

Parameters

pdfObject PdfStream
See Also

Methods

AddAssociatedFile(PdfFileSpec)

Adds file associated with PDF XObject and identifies the relationship between them.

public virtual void AddAssociatedFile(PdfFileSpec fs)

Parameters

fs PdfFileSpec

file specification dictionary of associated file

Remarks

Adds file associated with PDF XObject and identifies the relationship between them. Associated files may be used in Pdf/A-3 and Pdf 2.0 documents. The method adds file to array value of the AF key in the XObject dictionary.

For associated files their associated file specification dictionaries shall include the AFRelationship key
See Also

CalculateProportionallyFitRectangleWithHeight(PdfXObject, float, float, float)

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.

public static Rectangle CalculateProportionallyFitRectangleWithHeight(PdfXObject xObject, float x, float y, float height)

Parameters

xObject PdfXObject

the xObject for which we are calculating the rectangle

x float

the x-coordinate of the lower-left corner of the rectangle

y float

the y-coordinate of the lower-left corner of the rectangle

height float

the height of the rectangle

Returns

Rectangle

the rectangle with specified coordinates and height

Remarks

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.

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.
See Also

CalculateProportionallyFitRectangleWithWidth(PdfXObject, float, float, float)

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.

public static Rectangle CalculateProportionallyFitRectangleWithWidth(PdfXObject xObject, float x, float y, float width)

Parameters

xObject PdfXObject

the xObject for which we are calculating the rectangle

x float

the x-coordinate of the lower-left corner of the rectangle

y float

the y-coordinate of the lower-left corner of the rectangle

width float

the width of the rectangle

Returns

Rectangle

the rectangle with specified coordinates and width

Remarks

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.

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.
See Also

GetAssociatedFiles(bool)

Returns files associated with XObject.

public virtual PdfArray GetAssociatedFiles(bool create)

Parameters

create bool

defines whether AF arrays will be created if it doesn't exist

Returns

PdfArray

associated files array

See Also

GetHeight()

Gets height of XObject.

public virtual float GetHeight()

Returns

float

float value.

See Also

GetWidth()

Gets width of XObject.

public virtual float GetWidth()

Returns

float

float value.

See Also

IsWrappedObjectMustBeIndirect()

protected override bool IsWrappedObjectMustBeIndirect()

Returns

bool
See Also

MakeXObject(PdfStream)

public static PdfXObject MakeXObject(PdfStream stream)

Parameters

stream PdfStream

PdfStream with either Form or Image

Subtype

Returns

PdfXObject

either PdfFormXObject or PdfImageXObject.

See Also

SetLayer(IPdfOCG)

Sets the layer this XObject belongs to.

public virtual void SetLayer(IPdfOCG layer)

Parameters

layer IPdfOCG

the layer this XObject belongs to.

See Also

See Also