Hi Siddesh,
In order to add Footer with three elements (Image, Text and page numbering), following code snippet can be used. However during my testing, I have observed that Image and text are appearing only on first page and page numbering information is not being displayed over first page. Whereas on subsequent pages, Image and text are not being added but only Page numbering information is being displayed. For the sake of correction, I have logged this problem as PDFNEWNET-38279 in our issue tracking system. We will further look into the details of this matter and will keep you posted on the status of correction. Please be patient and spare us little time.
As a workaround, you may consider using following code snippet to accomplish your requirement.
[C#]
Document doc = new Document(“c:/pdftest/16±+scheduling+order.pdf”);<o:p></o:p>
// Aspose.Pdf.HeaderFooter header = new
Aspose.Pdf.HeaderFooter();
Aspose.Pdf.HeaderFooter footer
= new
Aspose.Pdf.HeaderFooter();
//create
image stamp
ImageStamp imageStamp = new ImageStamp("c:/pdftest/logoSpin.png");
imageStamp.Height
= 50;
imageStamp.Width
= 50;
imageStamp.HorizontalAlignment
= Aspose.Pdf.HorizontalAlignment.Left;
//create
footer
TextStamp textStamp = new TextStamp("Footer Text");
//set
properties of the stamp
textStamp.BottomMargin
= 10;
textStamp.HorizontalAlignment
= Aspose.Pdf.HorizontalAlignment.Center;
textStamp.VerticalAlignment
= Aspose.Pdf.VerticalAlignment.Bottom;
//create
page number stamp
PageNumberStamp pageNumberStamp = new PageNumberStamp();
//whether
the stamp is background
pageNumberStamp.Background
= false;
pageNumberStamp.Format
= "Page # of " + doc.Pages.Count;
pageNumberStamp.BottomMargin
= 10;
pageNumberStamp.HorizontalAlignment
= Aspose.Pdf.HorizontalAlignment.Right;
pageNumberStamp.StartingNumber
= 1;
for (int cnt = 1; cnt <= doc.Pages.Count; cnt++)
{
doc.Pages[cnt].AddStamp(imageStamp);
doc.Pages[cnt].AddStamp(textStamp);
//add
stamp to particular page
doc.Pages[cnt].AddStamp(pageNumberStamp);
}
doc.Save(“c:/pdftest/FooterAdded_Output.pdf”);