I am trying to insert image and text on the first page of the document, but its inserting on all the pages.
The code i am using is
Document doc = new Document(inFileName);
DocumentBuilder builder = new DocumentBuilder(doc);
builder.MoveToHeaderFooter(HeaderFooterType.HeaderPrimary);
Shape shape = builder.InsertImage("D:\\stamp.bmp");
shape.RelativeHorizontalPosition = RelativeHorizontalPosition.RightMargin;
shape.HorizontalAlignment = HorizontalAlignment.Right;
shape.RelativeVerticalPosition = RelativeVerticalPosition.TopMargin;
shape.VerticalAlignment = VerticalAlignment.Top;
Aspose.Words.Font font = builder.Font;
font.Size = 14;
font.Bold = true;
font.Color = Color.Blue;
font.Name = "Arial";
builder.Write("TrnasID:123\nDate:" + DateTime.Today.ToString());
ParagraphFormat paragraphFormat = builder.ParagraphFormat;
paragraphFormat.FirstLineIndent = 8;
paragraphFormat.Alignment = ParagraphAlignment.Justify;
paragraphFormat.KeepTogether = true;
builder.Writeln("\nA whole paragraph.");
doc.Save(outFileName);
Can you please correct me, where i am wrong?
Thanks in advance.
regards
Vijay.