Filtering the kind of data while loading the workbook from template file with Node.js via C++
The following sample code loads only shape objects while loading the workbook from the template file which you can download from the given link. The following screenshot shows the template file contents and also explains that the data in Red color and Yellow background will not be loaded because LoadOptions.getLoadFilter() property has been set to Shape
The following screenshot shows the output PDF which you can download from the given link. Here you can see, the data in Red color and Yellow background is not present but all shapes are there.
const path = require("path");
const AsposeCells = require("aspose.cells.node");
// Source directory
const sourceDir = path.join(__dirname, "data");
// Output directory
const outputDir = path.join(__dirname, "output");
// Set the load options, we only want to load shapes and do not want to load data
const loadOptions = new AsposeCells.LoadOptions(AsposeCells.LoadFormat.Xlsx);
loadOptions.setLoadFilter(new AsposeCells.LoadFilter(AsposeCells.LoadDataFilterOptions.All & ~AsposeCells.LoadDataFilterOptions.Chart));
// Create workbook object from sample excel file using load options
const workbook = new AsposeCells.Workbook(path.join(sourceDir, "sampleFilterChars.xlsx"), loadOptions);
// Save the output in pdf format
workbook.save(outputDir + "sampleFilterChars_out.pdf", AsposeCells.SaveFormat.Pdf);