public class ImageFieldMergingArgs extends FieldMergingArgsBase
IFieldMergingCallback.imageFieldMerging(com.aspose.words.ImageFieldMergingArgs) event.
To learn more, visit the Mail Merge and Reporting documentation article.
This event occurs during mail merge when an image mail merge field is encountered in the document. You can respond to this event to return a file name, stream, or an BufferedImage object to the mail merge engine so it is inserted into the document.
There are three properties available getImageFileName() / setImageFileName(java.lang.String), P:Aspose.Words.MailMerging.ImageFieldMergingArgs.ImageStream and getImage() / setImage(java.awt.image.BufferedImage) to specify where the image must be taken from. Set only one of these properties.
To insert an image mail merge field into a document in Word, select Insert/Field command, then select MergeField and type Image:MyFieldName.
IFieldMergingCallback| Modifier and Type | Method and Description |
|---|---|
java.awt.image.BufferedImage |
getImage()
Specifies the image that the mail merge engine must insert into the document.
|
java.lang.String |
getImageFileName()
Sets the file name of the image that the mail merge engine must insert into the document.
|
MergeFieldImageDimension |
getImageHeight()
Specifies the image height for the image to insert into the document.
|
java.io.InputStream |
getImageStream() |
MergeFieldImageDimension |
getImageWidth()
Specifies the image width for the image to insert into the document.
|
Shape |
getShape()
Specifies the shape that the mail merge engine must insert into the document.
|
void |
setImage(java.awt.image.BufferedImage value)
Specifies the image that the mail merge engine must insert into the document.
|
void |
setImageFileName(java.lang.String value)
Sets the file name of the image that the mail merge engine must insert into the document.
|
void |
setImageHeight(MergeFieldImageDimension value)
Specifies the image height for the image to insert into the document.
|
void |
setImageStream(java.io.InputStream value) |
void |
setImageWidth(MergeFieldImageDimension value)
Specifies the image width for the image to insert into the document.
|
void |
setShape(Shape value)
Specifies the shape that the mail merge engine must insert into the document.
|
getDocument, getDocumentFieldName, getField, getFieldName, getFieldValue, getRecordIndex, getTableName, setFieldValuepublic java.lang.String getImageFileName()
public void setImageFileName(java.lang.String value)
value - The file name of the image that the mail merge engine must insert into the document.public java.io.InputStream getImageStream()
public void setImageStream(java.io.InputStream value)
public java.awt.image.BufferedImage getImage()
BufferedImage value.public void setImage(java.awt.image.BufferedImage value)
value - The corresponding BufferedImage value.public Shape getShape()
When this property is specified, the mail merge engine ignores all other properties like getImageFileName() / setImageFileName(java.lang.String) or P:Aspose.Words.MailMerging.ImageFieldMergingArgs.ImageStream and simply inserts the shape into the document.
Use this property to fully control the process of merging an image merge field. For example, you can specify ShapeBase.getWrapType() / ShapeBase.setWrapType(int) or any other shape property to fine tune the resulting node. However, please note that you are responsible for providing the content of the shape.
Shape value.public void setShape(Shape value)
When this property is specified, the mail merge engine ignores all other properties like getImageFileName() / setImageFileName(java.lang.String) or P:Aspose.Words.MailMerging.ImageFieldMergingArgs.ImageStream and simply inserts the shape into the document.
Use this property to fully control the process of merging an image merge field. For example, you can specify ShapeBase.getWrapType() / ShapeBase.setWrapType(int) or any other shape property to fine tune the resulting node. However, please note that you are responsible for providing the content of the shape.
value - The corresponding Shape value.public MergeFieldImageDimension getImageWidth()
The value of this property initially comes from the corresponding MERGEFIELD's code, contained in the template document. To override the initial value, you should assign an instance of MergeFieldImageDimension class to this property or set the properties for the instance of MergeFieldImageDimension class, returned by this property.
To indicate that the original value of the image width should be applied, you should assign the null value to this property or set the MergeFieldImageDimension.getValue() / MergeFieldImageDimension.setValue(double) property for the instance of MergeFieldImageDimension class, returned by this property, to a negative value.
MergeFieldImageDimension value.MergeFieldImageDimension,
MergeFieldImageDimensionUnitpublic void setImageWidth(MergeFieldImageDimension value)
The value of this property initially comes from the corresponding MERGEFIELD's code, contained in the template document. To override the initial value, you should assign an instance of MergeFieldImageDimension class to this property or set the properties for the instance of MergeFieldImageDimension class, returned by this property.
To indicate that the original value of the image width should be applied, you should assign the null value to this property or set the MergeFieldImageDimension.getValue() / MergeFieldImageDimension.setValue(double) property for the instance of MergeFieldImageDimension class, returned by this property, to a negative value.
value - The corresponding MergeFieldImageDimension value.MergeFieldImageDimension,
MergeFieldImageDimensionUnitpublic MergeFieldImageDimension getImageHeight()
The value of this property initially comes from the corresponding MERGEFIELD's code, contained in the template document. To override the initial value, you should assign an instance of MergeFieldImageDimension class to this property or set the properties for the instance of MergeFieldImageDimension class, returned by this property.
To indicate that the original value of the image height should be applied, you should assign the null value to this property or set the MergeFieldImageDimension.getValue() / MergeFieldImageDimension.setValue(double) property for the instance of MergeFieldImageDimension class, returned by this property, to a negative value.
MergeFieldImageDimension value.MergeFieldImageDimension,
MergeFieldImageDimensionUnitpublic void setImageHeight(MergeFieldImageDimension value)
The value of this property initially comes from the corresponding MERGEFIELD's code, contained in the template document. To override the initial value, you should assign an instance of MergeFieldImageDimension class to this property or set the properties for the instance of MergeFieldImageDimension class, returned by this property.
To indicate that the original value of the image height should be applied, you should assign the null value to this property or set the MergeFieldImageDimension.getValue() / MergeFieldImageDimension.setValue(double) property for the instance of MergeFieldImageDimension class, returned by this property, to a negative value.
value - The corresponding MergeFieldImageDimension value.MergeFieldImageDimension,
MergeFieldImageDimensionUnit