SpreadsheetAddImage() not working
Hello, all,
I'm just playing around with something and wanted to see if I could insert an image into an Excel spreadsheet cell. I found SpreadsheetAddImage(), and I'm not having any luck with it. The image is a PNG file, 70 x 70 pixels in width and height.
<cfscript>
sObj = SpreadsheetNew("testing","true"); // This is for Excel 2013, not the older versions.
SpreadsheetSetCellValue(sObj,'Testing Image Insert',1,1);
SpreadsheetSetColumnWidth(sObj,1,75);
SpreadsheetSetRowHeight(sObj,2,75);
imgBytes = FileReadBinary("D:\site\images\emblem70x70.png");
SpreadsheetAddImage(sObj, imgBytes, 'png', '2,1,2,1');
<cfscript><cfheader name="Content-Disposition" value="attachment; filename=test.xlsx" />
<cfheader name="Content-Type" value="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
<cfcontent type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" variable="#spreadsheetReadBinary(sObj)#" reset="true" />
When I open the spreadsheet, the text is in A:1 as expected, but the image does not appear in B:1.
Any thoughts about this appreciated.
V/r,
^ _ ^
