Extract images (Ximage)
This feature may not be enabled for every tenant.
The legacy Type3 service type includes full support for this feature. Neuron only includes support for Ximage_metadata Base64 string images.
Spark can return mapped images as part of the API response. This can be useful for using Spark services to feed image elements to a front-end.
Map the images
Syntax: Ximage_<parameter>
Click on the target chart or image.
As described in Define a named range in Excel, use the Name Box to create a Name for the image. See a demonstration of this step here.
When creating the Name, use the noted prefix defined in the syntax.
The remaining steps are similar to Map the report.
After the service is uploaded to Spark, this can be tested in the API Tester.
In the API Tester, in the Field view, there will be a list of all the
Ximagesdefined in the workbook.There is a field that can be used to define the
FileNameparameter of the API request. This is used to customize the resulting filename.Submit the API request.
In the API response JSON view, the report object will include a link to the resulting image file.
Ximage does not support Excel 3D charts.
Return an image as a Base64 string
Syntax: Ximage_metadata.<parameter>
Images can be returned as a Base64 string. This can be easier to use than an attachment when integrating the API response to a front-end. This works when the image is defined as part of the Metadata subservice.
The mapping procedure is the same as Map the images.
Return Original file size images
Syntax: Ximageoriginal_<parameter> or Ximageoriginal_metadata.<parameter>
Ximage will return an image that has been resized based upon its dimensions in an Excel file. To return an image in its original quality and file size, use the alternative Ximageoriginal mapping.
The mapping procedure is the same as Map the images.
This functionality supports JPEG or PNG images but not Excel charts
You must also enable Do not compress images in file in Excel Options > Advanced.

Example of Ximage mapping
Ximage mappingThis service can be uploaded to Spark to use as a simple example.
Last updated
