iText 8.0.4 API
iText.Kernel.Pdf.Xobject.PdfXObject Class Reference

An abstract wrapper for supported types of XObject. More...

Inheritance diagram for iText.Kernel.Pdf.Xobject.PdfXObject:
iText.Kernel.Pdf.PdfObjectWrapper< PdfStream > iText.Kernel.Pdf.Xobject.PdfFormXObject iText.Kernel.Pdf.Xobject.PdfImageXObject iText.Svg.Xobject.SvgImageXObject

Public Member Functions

virtual void  SetLayer (IPdfOCG layer)
  Sets the layer this XObject belongs to. More...
 
virtual float  GetWidth ()
  Gets width of XObject. More...
 
virtual float  GetHeight ()
  Gets height of XObject. More...
 
virtual void  AddAssociatedFile (PdfFileSpec fs)
  Adds file associated with PDF XObject and identifies the relationship between them. More...
 
virtual PdfArray  GetAssociatedFiles (bool create)
  Returns files associated with XObject. More...
 
- Public Member Functions inherited from iText.Kernel.Pdf.PdfObjectWrapper< PdfStream >
virtual T  GetPdfObject ()
 
virtual iText.Kernel.Pdf.PdfObjectWrapper< T >  MakeIndirect (PdfDocument document, PdfIndirectReference reference)
  Marks object behind wrapper to be saved as indirect. More...
 
virtual iText.Kernel.Pdf.PdfObjectWrapper< T >  MakeIndirect (PdfDocument document)
  Marks object behind wrapper to be saved as indirect. More...
 
virtual iText.Kernel.Pdf.PdfObjectWrapper< T >  SetModified ()
 
virtual void  Flush ()
 
virtual bool  IsFlushed ()
 

Static Public Member Functions

static iText.Kernel.Pdf.Xobject.PdfXObject  MakeXObject (PdfStream stream)
  Create PdfFormXObject or PdfImageXObject by iText.Kernel.Pdf.PdfStream. More...
 
static Rectangle  CalculateProportionallyFitRectangleWithWidth (iText.Kernel.Pdf.Xobject.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. More...
 
static Rectangle  CalculateProportionallyFitRectangleWithHeight (iText.Kernel.Pdf.Xobject.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. More...
 

Detailed Description

An abstract wrapper for supported types of XObject.

See also
PdfFormXObject, PdfImageXObject

Member Function Documentation

◆ AddAssociatedFile()

virtual void iText.Kernel.Pdf.Xobject.PdfXObject.AddAssociatedFile ( PdfFileSpec  fs )
inlinevirtual

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

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

Parameters
fs file specification dictionary of associated file

◆ CalculateProportionallyFitRectangleWithHeight()

static Rectangle iText.Kernel.Pdf.Xobject.PdfXObject.CalculateProportionallyFitRectangleWithHeight ( iText.Kernel.Pdf.Xobject.PdfXObject  xObject,
float  x,
float  y,
float  height 
)
inlinestatic

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.

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.

Parameters
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
Returns
the rectangle with specified coordinates and height

◆ CalculateProportionallyFitRectangleWithWidth()

static Rectangle iText.Kernel.Pdf.Xobject.PdfXObject.CalculateProportionallyFitRectangleWithWidth ( iText.Kernel.Pdf.Xobject.PdfXObject  xObject,
float  x,
float  y,
float  width 
)
inlinestatic

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.

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.

Parameters
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
Returns
the rectangle with specified coordinates and width

◆ GetAssociatedFiles()

virtual PdfArray iText.Kernel.Pdf.Xobject.PdfXObject.GetAssociatedFiles ( bool  create )
inlinevirtual

Returns files associated with XObject.

Parameters
create defines whether AF arrays will be created if it doesn't exist
Returns
associated files array

◆ GetHeight()

virtual float iText.Kernel.Pdf.Xobject.PdfXObject.GetHeight ( )
inlinevirtual

Gets height of XObject.

Returns
float value.

Reimplemented in iText.Kernel.Pdf.Xobject.PdfFormXObject, and iText.Kernel.Pdf.Xobject.PdfImageXObject.

◆ GetWidth()

virtual float iText.Kernel.Pdf.Xobject.PdfXObject.GetWidth ( )
inlinevirtual

Gets width of XObject.

Returns
float value.

Reimplemented in iText.Kernel.Pdf.Xobject.PdfFormXObject, and iText.Kernel.Pdf.Xobject.PdfImageXObject.

◆ MakeXObject()

static iText.Kernel.Pdf.Xobject.PdfXObject iText.Kernel.Pdf.Xobject.PdfXObject.MakeXObject ( PdfStream  stream )
inlinestatic

Create PdfFormXObject or PdfImageXObject by iText.Kernel.Pdf.PdfStream.

Parameters
stream

iText.Kernel.Pdf.PdfStream with either iText.Kernel.Pdf.PdfName.Form or iText.Kernel.Pdf.PdfName.Image

iText.Kernel.Pdf.PdfName.Subtype

Returns
either PdfFormXObject or PdfImageXObject.

◆ SetLayer()

virtual void iText.Kernel.Pdf.Xobject.PdfXObject.SetLayer ( IPdfOCG  layer )
inlinevirtual

Sets the layer this XObject belongs to.

Parameters
layer the layer this XObject belongs to.