const groupdocsWatermark = require('@groupdocs/groupdocs.watermark')
// 加载电子表格工作簿
const loadOptions = new groupdocsWatermark.SpreadsheetLoadOptions();
const watermarker = new groupdocsWatermark.Watermarker("source.xlsx", loadOptions);
// 获取标题栏目列表
const content = watermarker.getContent(groupdocsWatermark.SpreadsheetContent.class);
const sections = content.getWorksheets().get_Item(0).getHeadersFooters()
.getByOfficeHeaderFooterType(groupdocsWatermark.OfficeHeaderFooterType.HeaderPrimary).getSections();
// 从标题中删除水印
for (const section of sections.getInnerList().toArray()) {
section.setScript(null);
section.setImage(null);
}
// 保存已清除的工作簿
watermarker.save("result.xlsx");
watermarker.close();