Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Aspose.Cells can extract text from the Gear Type SmartArt shape. In order to do so, you should first convert the SmartArt shape to a GroupShape using the Shape.getResultOfSmartArt() method. Then you should get the array of all individual shapes forming the GroupShape using the GroupShape.getGroupedShapes() method. Finally, you can iterate over all individual shapes one by one in a loop and extract their text using the Shape.getText() method.
The following sample code loads the sample Excel file that contains a Gear Type SmartArt shape. It then extracts the text from its individual shapes as discussed above. Please see the console output of the code given below for reference.
const path = require("path");
const AsposeCells = require("aspose.cells.node");
// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
const filePath = path.join(dataDir, "sampleExtractTextFromGearTypeSmartArtShape.xlsx");
// Load sample Excel file containing Gear Type SmartArt shape.
const workbook = new AsposeCells.Workbook(filePath);
// Access first worksheet.
const worksheet = workbook.getWorksheets().get(0);
// Access first shape.
const shape = worksheet.getShapes().get(0);
// Get the result of the Gear Type SmartArt shape in the form of a GroupShape.
const groupShape = shape.getResultOfSmartArt();
// Get the list of individual shapes that make up the GroupShape.
const shapes = groupShape.getGroupedShapes();
// Extract the text of Gear Type shapes and print them on the console.
for (let i = 0; i < shapes.length; i++) {
const s = shapes[i];
if (s.getType() === AsposeCells.AutoShapeType.Gear9 ||
s.getType() === AsposeCells.AutoShapeType.Gear6) {
console.log("Gear Type Shape Text: " + s.getText());
}
}
Gear Type Shape Text: Nice
Gear Type Shape Text: Good
Gear Type Shape Text: Excellent
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.