Skip to content
Julian Halliwell edited this page Sep 20, 2021 · 2 revisions

Adds an image to a spreadsheet print footer.

setFooterImage( workbook=workbook, position, image ); // file path
setFooterImage( workbook=workbook, position, image, imageType ); // object

Required arguments

  • workbook spreadsheet object
  • position string where to place the image in the header. Possible values: left or l, center or centre or c, right or r
  • image EITHER string: absolute path to the image file, OR image object: a CFML image object
  • imageType (only required if image is a CFML image object): string: Possible values: dib, emf, jpeg, jpg, pict, png, wmf

Chainable? Yes.

Notes

  1. You can only add header and footer images to XLSX files (i.e. Microsoft's XML format).
  2. You cannot add header/footer images to an existing spreadsheet which already has one or more header/footer images.
  3. Images may only appear when using Microsoft Excel. They are not supported in LibreOffice or Google Sheets.

Example 1: Using an image file

spreadsheet = New spreadsheet();
workbook = spreadsheet.newXlsx();
path = "c:/temp/picture.png";
spreadsheet.setFooterImage( workbook, "centre", path );

Example 2: Using an image object

spreadsheet = New spreadsheet();
workbook = spreadsheet.newXlsx();
imageObject = ImageNew( "", 10, 10, "rgb", "blue" );
spreadsheet.setFooterImage( workbook, "left", imageObject, "png" );
Clone this wiki locally