Table of Contents

Class PdfFormXObject

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

A wrapper for Form XObject.

public class PdfFormXObject : PdfXObject
Inheritance
PdfFormXObject
Derived
Inherited Members

Remarks

A wrapper for Form XObject. ISO 32000-1, 8.10 FormXObjects.

Constructors

PdfFormXObject(Rectangle)

Creates a new instance of Form XObject.

public PdfFormXObject(Rectangle bBox)

Parameters

bBox Rectangle

the form XObject’s bounding box.

PdfFormXObject(WmfImageData, PdfDocument)

Creates a form XObject from WmfImageData.

public PdfFormXObject(WmfImageData image, PdfDocument pdfDocument)

Parameters

image WmfImageData

image to create form object from

pdfDocument PdfDocument

document instance which is needed for writing form stream contents

Remarks

Creates a form XObject from WmfImageData. Unlike other images, WmfImageData images are represented as PdfFormXObject , not as PdfImageXObject.

PdfFormXObject(PdfPage)

Creates form XObject from page content.

public PdfFormXObject(PdfPage page)

Parameters

page PdfPage

an instance of PdfPage

Remarks

Creates form XObject from page content. The page shall be from the document, to which FormXObject will be added.

PdfFormXObject(PdfStream)

Create PdfFormXObject instance by PdfStream.

public PdfFormXObject(PdfStream pdfStream)

Parameters

pdfStream PdfStream

PdfStream with Form XObject.

Remarks

Create PdfFormXObject instance by PdfStream. Note, this constructor doesn't perform any additional checks

See Also

Fields

resources

protected PdfResources resources

Field Value

PdfResources

Methods

CalculateBBoxMultipliedByMatrix(PdfFormXObject)

Calculates the coordinates of the xObject BBox multiplied by the Matrix field.

public static Rectangle CalculateBBoxMultipliedByMatrix(PdfFormXObject form)

Parameters

form PdfFormXObject

the object for which calculate the coordinates of the bBox

Returns

Rectangle

the bBox Rectangle

Remarks

Calculates the coordinates of the xObject BBox multiplied by the Matrix field.

For mor information see paragraph 8.10.1 in ISO-32000-1.

Flush()

To manually flush a PdfObject behind this wrapper, you have to ensure that this object is added to the document, i.e. it has an indirect reference.

public override void Flush()

Remarks

To manually flush a PdfObject behind this wrapper, you have to ensure that this object is added to the document, i.e. it has an indirect reference. Basically this means that before flushing you need to explicitly call MakeIndirect(PdfDocument). For example: wrapperInstance.makeIndirect(document).flush(); Note that not every wrapper require this, only those that have such warning in documentation.

GetBBox()

Gets Form XObject's BBox, BBox key.

public virtual PdfArray GetBBox()

Returns

PdfArray

a PdfArray , that represents Rectangle.

GetHeight()

Gets height based on XObject's BBox.

public override float GetHeight()

Returns

float

float value.

GetMarkStyle()

Gets a text string representing the printer’s mark in human-readable form.

public virtual PdfString GetMarkStyle()

Returns

PdfString

a string value.

GetProcessColorModel()

Gets process color model of trap network appearance, PCM key.

public virtual PdfName GetProcessColorModel()

Returns

PdfName

a PdfName instance, possible values: DeviceGray , DeviceRGB , DeviceCMYK , DeviceCMY , DeviceRGBK , and DeviceN.

GetResources()

Gets PdfResources of the Form XObject.

public virtual PdfResources GetResources()

Returns

PdfResources

not null instance of PdfResources.

Remarks

Gets PdfResources of the Form XObject. Note, if there is no resources, a new instance will be created.

GetSeparationColorNames()

Gets separation color names of trap network appearance, SeparationColorNames key.

public virtual PdfArray GetSeparationColorNames()

Returns

PdfArray

an PdfArray of names identifying the colorants.

GetTrapRegions()

Gets an array of TrapRegion objects defining the page’s trapping zones and the associated trapping parameters, as described in Adobe Technical Note #5620, Portable Job Ticket Format.

public virtual PdfArray GetTrapRegions()

Returns

PdfArray

A PdfArray of indirect references to TrapRegion objects.

Remarks

Gets an array of TrapRegion objects defining the page’s trapping zones and the associated trapping parameters, as described in Adobe Technical Note #5620, Portable Job Ticket Format. TrapRegions key.

GetTrapStyles()

Gets a human-readable text string that described this trap network to the user.

public virtual PdfString GetTrapStyles()

Returns

PdfString

a PdfString value.

Remarks

Gets a human-readable text string that described this trap network to the user. TrapStyles key.

GetWidth()

Gets width based on XObject's BBox.

public override float GetWidth()

Returns

float

float value.

Put(PdfName, PdfObject)

Puts the value into Image XObject dictionary and associates it with the specified key.

public virtual PdfFormXObject Put(PdfName key, PdfObject value)

Parameters

key PdfName

key to insert or to override

value PdfObject

the value to associate with the specified key

Returns

PdfFormXObject

object itself.

Remarks

Puts the value into Image XObject dictionary and associates it with the specified key. If the key is already present, it will override the old value with the specified one.

SetBBox(PdfArray)

Sets Form XObject's BBox, BBox key.

public virtual PdfFormXObject SetBBox(PdfArray bBox)

Parameters

bBox PdfArray

a PdfArray , that represents Rectangle.

Returns

PdfFormXObject

object itself.

SetGroup(PdfTransparencyGroup)

Sets a group attributes dictionary indicating that the contents of the form XObject shall be treated as a group and specifying the attributes of that group.

public virtual PdfFormXObject SetGroup(PdfTransparencyGroup transparency)

Parameters

transparency PdfTransparencyGroup

instance of PdfTransparencyGroup.

Returns

PdfFormXObject

object itself.

Remarks

Sets a group attributes dictionary indicating that the contents of the form XObject shall be treated as a group and specifying the attributes of that group. Group key.

See Also

SetMarkStyle(PdfString)

Sets a text string representing the printer’s mark in human-readable form.

public virtual PdfFormXObject SetMarkStyle(PdfString markStyle)

Parameters

markStyle PdfString

a string value.

Returns

PdfFormXObject

object itself.

SetProcessColorModel(PdfName)

Sets process color model for trap network appearance, PCM key.

public virtual PdfFormXObject SetProcessColorModel(PdfName model)

Parameters

model PdfName

shall be one of the valid values: DeviceGray , DeviceRGB , DeviceCMYK , DeviceCMY , DeviceRGBK , and DeviceN.

Returns

PdfFormXObject

object itself.

SetSeparationColorNames(PdfArray)

Sets separation color names for the trap network appearance, SeparationColorNames key.

public virtual PdfFormXObject SetSeparationColorNames(PdfArray colorNames)

Parameters

colorNames PdfArray

an array of names identifying the colorants that were assumed when the trap network appearance was created.

Returns

PdfFormXObject

object itself.

SetTrapRegions(PdfArray)

Sets an array of TrapRegion objects defining the page’s trapping zones and the associated trapping parameters, as described in Adobe Technical Note #5620, Portable Job Ticket Format.

public virtual PdfFormXObject SetTrapRegions(PdfArray regions)

Parameters

regions PdfArray

A PdfArray of indirect references to TrapRegion objects.

Returns

PdfFormXObject

object itself.

Remarks

Sets an array of TrapRegion objects defining the page’s trapping zones and the associated trapping parameters, as described in Adobe Technical Note #5620, Portable Job Ticket Format. TrapRegions key.

SetTrapStyles(PdfString)

Sets a human-readable text string that described this trap network to the user.

public virtual PdfFormXObject SetTrapStyles(PdfString trapStyles)

Parameters

trapStyles PdfString

a PdfString value.

Returns

PdfFormXObject

object itself.

Remarks

Sets a human-readable text string that described this trap network to the user. TrapStyles key.