IRONSOFTWAREHOME
Excel印刷設定
using IronXL;
using IronXL.Printing;

WorkBook workBook = WorkBook.Load("sample.xlsx");
WorkSheet workSheet = workBook.DefaultWorkSheet;

// Set the print header and footer of the worksheet
workSheet.Header.Center = "My document";
workSheet.Footer.Center = "Page &P of &N";

// Set the header margin
workSheet.PrintSetup.HeaderMargin = 2.33;

// Set the size of the paper
// Paper size enum represents different sizes of paper
workSheet.PrintSetup.PaperSize = PaperSize.B4;

// Set the print orientation of the worksheet
workSheet.PrintSetup.PrintOrientation = PrintOrientation.Portrait;

// Set black and white printing
workSheet.PrintSetup.NoColor = true;

workBook.SaveAs("PrintSetup.xlsx");
Imports IronXL
Imports IronXL.Printing

Dim workBook As WorkBook = WorkBook.Load("sample.xlsx")
Dim workSheet As WorkSheet = workBook.DefaultWorkSheet

' Set the print header and footer of the worksheet
workSheet.Header.Center = "My document"
workSheet.Footer.Center = "Page &P of &N"

' Set the header margin
workSheet.PrintSetup.HeaderMargin = 2.33

' Set the size of the paper
' Paper size enum represents different sizes of paper
workSheet.PrintSetup.PaperSize = PaperSize.B4

' Set the print orientation of the worksheet
workSheet.PrintSetup.PrintOrientation = PrintOrientation.Portrait

' Set black and white printing
workSheet.PrintSetup.NoColor = True

workBook.SaveAs("PrintSetup.xlsx")
NuGet Download
PM > Install-Package IronXL.Excel
Excel印刷設定

Excel印刷設定

IronXLのExcel印刷設定機能を使用すると、開発者は印刷や保存の前にExcelワークシートの印刷設定を簡単に構成できるようになります。 この機能は、特定の印刷フォーマットが必要なレポートや請求書、書類を生成する際に特に役立ちます。 開発者はページ番号やタイトル、その他の詳細などの動的コンテンツを含むカスタムヘッダーとフッターを設定し、プロフェッショナルな出力を保証できます。 PrintSetup オプションを使用すると、印刷の余白、用紙サイズ、方向を微調整することができ、さまざまなプリンターや用紙に文書を適応できます。

IronXLは、B4、A4、レターサイズなどの用紙サイズや方向(縦向きまたは横向き)を指定する能力を備えており、印刷される文書の外観を完全にコントロールできます。 さらに、白黒印刷に切り替えたり、カラーを無効にしたりする機能により、特にコスト効率の高い印刷シナリオに柔軟性を追加します。 この機能は、高品質の印刷出力用にExcelファイルを準備するプロセスを効率化します。

C# で Excel ワークシートを管理する方法について詳しく学ぶ
GitHubで見る

準備はできましたか?

Nuget Downloads 2,237,574バージョン:2026.9リリースされたばかり

Key in blue circle

無料の30日間トライアルキーをすぐに入手してください。

Your trial license will be sent to your email address

制限なし。100% ロック解除済み。クレジットカード不要。

bullet_checkedクレジットカードやアカウントの作成は不要です。制限なし。100% ロック解除済み。クレジットカード不要。
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
無料のライブデモを予約する
Booking Badge

世界中の数百万人のエンジニアから信頼されています。

ライセンスはより安く
義務のない相談を受ける
下記のフォームを記入するか、sales@ironsoftware.comにメールしてください。
あなたの詳細は常に守秘されます。
世界中の数百万人のエンジニアから信頼されています。
ライセンスはより安く
あなたの無料30日間の試用キーをすぐに入手。
クレジットカードやアカウントの作成は不要です。