删除Excel文件中工作表的现有打印设置

可能的使用场景

有时开发人员希望阻止Excel在保存XLSX文件时包含*.bin*格式的打印设置文件。打印设置文件位于*[文件"根"]\xl\printerSettings*下。本文说明了如何使用Aspose.Cells for Python via .NET API移除现有的打印设置。

删除Excel文件中工作表的现有打印设置

Aspose.Cells for Python via .NET允许您移除Excel文件中不同工作表的现有打印设置。以下示例代码说明了如何移除工作簿中所有工作表的现有打印设置。请参阅其示例Excel文件输出Excel文件、控制台输出以及屏幕截图进行参考。

屏幕截图

todo:image_alt_text

示例代码

控制台输出

 PrinterSettings of this worksheet exist.

Sheet Name: Sheet1

Paper Size: PaperLegal

Printer settings of this worksheet are now removed by setting it null.

PrinterSettings of this worksheet exist.

Sheet Name: Sheet2

Paper Size: PaperEnvelopeB5

Printer settings of this worksheet are now removed by setting it null.

PrinterSettings of this worksheet exist.

Sheet Name: Sheet3

Paper Size: PaperA6

Printer settings of this worksheet are now removed by setting it null.

PrinterSettings of this worksheet exist.

Sheet Name: Sheet4

Paper Size: PaperA3

Printer settings of this worksheet are now removed by setting it null.