Excel ファイルのワークシートの既存の PrinterSettings を削除する

考えられる使用シナリオ

開発者は、Excel が含まれないようにしたい場合があります。。置き場保存された XLSX ファイル内のプリンター設定のファイル。プリンター設定ファイルは次の場所にあります。「[ファイル「ルート」]\xl\printerSettings」.このドキュメントでは、Aspose.Cells API を使用して既存のプリンター設定を削除する方法について説明します。

Excel ファイルのワークシートの既存の PrinterSettings を削除する

Aspose.Cells を使用すると、Excel ファイル内の異なるシートに指定されている既存のプリンター設定を削除できます。次のサンプル コードは、ブック内のすべてのワークシートの既存のプリンター設定を削除する方法を示しています。ご覧くださいサンプル Excel ファイル, 出力エクセルファイル、コンソール出力、および参照用のスクリーンショット。

スクリーンショット

todo:画像_代替_文章

サンプルコード

コンソール出力

 PrinterSettings of this worksheet exist.

Sheet Name: Sheet1

Paper Size: 5

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

PrinterSettings of this worksheet exist.

Sheet Name: Sheet2

Paper Size: 34

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

PrinterSettings of this worksheet exist.

Sheet Name: Sheet3

Paper Size: 70

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

PrinterSettings of this worksheet exist.

Sheet Name: Sheet4

Paper Size: 8

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