ExecuteToImages
ExecuteToImages(string, ImageSaveOptions, string[], object[], MailMergeOptions)
Performs a mail merge operation for a single record and renders the result to images.
public static Stream[] ExecuteToImages(string inputFileName, ImageSaveOptions saveOptions,
string[] fieldNames, object[] fieldValues, MailMergeOptions mailMergeOptions = null)
Parameter | Type | Description |
---|---|---|
inputFileName | String | The input file name. |
saveOptions | ImageSaveOptions | The output’s save options. |
fieldNames | String[] | Array of merge field names. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored. |
fieldValues | Object[] | Array of values to be inserted into the merge fields. Number of elements in this array must be the same as the number of elements in fieldNames. |
mailMergeOptions | MailMergeOptions | Mail merge options. |
Examples
Shows how to do mail merge operation for a single record and save result to images.
// There is a several ways to do mail merge operation:
string doc = MyDir + "Mail merge.doc";
string[] fieldNames = new string[] { "FirstName", "Location", "SpecialCharsInName()" };
string[] fieldValues = new string[] { "James Bond", "London", "Classified" };
Stream[] images = MailMerger.ExecuteToImages(doc, new ImageSaveOptions(SaveFormat.Png), fieldNames, fieldValues);
MailMergeOptions mailMergeOptions = new MailMergeOptions();
mailMergeOptions.TrimWhitespaces = true;
images = MailMerger.ExecuteToImages(doc, new ImageSaveOptions(SaveFormat.Png), fieldNames, fieldValues, mailMergeOptions);
See Also
- class ImageSaveOptions
- class MailMergeOptions
- class MailMerger
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
ExecuteToImages(Stream, ImageSaveOptions, string[], object[], MailMergeOptions)
Performs a mail merge operation for a single record and renders the result to images.
public static Stream[] ExecuteToImages(Stream inputStream, ImageSaveOptions saveOptions,
string[] fieldNames, object[] fieldValues, MailMergeOptions mailMergeOptions = null)
Parameter | Type | Description |
---|---|---|
inputStream | Stream | The input file stream. |
saveOptions | ImageSaveOptions | The output’s save options. |
fieldNames | String[] | Array of merge field names. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored. |
fieldValues | Object[] | Array of values to be inserted into the merge fields. Number of elements in this array must be the same as the number of elements in fieldNames. |
mailMergeOptions | MailMergeOptions | Mail merge options. |
Examples
Shows how to do mail merge operation for a single record from the stream and save result to images.
// There is a several ways to do mail merge operation using documents from the stream:
string[] fieldNames = new string[] { "FirstName", "Location", "SpecialCharsInName()" };
string[] fieldValues = new string[] { "James Bond", "London", "Classified" };
using (FileStream streamIn = new FileStream(MyDir + "Mail merge.doc", FileMode.Open, FileAccess.Read))
{
Stream[] images = MailMerger.ExecuteToImages(streamIn, new ImageSaveOptions(SaveFormat.Png), fieldNames, fieldValues);
MailMergeOptions mailMergeOptions = new MailMergeOptions();
mailMergeOptions.TrimWhitespaces = true;
images = MailMerger.ExecuteToImages(streamIn, new ImageSaveOptions(SaveFormat.Png), fieldNames, fieldValues, mailMergeOptions);
}
See Also
- class ImageSaveOptions
- class MailMergeOptions
- class MailMerger
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
ExecuteToImages(string, ImageSaveOptions, DataRow, MailMergeOptions)
Performs mail merge from a DataRow into the document and renders the result to images.
public static Stream[] ExecuteToImages(string inputFileName, ImageSaveOptions saveOptions,
DataRow dataRow, MailMergeOptions mailMergeOptions = null)
Parameter | Type | Description |
---|---|---|
inputFileName | String | The input file name. |
saveOptions | ImageSaveOptions | The output’s save options. |
dataRow | DataRow | Row that contains data to be inserted into mail merge fields. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored. |
mailMergeOptions | MailMergeOptions | Mail merge options. |
Examples
Shows how to do mail merge operation from a DataRow and save result to images.
// There is a several ways to do mail merge operation from a DataRow:
string doc = MyDir + "Mail merge.doc";
DataTable dataTable = new DataTable();
dataTable.Columns.Add("FirstName");
dataTable.Columns.Add("Location");
dataTable.Columns.Add("SpecialCharsInName()");
DataRow dataRow = dataTable.Rows.Add(new string[] { "James Bond", "London", "Classified" });
Stream[] images = MailMerger.ExecuteToImages(doc, new ImageSaveOptions(SaveFormat.Png), dataRow);
images = MailMerger.ExecuteToImages(doc, new ImageSaveOptions(SaveFormat.Png), dataRow, new MailMergeOptions() { TrimWhitespaces = true });
See Also
- class ImageSaveOptions
- class MailMergeOptions
- class MailMerger
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
ExecuteToImages(Stream, ImageSaveOptions, DataRow, MailMergeOptions)
Performs mail merge from a DataRow into the document and renders the result to images.
public static Stream[] ExecuteToImages(Stream inputStream, ImageSaveOptions saveOptions,
DataRow dataRow, MailMergeOptions mailMergeOptions = null)
Parameter | Type | Description |
---|---|---|
inputStream | Stream | The input file stream. |
saveOptions | ImageSaveOptions | The output’s save options. |
dataRow | DataRow | Row that contains data to be inserted into mail merge fields. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored. |
mailMergeOptions | MailMergeOptions | Mail merge options. |
Examples
Shows how to do mail merge operation from a DataRow using documents from the stream and save result to images.
// There is a several ways to do mail merge operation from a DataRow using documents from the stream:
DataTable dataTable = new DataTable();
dataTable.Columns.Add("FirstName");
dataTable.Columns.Add("Location");
dataTable.Columns.Add("SpecialCharsInName()");
DataRow dataRow = dataTable.Rows.Add(new string[] { "James Bond", "London", "Classified" });
using (FileStream streamIn = new FileStream(MyDir + "Mail merge.doc", FileMode.Open, FileAccess.Read))
{
Stream[] images = MailMerger.ExecuteToImages(streamIn, new ImageSaveOptions(SaveFormat.Png), dataRow);
images = MailMerger.ExecuteToImages(streamIn, new ImageSaveOptions(SaveFormat.Png), dataRow, new MailMergeOptions() { TrimWhitespaces = true });
}
See Also
- class ImageSaveOptions
- class MailMergeOptions
- class MailMerger
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
ExecuteToImages(string, ImageSaveOptions, DataTable, MailMergeOptions)
Performs mail merge from a DataRow into the document and renders the result to images.
public static Stream[] ExecuteToImages(string inputFileName, ImageSaveOptions saveOptions,
DataTable dataTable, MailMergeOptions mailMergeOptions = null)
Parameter | Type | Description |
---|---|---|
inputFileName | String | The input file name. |
saveOptions | ImageSaveOptions | The output’s save options. |
dataTable | DataTable | Table that contains data to be inserted into mail merge fields. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored. |
mailMergeOptions | MailMergeOptions | Mail merge options. |
Examples
Shows how to do mail merge operation from a DataTable and save result to images.
// There is a several ways to do mail merge operation from a DataTable:
string doc = MyDir + "Mail merge.doc";
DataTable dataTable = new DataTable();
dataTable.Columns.Add("FirstName");
dataTable.Columns.Add("Location");
dataTable.Columns.Add("SpecialCharsInName()");
DataRow dataRow = dataTable.Rows.Add(new string[] { "James Bond", "London", "Classified" });
Stream[] images = MailMerger.ExecuteToImages(doc, new ImageSaveOptions(SaveFormat.Png), dataTable);
images = MailMerger.ExecuteToImages(doc, new ImageSaveOptions(SaveFormat.Png), dataTable, new MailMergeOptions() { TrimWhitespaces = true });
See Also
- class ImageSaveOptions
- class MailMergeOptions
- class MailMerger
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
ExecuteToImages(Stream, ImageSaveOptions, DataTable, MailMergeOptions)
Performs mail merge from a DataRow into the document and renders the result to images.
public static Stream[] ExecuteToImages(Stream inputStream, ImageSaveOptions saveOptions,
DataTable dataTable, MailMergeOptions mailMergeOptions = null)
Parameter | Type | Description |
---|---|---|
inputStream | Stream | The input file stream. |
saveOptions | ImageSaveOptions | The output’s save options. |
dataTable | DataTable | Table that contains data to be inserted into mail merge fields. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored. |
mailMergeOptions | MailMergeOptions | Mail merge options. |
Examples
Shows how to do mail merge operation from a DataTable using documents from the stream and save to images.
// There is a several ways to do mail merge operation from a DataTable using documents from the stream and save result to images:
DataTable dataTable = new DataTable();
dataTable.Columns.Add("FirstName");
dataTable.Columns.Add("Location");
dataTable.Columns.Add("SpecialCharsInName()");
DataRow dataRow = dataTable.Rows.Add(new string[] { "James Bond", "London", "Classified" });
using (FileStream streamIn = new FileStream(MyDir + "Mail merge.doc", FileMode.Open, FileAccess.Read))
{
Stream[] images = MailMerger.ExecuteToImages(streamIn, new ImageSaveOptions(SaveFormat.Png), dataTable);
images = MailMerger.ExecuteToImages(streamIn, new ImageSaveOptions(SaveFormat.Png), dataTable, new MailMergeOptions() { TrimWhitespaces = true });
}
See Also
- class ImageSaveOptions
- class MailMergeOptions
- class MailMerger
- namespace Aspose.Words.LowCode
- assembly Aspose.Words