Hi,
Thanks for your interest in Aspose.Words and sorry for the delayed response. I am glad to inform you that you can easily achieve all three of your requirements by using Aspose.Words.
1) Please see the following code that demonstrate how to mail merge HTML data into a document:
public void
MailMergeInsertHtml()
{
Document doc = new
Document(MyDir + "MailMerge.InsertHtml.doc");
// Add a handler for the MergeField event.
doc.MailMerge.FieldMergingCallback = new
HandleMergeFieldInsertHtml();
// Load some Html from file.
StreamReader sr = File.OpenText(MyDir
+ "MailMerge.HtmlData.html");
string htmltext = sr.ReadToEnd();
sr.Close();
// Execute mail merge.
doc.MailMerge.Execute(new string[] { "htmlField1"
}, new string[]
{ htmltext });
// Save resulting document with a new name.
doc.Save(MyDir + "MailMerge.InsertHtml
Out.doc");
}
private class HandleMergeFieldInsertHtml : IFieldMergingCallback
{
///
/// This is called when
merge field is actually merged with data in the document.
///
void IFieldMergingCallback.FieldMerging(FieldMergingArgs e)
{
// All merge fields that expect HTML data should be marked
with some prefix, e.g. 'html'.
if (e.DocumentFieldName.StartsWith("html"))
{
// Insert the text for this merge field as HTML data, using
DocumentBuilder.
DocumentBuilder builder = new
DocumentBuilder(e.Document);
builder.MoveToMergeField(e.DocumentFieldName);
builder.InsertHtml((string)e.FieldValue);
// The HTML text itself should not be inserted.
// We have already inserted it as an HTML.
e.Text = "";
}
}
void IFieldMergingCallback.ImageFieldMerging(ImageFieldMergingArgs e)
{
// Do nothing.
}
}
2) Sure, Aspose.Words automatically downloads the image before inserting into the document if you specify a remote URL in 'src' attribute of
![]()
in Html. Therefore, Aspose.Words supports importing images from
![]()
element and the output Word document will contain the images .
3) Please refer to the following article of the documentation which outlines everything you need to know about Headers/Footers:
If we can help you with anything else, please feel free to ask.
Best regards,