Class PdfXObject
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
PdfFileSpecfile 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
PdfXObjectthe xObject for which we are calculating the rectangle
x
floatthe x-coordinate of the lower-left corner of the rectangle
y
floatthe y-coordinate of the lower-left corner of the rectangle
height
floatthe 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
PdfXObjectthe xObject for which we are calculating the rectangle
x
floatthe x-coordinate of the lower-left corner of the rectangle
y
floatthe y-coordinate of the lower-left corner of the rectangle
width
floatthe 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
booldefines 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
- See Also
MakeXObject(PdfStream)
Create PdfFormXObject or PdfImageXObject by PdfStream.
public static PdfXObject MakeXObject(PdfStream stream)
Parameters
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
IPdfOCGthe layer this XObject belongs to.
- See Also