使用Node.js通过C++隐藏叠加内容CrossHideRight,保存为HTML
Contents
[
Hide
]
可能的使用场景
将Excel文件保存为HTML时,可以为单元格字符串指定不同的交叉类型。默认情况下,Aspose.Cells会按Microsoft Excel生成HTML,但当更改交叉类型为CrossHideRight时,覆盖或与单元格字符串重叠的所有字符串将被隐藏。
在保存为Html时使用CrossHideRight隐藏重叠内容
以下示例代码加载示例Excel文件,并在将HtmlSaveOptions.getHtmlCrossStringType()设置为CrossHideRight后,将其保存为输出HTML。截图说明了CrossHideRight如何影响默认输出的HTML。
示例代码
const path = require("path");
const AsposeCells = require("aspose.cells.node");
// Load sample Excel file
const dataDir = path.join(__dirname, "data");
const filePath = path.join(dataDir, "sampleHidingOverlaidContentWithCrossHideRightWhileSavingToHtml.xlsx");
const workbook = new AsposeCells.Workbook(filePath);
// Specify HtmlSaveOptions - Hide Overlaid Content with CrossHideRight while saving to Html
const opts = new AsposeCells.HtmlSaveOptions();
opts.setHtmlCrossStringType(AsposeCells.HtmlCrossType.CrossHideRight);
// Save to HTML with HtmlSaveOptions
workbook.save(path.join(dataDir, "outputHidingOverlaidContentWithCrossHideRightWhileSavingToHtml.html"), opts);