Hi Support,
We are a licensed user of Aspose.Words 6.3.0.0 version. We are trying to insert images to word document using the Document builder classes available in Aspose.Words. On trying to insert Image in the Document we are only able to insert it into the First Page.Can you please help us in the same. Below is the requirement.
1.First page of the Document has to have 2 images.
2.2nd page of the Document is blank.
3.All pages following after the 2nd page need to have a single Image & that should get repeated itself for the rest of the pages.The image here is an small gif line used for OMR purposes by our Client.
Below is the code what we have used:
private void Button1_Click(object sender, System.EventArgs e)
{
string file = “C:\Inetpub\wwwroot\TestDoc\bin\Aspose.Words.lic”;
Aspose.Words.License license=new Aspose.Words.License();
license.SetLicense(file);
Aspose.Words.Document doc=new Aspose.Words.Document(“D:\NCMMIS\Templates1\Templates1\evc.doc”);
DocumentBuilder builder=new DocumentBuilder(doc);
//inserts Image at first Page
builder.InsertImage(“D:\NCMMIS\Templates1\Templates1\evc_files\image002.gif”,RelativeHorizontalPosition.Margin,Convert.ToDouble(TextBox1.Text),RelativeVerticalPosition.Margin,Convert.ToDouble(TextBox2.Text),Convert.ToDouble(TextBox3.Text),Convert.ToDouble(TextBox4.Text), WrapType.None);
//Trying to set the Position to insert images in 3rd and the next pages
builder.InsertImage(“D:\NCMMIS\Templates1\Templates1\evc_files\image002.gif”,RelativeHorizontalPosition.Margin,Convert.ToDouble(TextBox1.Text),RelativeVerticalPosition.Margin,Convert.ToDouble(TextBox2.Text),Convert.ToDouble(TextBox3.Text),Convert.ToDouble(TextBox4.Text), WrapType.None);
doc.Save(“D:\NCMMIS\Templates1\Templates1\evc.doc”,SaveFormat.Doc);
}
Also I have attached the sample Document in which we want to do Modifications.We are not creating a new document but using the existing document to place images in that.
Please help us in the above requirement as we need it at the urgent. Waiting for the Reply
Many Thanks in Advance.
Robin.