SaveFormat

XlsxSaveOptions.SaveFormat property

指定如果使用此保存选项对象,文档将以哪种格式保存。 只能是Xlsx.

public override SaveFormat SaveFormat { get; set; }

例子

展示如何压缩 XLSX 文档。

Document doc = new Document(MyDir + "Shape with linked chart.docx");

XlsxSaveOptions xlsxSaveOptions = new XlsxSaveOptions();
xlsxSaveOptions.CompressionLevel = CompressionLevel.Maximum;
xlsxSaveOptions.SaveFormat = SaveFormat.Xlsx;

doc.Save(ArtifactsDir + "XlsxSaveOptions.CompressXlsx.xlsx", xlsxSaveOptions);

也可以看看