IronPrint (アイアンプリント)を始める

This article was translated from English: Does it need improvement?
Translated
View the article in English

アイアンプリント:.NET 用オールインワン印刷ライブラリ

**IronPrint(アイアンプリント)はIron Software(アイアンソフトウェア)によって開発されたプリントライブラリです。 ライブラリーは、Windows、macOS、Android、iOSなど、さまざまな環境に対応している。

互換性

IronPrintはクロスプラットフォームに対応しています:

.NET バージョンサポート

  • C#VB.netF#)
  • .NET 8、7、6、5、およびコア3.1以上

  • .NETフレームワーク (4.6.2+)

オペレーティング・システムと環境のサポート

  • **ウィンドウズ (7以上、サーバー2016以上)
  • **マックOS (10+)
  • iOS (11+)
  • アンドロイド API 21+ (v5 "ロリポップ")

.NET プロジェクトタイプのサポート

  • **モバイル (Xamarin & MAUI & アバロニア)
  • **デスクトップ (WPF & MAUI & Windows Avalonia)

  • **コンソール (アプリ&ライブラリー)

インストール

アイアンプリント・ライブラリ

IronPrint (アイアンプリント)のインストールは簡単です:

Install-Package IronPrint

または IronPrint NuGet公式ウェブサイト.

インストールが完了したら、C# (シーシャープ)コードの先頭にusing IronPrint;を追加することで始めることができる。

ライセンスキーの適用

次に、有効なライセンスキーまたはトライアルキーをLicenseクラスのLicenseKeyプロパティに割り当ててIronPrintに適用します。 IronPrint メソッドを使用する前に、importステートメントの直後に以下のコードを記述してください:

:path=/static-assets/print/content-code-examples/get-started/get-started-license.cs
IronPrint.License.LicenseKey = "IRONPRINT.MYLICENSE.KEY.1EF01";
IronPrint.License.LicenseKey = "IRONPRINT.MYLICENSE.KEY.1EF01"
VB   C#

コード例

ドキュメントを印刷

Print`メソッドにファイルパスを渡すだけで、ドキュメントが印刷される。

:path=/static-assets/print/content-code-examples/get-started/get-started-1.cs
using IronPrint;

// Print the document
Printer.Print("newDoc.pdf");
Imports IronPrint

' Print the document
Printer.Print("newDoc.pdf")
VB   C#

ダイアログを使用して印刷

ドキュメントを印刷するには、ShowPrintDialog メソッドを使用し、印刷前に印刷ダイアログを表示します。

:path=/static-assets/print/content-code-examples/get-started/get-started-2.cs
using IronPrint;

// Show print dialog
Printer.ShowPrintDialog("newDoc.pdf");
Imports IronPrint

' Show print dialog
Printer.ShowPrintDialog("newDoc.pdf")
VB   C#

印刷設定のカスタマイズ

コードから印刷設定を行うには、PrintSettingsクラスをインスタンス化します。 PrintSettingsオブジェクトを設定し、printメソッドの1つに渡します。

:path=/static-assets/print/content-code-examples/get-started/get-started-3.cs
using IronPrint;

// Configure print setting
PrintSettings printSettings = new PrintSettings();
printSettings.Dpi = 150;
printSettings.NumberOfCopies = 2;
printSettings.PaperOrientation = PaperOrientation.Portrait;

// Print the document
Printer.Print("newDoc.pdf", printSettings);
Imports IronPrint

' Configure print setting
Private printSettings As New PrintSettings()
printSettings.Dpi = 150
printSettings.NumberOfCopies = 2
printSettings.PaperOrientation = PaperOrientation.Portrait

' Print the document
Printer.Print("newDoc.pdf", printSettings)
VB   C#

ライセンスおよびサポート利用可能

IronPrintは有償のライブラリですが、無料のトライアルライセンスもあります。 これ.

Iron Software (アイアン・ソフトウェア)の詳細については、当社のウェブサイトをご覧ください:https://ironsoftware.com/ その他のサポートやお問い合わせは下記までお願いいたします。 私たちのチームにお問い合わせください.

アイアンソフトウェアのサポート

一般的なサポートや技術的なお問い合わせは、電子メールでご連絡ください:support@ironsoftware.com