Hi,
See the sample code for your needs, both footer picture and datetime are shown in the central footer section:
Sample code:
//Creating a string variable to store the url of the logo/picture
string logo_url = “e:\test\school.jpg”;
//Declaring a FileStream object
FileStream inFile;
//Declaring a byte array
byte[] binaryData;
//Creating the instance of the FileStream object to open the logo/picture in the stream
inFile = new System.IO.FileStream(logo_url, System.IO.FileMode.Open, System.IO.FileAccess.Read);
//Instantiating the byte array of FileStream object’s size
binaryData = new Byte[inFile.Length];
//Reads a block of bytes from the stream and writes data in a given buffer of byte array.
long bytesRead = inFile.Read(binaryData, 0, (int)inFile.Length);
Workbook workbook = new Workbook(“e:\test\Book1.xls”);
//Creating a PageSetup object to get the page settings of the first worksheet of the workbook
PageSetup pageSetup = workbook.Worksheets[0].PageSetup;
//Setting the logo/picture in the central section of the page footer
pageSetup.SetFooterPicture(1, binaryData);
//Setting the DateTime and Picture script
pageSetup.SetFooter(1, “&D&G”);
//Saving the workbook
workbook.Save(“e:\test2\footerpic_text.xls”);
//Closing the FileStream object
inFile.Close();
thank you.