製品比較

IronPDFとDocraptor - 詳細な比較

更新済み 3月 22, 2022
共有:

1. 序論

HTMLサイトを他の形式に変換したい場合は、ここが最適です。 この記事では、HTML、CSS、JS を PDF に変換する方法について説明します。 今日では、すべてが技術ベースとなっており、これらの技術を設計する人々には時間を節約できるソリューションが必要です。そして、そのソリューションの一つが、最も使用されているプログラミング言語の一つである.NETのC#です。 C#でPDFファイルを扱い、操作する従来の方法は複雑で時間がかかります。 PDFファイルの最も一般的な用途は次のとおりです:

  • PDFレンダリング
  • HTMLからPDF生成

    これらのPDF変換を処理し、発生する問題に対処するために多くのツールが開発されました。この記事では、開発者の間で最も高く評価されているC#ライブラリの中から二つのPDF変換ライブラリを比較します。 関連するツールは次のとおりです:

    ドックラプター

    IronPDF

    2. IronPDF

IronPDF は、PDF ファイルの生成と操作を簡素化するための強力なライブラリです。プログラマーは、C#、VB.NET、および ASP.NET を使用してソースコードから直接 PDF ドキュメントを生成、編集、および署名できます。IronPDF では、HTML、CSS、JavaScript をサポートしており、ウェブページを忠実に PDF に変換できます。また、既存の PDF を読み取って編集することが可能で、複数のドキュメントをマージしたり、ページを抽出したりする機能も備えています。

特長:

  • 高性能な PDF 生成
  • HTML から PDF への変換
  • PDF の編集と署名
  • 複数の PDF のマージとページの抽出
  • 読みやすい API と豊富なドキュメント

IronPDF は、PDF 操作の複雑さを解消し、開発者が短時間で高品質な PDF ソリューションを提供する手助けをします。

IronPDFは、.NETおよび.NET Core開発におけるHTMLサイト変換のための理想的なツールです。 それはHTMLを変換するだけでなく、他にも多くの機能を提供します。 .NET Coreおよびフレームワークプロジェクト内で、IronPDFは開発者がPDFドキュメントを生成、修正、および抽出することを可能にします。 開発者は、IronPDFライブラリを使用してHTMLドキュメントから素早くPDFを作成または変換することができます。

IronPDFは、PDFファイルから情報を自動的に読み取り、それを.NETアプリやデータストレージシステムに注入することができます。 古いPDFドキュメントストレージからのコンテンツを、ドキュメント管理や業務プロセスアプリケーションにインポート、移行、およびインデックス化することができます。

2.1. IronPDFの機能

2.1.1. PDF変換

この機能には、HTML、HTML文字列、MVCビュー、Webフォーム、およびURLなどの異なる形式からのPDF作成が含まれます。

2.1.2. PDF 画像処理

これにより、ユーザーはPDFから画像を作成することが可能です。 PDFを作成 画像から。 以下を含みます:画像抽出、さまざまな画像拡張のサポート、およびPDF印刷。

2.1.3. PDF ファイル IO

IronPDFは、PDFに対する128ビット暗号化、パスワードによるPDFのロック、そしてPDFのデジタル署名の機能も提供します。

2.1.4. PDFの編集

IronPDF のこの機能は、透かしの追加、ページの追加・削除、背景、前景など、あらゆる種類のPDFフォーマットを提供します。 要するに、IronPDFはPDFに関するあらゆることを提供します。

2.1.5. PDFコンテンツの抽出

多くの場合、PDF から直接埋め込まれたテキストを抽出することができます。 それでもうまくいかない場合、おそらくリーダーは画像に埋め込まれている可能性があります。 IronOCRライブラリを使用して、プレーンテキストではなく視覚的なテキストを文書からスキャンします。

2.1.6. ヘッダーとフッター

ヘッダーとフッターは、PDFが作成されたときや既存のPDFに追加されるときに追加できます。 Print Optionsプロパティにより、各ドキュメントページにヘッダーとフッターを作成することができます。 Chrome PDF Rendererオブジェクトでこれらのオプションにアクセスします。 このサンプルは、.NET Core コンソールアプリケーション内で動作します。

2.1.7. 互換性

IronPDFは、C#と互換性のあるほぼすべてのオペレーティングシステムおよびフレームワークをサポートします。

  • サポート: Windows, Azure

    • .NET Core 2.1、3.0、3.1、.NET 6 & 5

      • ユニバーサル互換性のための.NET Standard 2.0準拠

        + Azure (アジュール) 
      • AWS

      • ドッカー

      • Linux (リナックス)

3. DocRaptor (ドックラプター)

DocRaptorはドキュメント変換のためのプロフェッショナルなソリューションですが、IronPDFとは異なり、複数のプログラミング辞書に対する機能が限られています。 それはAPIベースのツールであり、あらゆる言語と統合することができます。 それは高品質であり、迅速であるため、時間を節約できます。また、XMLファイルをXLSXに変換する機能も提供します。

DocRaptorは、あなたのドキュメントをホスティングするサービスを提供します。 CSSおよびJSのサポートがあります。 これらは、独自のサーバーを持っていない中小企業にとって優れた機能です。

3.1. DocRaptorの特長

3.1.1. HTMLをPDFに変換

DocRaptorは、HTML、CSS、JSをPDFに変換し、XLSドキュメントを迅速かつ簡単に生成します。 HTMLコンテンツおよび必要な引数を、フォームエンコードされたテキストまたはJSONオブジェクトとしてDocs APIに投稿してください。

3.1.2 HTMLをExcelフォーマットへ

多くのレポートおよびデータエクスポートには、PDFとExcelの両方のサポートが必要です。 DocRaptorのHTMLベースのツールはこれを簡単にします。!

3.1.3. ドキュメントホスティング

ドキュメントはブランド名のないURLに保存され、どこからでも誰でもアクセスできるようになります。 あなたはそれを無期限に保持することも、特定の日付後やダウンロード数に達した後に削除することもできます。

注意:

以下のデータによると NuGet ウェブサイト、IronPDFはDocRaptorより人気があり、総ダウンロード数は3.0Mで、1日の平均ダウンロード数は1.3Kです。 一方、DocRaptorは、合計114.9Kダウンロードされており、1日あたりの平均ダウンロード数は51件です。

Visual Studioで新しいプロジェクトを作成する

Visual Studioソフトウェアを開き、[ファイル]メニューに移動します。 「新しいプロジェクト」を選択し、次に「コンソール アプリケーション」を選択してください。 この記事では、コンソールアプリケーションを使用してPDFドキュメントを生成します。

プロジェクト名を入力し、適切なテキストボックスにパスを選択してください。 次に、「Create」ボタンをクリックしてください。 以下のスクリーンショットのように、必要な.NETフレームワークを選択してください:

Visual Studio プロジェクトは、選択されたアプリケーションの構造を生成します。コンソール、Windows、およびWebアプリケーションを選択した場合、コードを入力し、アプリケーションをビルド/実行できる program.cs ファイルが開かれます。

ライブラリを追加して、プログラムをテストすることができます。

5. IronPDFライブラリをインストールする

IronPDFライブラリは、4つの異なる方法でダウンロードおよびインストールできます。 これらは:

  • Visual Studio NuGet パッケージ マネージャーを使用する
  • Visual Studio コマンドラインの使用。
  • NuGetウェブページからの直接ダウンロード。
  • IronPDFのウェブページから直接ダウンロード。

5.1 Visual Studio NuGet パッケージ マネージャーの使用

Visual Studioソフトウェアは、ソリューションにパッケージを直接インストールするためのNuGetパッケージマネージャーオプションを提供します。 以下のスクリーンショットは、NuGetパッケージマネージャーの開き方を示しています。

検索ボックスを提供して、NuGetサイトから利用可能なパッケージライブラリのリストを表示します。パッケージマネージャーで、「IronPDF」というキーワードを検索する必要があります。下のスクリーンショットのように:

上記の画像から、関連するパッケージの検索リストを取得します。IronPDFオプションを選択し、ソリューションにパッケージをインストールする必要があります。

5.2 Visual Studio コマンドラインの使用

  • Visual Studio メニューで、[ツール]私が翻訳するための特定のコンテンツを提供してください。 [NuGet パッケージ マネージャー]私が翻訳するための特定のコンテンツを提供してください。 [パッケージ マネージャー コンソール] に移動します。
  • パッケージマネージャー コンソール タブに次の行を入力してください:
Install-Package IronPdf

現在、パッケージは現在のプロジェクトにダウンロード/インストールされ、使用できるようになります。

5.3 NuGetウェブページからの直接ダウンロード

3つ目の方法は、ウェブページから直接NuGetパッケージをダウンロードすることです。

  • 「リンクに移動」https://www.nuget.org/packages/IronPdf/"
  • 右側のメニューからダウンロードパッケージオプションを選択してください。
  • ダウンロードしたパッケージをダブルクリックします。 それは自動的にインストールされます。
  • ソリューションを再読み込みして、プロジェクトで使用を開始してください。

5.4 IronPDF のウェブページから直接ダウンロード

クリックしてください リンク ウェブページから最新のパッケージを直接ダウンロードするにはこちらをクリックしてください。 ダウンロード後、以下の手順に従ってパッケージをプロジェクトに追加してください。

  • ソリューションウィンドウからプロジェクトを右クリックします。
  • 次に、オプションのリファレンスを選択し、ダウンロードしたリファレンスの場所を参照してください。

  • 次に、「OK」をクリックしてリファレンスを追加します。

DocRaptor APIをインストールする

DocRaptorチームは、APIを統合するためのほぼすべての同じ方法を提供しています。 これらは:

  • Visual StudioのNuGetパッケージマネージャーを使用する。
  • Visual Studio NuGet パッケージ コンソールを使用する。
  • Visual Studio コマンドラインの使用。
  • NuGetウェブサイトから直接ダウンロード。

6.1 Visual Studio NuGet パッケージマネージャーの使用

先に説明したように、IronPDFの場合でも、NuGetパッケージマネージャーを開く手順は同じです。

パッケージマネージャーを開いた後、検索バーに「DocRaptor」と入力するだけです。

上記の画像が示すように、DocRaptorには3つの結果があります。 必要なオプションを選択してください。

6.2. Visual Studio NuGet パッケージ コンソールの使用

Visual Studioのメニューで、ツール -> NuGetパッケージマネージャー -> パッケージマネージャーコンソール に移動します。 パッケージ マネージャー コンソール タブに以下の行を入力してください: install-Package DocRaptor。 現在、パッケージは現在のプロジェクトにダウンロード/インストールされ、使用できるようになります。

6.3. NuGetサイトからの直接ダウンロード。

3つ目の方法は、ウェブページから直接NuGetパッケージをダウンロードすることです。

  • 次のリンクにアクセスしてください「https://www.nuget.org/packages/DocRaptor/申し訳ありませんが、翻訳するための具体的なテキストが提供されていません。翻訳するコンテンツを提供していただければ、日本語に翻訳いたします。
  • 右側のメニューからダウンロードパッケージオプションを選択してください。
  • ダウンロードしたパッケージをダブルクリックします。 それは自動的にインストールされます。
  • 次に、ソリューションをリロードして、プロジェクトで使用を開始します。

HTMLからPDFを作成する

両方のツールにはHTML変換の機能が含まれていますが、それぞれ少し異なる方法で実行されます。

7.1. IronPDFを使用してHTMLからPDFを作成する

IronPDF を使用したページ変換は JSON や暗号化技術を使用する必要がなく、実際には非常に簡単です。 IronPDFは多くの異なる方法を可能にします。 例えば:

  • HTMLファイルをPDFへ
var Renderer = new IronPdf.ChromePdfRenderer();
Renderer.RenderHtmlAsPdf("<h1>Html with CSS and Images</h1>").SaveAs("pixel-perfect.pdf");
var Renderer = new IronPdf.ChromePdfRenderer();
Renderer.RenderHtmlAsPdf("<h1>Html with CSS and Images</h1>").SaveAs("pixel-perfect.pdf");
Dim Renderer = New IronPdf.ChromePdfRenderer()
Renderer.RenderHtmlAsPdf("<h1>Html with CSS and Images</h1>").SaveAs("pixel-perfect.pdf")
VB   C#
  • URLをPDFに変換
IronPdf.ChromePdfRenderer Renderer = new IronPdf.ChromePdfRenderer();
var Pdf = Renderer.RenderUrlAsPdf("https://ironpdf.com/");

Pdf.SaveAs("url.pdf"); 
IronPdf.ChromePdfRenderer Renderer = new IronPdf.ChromePdfRenderer();
var Pdf = Renderer.RenderUrlAsPdf("https://ironpdf.com/");

Pdf.SaveAs("url.pdf"); 
Dim Renderer As New IronPdf.ChromePdfRenderer()
Dim Pdf = Renderer.RenderUrlAsPdf("https://ironpdf.com/")

Pdf.SaveAs("url.pdf")
VB   C#
  • ASPXページをPDFに変換、その他多数。
private void Form1_Load(object sender, EventArgs e)
{

IronPdf.AspxToPdf.RenderThisPageAsPdf();
//Changes the ASPX output into a pdf instead of HTML

}
private void Form1_Load(object sender, EventArgs e)
{

IronPdf.AspxToPdf.RenderThisPageAsPdf();
//Changes the ASPX output into a pdf instead of HTML

}
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)

IronPdf.AspxToPdf.RenderThisPageAsPdf()
'Changes the ASPX output into a pdf instead of HTML

End Sub
VB   C#

7.2. DocRaptorを使用してHTMLからPDFを作成する

DocRaptorは、HTTP POSTリクエストを使用してJSONサポートを使用した変換を行いますが、URLおよびHTMLファイルをPDFに変換する機能のみを提供します。

using DocRaptor.Client;
using DocRaptor.Model;
using DocRaptor.Api;
using System.IO;
 class Example {
   tatic void Main(string [] args) {
    DocApi docraptor = new DocApi();
    docraptor.Configuration.Username = "YOUR_API_KEY_HERE";
     Doc doc = new Doc(
      test: true,
      //documentContent: System.IO.File.ReadAllText(@"custom-fonts-    content.html"),
        documentUrl: "http://www.docraptor.com/examples/invoice.html",
        name: "docraptor-csharp.pdf",
        documentType: Doc.DocumentTypeEnum.Pdf
      );
          yte [] createResponse = docraptor.CreateDoc(doc);
    }
using DocRaptor.Client;
using DocRaptor.Model;
using DocRaptor.Api;
using System.IO;
 class Example {
   tatic void Main(string [] args) {
    DocApi docraptor = new DocApi();
    docraptor.Configuration.Username = "YOUR_API_KEY_HERE";
     Doc doc = new Doc(
      test: true,
      //documentContent: System.IO.File.ReadAllText(@"custom-fonts-    content.html"),
        documentUrl: "http://www.docraptor.com/examples/invoice.html",
        name: "docraptor-csharp.pdf",
        documentType: Doc.DocumentTypeEnum.Pdf
      );
          yte [] createResponse = docraptor.CreateDoc(doc);
    }
Imports DocRaptor.Client
Imports DocRaptor.Model
Imports DocRaptor.Api
Imports System.IO
 Friend Class Example
   Private tatic Sub Main(ByVal args() As String)
	Dim docraptor As New DocApi()
	docraptor.Configuration.Username = "YOUR_API_KEY_HERE"
	 Dim doc As New Doc(test:= True, documentUrl:= "http://www.docraptor.com/examples/invoice.html", name:= "docraptor-csharp.pdf", documentType:= Doc.DocumentTypeEnum.Pdf)
		  Dim createResponse() As yte = docraptor.CreateDoc(doc)
   End Sub
VB   C#

PDFのフォーマット設定

IronPDFとDocRaptorの両方は、PDFのフォーマットをサポートしています。 しかし、IronPDFは単一ファイルのサポートを提供しますが、DocRaptorは複数ファイルのサポートを使用しています。

8.1. IronPDFを使用したフォーマット設定

出力PDFの期待される動作を確実にするために、この記事ではさまざまなフォーマットスタイルを使用しています。いくつかのスタイルについて説明し、DocRaptorと比較します。

  • カスタムフォント

    IronPDFは、素晴らしいGoogleフォント ライブラリを含むWebフォントをサポートしています。 これにより、開発者はシステムフォントに依存せずに、フォントの完全な制御を行うことができます。

using IronPdf;

ChromePdfRenderer myChromePdfRenderer = new IronPdf.ChromePdfRenderer();
var Renderer = new IronPdf.ChromePdfRenderer();

var html = @"<link href=""https://fonts.googleapis.com/css?family=Lobster""
rel=""stylesheet""><p style=""font-family: 'Lobster', serif; font-size:30px;"" > Hello Google Fonts</p>";

Renderer.RenderingOptions.RenderDelay = 500;
var doc = Renderer.RenderHtmlAsPdf(html);
doc.SaveAs("font.pdf");
using IronPdf;

ChromePdfRenderer myChromePdfRenderer = new IronPdf.ChromePdfRenderer();
var Renderer = new IronPdf.ChromePdfRenderer();

var html = @"<link href=""https://fonts.googleapis.com/css?family=Lobster""
rel=""stylesheet""><p style=""font-family: 'Lobster', serif; font-size:30px;"" > Hello Google Fonts</p>";

Renderer.RenderingOptions.RenderDelay = 500;
var doc = Renderer.RenderHtmlAsPdf(html);
doc.SaveAs("font.pdf");
Imports IronPdf

Private myChromePdfRenderer As ChromePdfRenderer = New IronPdf.ChromePdfRenderer()
Private Renderer = New IronPdf.ChromePdfRenderer()

Private html = "<link href=""https://fonts.googleapis.com/css?family=Lobster""
rel=""stylesheet""><p style=""font-family: 'Lobster', serif; font-size:30px;"" > Hello Google Fonts</p>"

Renderer.RenderingOptions.RenderDelay = 500
Dim doc = Renderer.RenderHtmlAsPdf(html)
doc.SaveAs("font.pdf")
VB   C#
  • ウォーターマーク

    IronPDF は、HTML を使用して PDF ドキュメントに「ウォーターマーク」を追加する方法を提供します。 透かしは既存のコンテンツの上または下にレンダリングするように設定でき、不透明度、回転、ハイパーリンクの組み込み機能を備えています。

using IronPdf;

// Stamps a watermark onto a new or existing PDF
IronPdf.ChromePdfRenderer Renderer = new IronPdf.ChromePdfRenderer();

var Pdf = Renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf");
Pdf.WatermarkAllPages("<h2 style='color:red'>SAMPLE</h2>",   ronPdf.Editing.WaterMarkLocation.MiddleCenter, 50, -45, "https://www.nuget.org/packages/IronPdf");
Pdf.SaveAs(@"C:\Path\To\Watermarked.pdf
using IronPdf;

// Stamps a watermark onto a new or existing PDF
IronPdf.ChromePdfRenderer Renderer = new IronPdf.ChromePdfRenderer();

var Pdf = Renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf");
Pdf.WatermarkAllPages("<h2 style='color:red'>SAMPLE</h2>",   ronPdf.Editing.WaterMarkLocation.MiddleCenter, 50, -45, "https://www.nuget.org/packages/IronPdf");
Pdf.SaveAs(@"C:\Path\To\Watermarked.pdf
Imports IronPdf

' Stamps a watermark onto a new or existing PDF
Private Renderer As New IronPdf.ChromePdfRenderer()

Private Pdf = Renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf")
Pdf.WatermarkAllPages("<h2 style='color:red'>SAMPLE</h2>", ronPdf.Editing.WaterMarkLocation.MiddleCenter, 50, -45, "https://www.nuget.org/packages/IronPdf")
'INSTANT VB TODO TASK: The following line uses invalid syntax:
'Pdf.SaveAs("TangibleTempVerbatimOpenTagC:\Path\To\Watermarked.pdf
VB   C#
  • ページ番号

    IronPDFの「Header and Footer」機能を使用すると、ページ番号に関する情報を統合することができます。

// PM> Install-Package IronPdf

using IronPdf;

var html = @"
<p> Hello Iron</p>
<p> This is 1st Page </p>
<div style = 'page-break-after: always;' ></div>
<p> This is 2nd Page</p>
<div style = 'page-break-after: always;' ></div>
<p> This is 3rd Page</p>";

var Renderer = new IronPdf.ChromePdfRenderer();

Renderer.RenderingOptions.HtmlFooter = new IronPdf.HtmlHeaderFooter()
{

    MaxHeight = 15, //millimeters
    HtmlFragment = "<center><i>{page} of {total-pages}<i></center>",
    DrawDividerLine = true
};

var pdfdoc = Renderer.RenderHtmlAsPdf(html);
pdfdoc.SaveAs("pageNumber.pdf");
// PM> Install-Package IronPdf

using IronPdf;

var html = @"
<p> Hello Iron</p>
<p> This is 1st Page </p>
<div style = 'page-break-after: always;' ></div>
<p> This is 2nd Page</p>
<div style = 'page-break-after: always;' ></div>
<p> This is 3rd Page</p>";

var Renderer = new IronPdf.ChromePdfRenderer();

Renderer.RenderingOptions.HtmlFooter = new IronPdf.HtmlHeaderFooter()
{

    MaxHeight = 15, //millimeters
    HtmlFragment = "<center><i>{page} of {total-pages}<i></center>",
    DrawDividerLine = true
};

var pdfdoc = Renderer.RenderHtmlAsPdf(html);
pdfdoc.SaveAs("pageNumber.pdf");
' PM> Install-Package IronPdf

Imports IronPdf

Private html = "
<p> Hello Iron</p>
<p> This is 1st Page </p>
<div style = 'page-break-after: always;' ></div>
<p> This is 2nd Page</p>
<div style = 'page-break-after: always;' ></div>
<p> This is 3rd Page</p>"

Private Renderer = New IronPdf.ChromePdfRenderer()

Renderer.RenderingOptions.HtmlFooter = New IronPdf.HtmlHeaderFooter() With {
	.MaxHeight = 15,
	.HtmlFragment = "<center><i>{page} of {total-pages}<i></center>",
	.DrawDividerLine = True
}

Dim pdfdoc = Renderer.RenderHtmlAsPdf(html)
pdfdoc.SaveAs("pageNumber.pdf")
VB   C#

8.2. DocRaptorを使用したフォーマット

DocRaptorは.NET APIでのPDFフォーマットをサポートしていますが、扱うのはかなり難しいです。 以下の三つのフォーマット例を確認しましょう。

  • カスタムフォント

    カスタムフォントはDocRaptorで簡単に使用できます。 標準的なウェブページと同じ方法で動作します。 以下にGoogleフォントを使用したCSSの例を示します:

    CSSコーディング:

@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 300;
  src: local('Open Sans Light'), local('OpenSans-Light'), url(http://themes.googleusercontent.com/static/fonts/opensans/v8/DXI1ORHCpsQm3Vp6mXoaTaRDOzjiPcYnFooOUGCOsRk.woff) format('woff');
}
p {
  font-family: Arial, Helvetica, sans-serif;
}
p.custom-font {
  font-family: 'Open Sans', sans-serif;
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 300;
  src: local('Open Sans Light'), local('OpenSans-Light'), url(http://themes.googleusercontent.com/static/fonts/opensans/v8/DXI1ORHCpsQm3Vp6mXoaTaRDOzjiPcYnFooOUGCOsRk.woff) format('woff');
}
p {
  font-family: Arial, Helvetica, sans-serif;
}
p.custom-font {
  font-family: 'Open Sans', sans-serif;
}
HTML

HTML コーディング:

<h2>Custom Fonts</h2>
<p>Hi, my name is Arial.</p>
<p class='custom-font'>I like to walk on the beach on warm Open Sans.</p>
<h2>Custom Fonts</h2>
<p>Hi, my name is Arial.</p>
<p class='custom-font'>I like to walk on the beach on warm Open Sans.</p>
HTML

C# コーディング:

class Example
{
    static void Main(string [] args)
    {
        DocApi docraptor = new DocApi();
        docraptor.Configuration.Username = "YOUR_API_KEY_HERE";
         try
        {
            Doc doc = new Doc(
                name: "custom-fonts",
                test: true, // test documents are free but watermarked
                documentContent: System.IO.File.ReadAllText(@"custom-fonts-content.html"), 
                 / documentUrl: "http://docraptor.com/examples/invoice.html", // or use a url
                documentType: Doc.DocumentTypeEnum.Pdf
                // javascript: false, // enables   rocessing
            );
             byte [] create_response = docraptor.CreateDoc(doc);
            File.WriteAllBytes("custom-fonts.pdf", create_response);
        } catch (DocRaptor.Client.ApiException error) {
            Console.Write(error.ErrorContent);
        }
    }
}
class Example
{
    static void Main(string [] args)
    {
        DocApi docraptor = new DocApi();
        docraptor.Configuration.Username = "YOUR_API_KEY_HERE";
         try
        {
            Doc doc = new Doc(
                name: "custom-fonts",
                test: true, // test documents are free but watermarked
                documentContent: System.IO.File.ReadAllText(@"custom-fonts-content.html"), 
                 / documentUrl: "http://docraptor.com/examples/invoice.html", // or use a url
                documentType: Doc.DocumentTypeEnum.Pdf
                // javascript: false, // enables   rocessing
            );
             byte [] create_response = docraptor.CreateDoc(doc);
            File.WriteAllBytes("custom-fonts.pdf", create_response);
        } catch (DocRaptor.Client.ApiException error) {
            Console.Write(error.ErrorContent);
        }
    }
}
Friend Class Example
	Shared Sub Main(ByVal args() As String)
		Dim docraptor As New DocApi()
		docraptor.Configuration.Username = "YOUR_API_KEY_HERE"
		 Try
			Dim doc As New Doc(name:= "custom-fonts", test:= True, documentContent:= System.IO.File.ReadAllText("custom-fonts-content.html"), / documentUrl:= "http://docraptor.com/examples/invoice.html", documentType:= Doc.DocumentTypeEnum.Pdf)
			 Dim create_response() As Byte = docraptor.CreateDoc(doc)
			File.WriteAllBytes("custom-fonts.pdf", create_response)
		Catch [error] As DocRaptor.Client.ApiException
			Console.Write([error].ErrorContent)
		End Try
	End Sub
End Class
VB   C#

出力

  • ウォーターマーク

    多くのPDFには透かしが見られることがあります。 幸いなことに、DocRaptorのHTML-PDFツールは、動的に生成される透かし入りドキュメントの作成を簡単にしてくれます。!

    CSSコーディング:

#watermark {
  flow: static(watermarkflow);
  font-size: 120px;
  opacity: 0.5;
  transform: rotate(-30deg);
  text-align: center;
}
#watermark {
  flow: static(watermarkflow);
  font-size: 120px;
  opacity: 0.5;
  transform: rotate(-30deg);
  text-align: center;
}
HTML

HTML コーディング:

<body><div id="watermark">PREVIEW</div>
<div style="page-break-after: always;">Page 1</div>
<div style="page-break-after: always;">Page 2</div>
<div style="page-break-after: always;">Page 3</div>
</body>
<body><div id="watermark">PREVIEW</div>
<div style="page-break-after: always;">Page 1</div>
<div style="page-break-after: always;">Page 2</div>
<div style="page-break-after: always;">Page 3</div>
</body>
HTML

C# コーディング:

class Example
{
    static void Main(string [] args)
    {
        DocApi docraptor = new DocApi();
        docraptor.Configuration.Username = "YOUR_API_KEY_HERE";

        try
        {
            Doc doc = new Doc(
                name: "text-based-watermark",
                test: false, // test documents are free but watermarked
                documentContent: System.IO.File.ReadAllText(@"text-based-watermark-content.html"), 
                // documentUrl: "http://docraptor.com/examples/invoice.html", // or use a url
                documentType: Doc.DocumentTypeEnum.Pdf
                // javascript: false, // enables processing
            );

            byte [] create_response = docraptor.CreateDoc(doc);
            File.WriteAllBytes("text-based-watermark.pdf", create_response);
        } catch (DocRaptor.Client.ApiException error) {
            Console.Write(error.ErrorContent);
        }
    }
class Example
{
    static void Main(string [] args)
    {
        DocApi docraptor = new DocApi();
        docraptor.Configuration.Username = "YOUR_API_KEY_HERE";

        try
        {
            Doc doc = new Doc(
                name: "text-based-watermark",
                test: false, // test documents are free but watermarked
                documentContent: System.IO.File.ReadAllText(@"text-based-watermark-content.html"), 
                // documentUrl: "http://docraptor.com/examples/invoice.html", // or use a url
                documentType: Doc.DocumentTypeEnum.Pdf
                // javascript: false, // enables processing
            );

            byte [] create_response = docraptor.CreateDoc(doc);
            File.WriteAllBytes("text-based-watermark.pdf", create_response);
        } catch (DocRaptor.Client.ApiException error) {
            Console.Write(error.ErrorContent);
        }
    }
Friend Class Example
	Shared Sub Main(ByVal args() As String)
		Dim docraptor As New DocApi()
		docraptor.Configuration.Username = "YOUR_API_KEY_HERE"

		Try
			Dim doc As New Doc(name:= "text-based-watermark", test:= False, documentContent:= System.IO.File.ReadAllText("text-based-watermark-content.html"), documentType:= Doc.DocumentTypeEnum.Pdf)

			Dim create_response() As Byte = docraptor.CreateDoc(doc)
			File.WriteAllBytes("text-based-watermark.pdf", create_response)
		Catch [error] As DocRaptor.Client.ApiException
			Console.Write([error].ErrorContent)
		End Try
	End Sub
VB   C#
  • ページ番号

    オープンソースのHTMLからPDFへのツールでは、PDFドキュメントにページ番号を追加することが難しく、場合によってはほとんど不可能ですが、DocRaptorを使用するとそれが非常に簡単になります。!

    CSSコーディング:

@page {
  @bottom {
    content: "Page " counter(page, upper-alpha) " of " counter(pages, decimal);
  } } 
@page {
  @bottom {
    content: "Page " counter(page, upper-alpha) " of " counter(pages, decimal);
  } } 
HTML

HTML コーディング:

<body>
<div style="page-break-after: always;">Page1</div>
<div style="page-break-after: always;">Page2</div>
<div style="page-break-after: always;">Page3</div>
<div id="page4" style="page-break-after: always;">Page4, with reset page counter</div>
</body>
<body>
<div style="page-break-after: always;">Page1</div>
<div style="page-break-after: always;">Page2</div>
<div style="page-break-after: always;">Page3</div>
<div id="page4" style="page-break-after: always;">Page4, with reset page counter</div>
</body>
HTML

C# コーディング:

class Example
{
    static void Main(string [] args)
    {
        DocApi docraptor = new DocApi();
        docraptor.Configuration.Username = "YOUR_API_KEY_HERE";

        try
        {
            Doc doc = new Doc(
                name: "page-numbers",
                test: true, // test documents are  but watermarked
                documentContent: System.IO.File.ReadAllText(@"page-numbers-content.html"), 
                // documentUrl: "http://docraptor.com/examples/invoice.html", // or use a url
                documentType: Doc.DocumentTypeEnum.Pdf
                // javascript: false, // enables processing
            );

            byte [] create_response = docraptor.CreateDoc(doc);
            File.WriteAllBytes("page-numbers.pdf", create_response);
        } catch (DocRaptor.Client.ApiException error) {
            Console.Write(error.ErrorContent);
        }
    }
}
class Example
{
    static void Main(string [] args)
    {
        DocApi docraptor = new DocApi();
        docraptor.Configuration.Username = "YOUR_API_KEY_HERE";

        try
        {
            Doc doc = new Doc(
                name: "page-numbers",
                test: true, // test documents are  but watermarked
                documentContent: System.IO.File.ReadAllText(@"page-numbers-content.html"), 
                // documentUrl: "http://docraptor.com/examples/invoice.html", // or use a url
                documentType: Doc.DocumentTypeEnum.Pdf
                // javascript: false, // enables processing
            );

            byte [] create_response = docraptor.CreateDoc(doc);
            File.WriteAllBytes("page-numbers.pdf", create_response);
        } catch (DocRaptor.Client.ApiException error) {
            Console.Write(error.ErrorContent);
        }
    }
}
Friend Class Example
	Shared Sub Main(ByVal args() As String)
		Dim docraptor As New DocApi()
		docraptor.Configuration.Username = "YOUR_API_KEY_HERE"

		Try
			Dim doc As New Doc(name:= "page-numbers", test:= True, documentContent:= System.IO.File.ReadAllText("page-numbers-content.html"), documentType:= Doc.DocumentTypeEnum.Pdf)

			Dim create_response() As Byte = docraptor.CreateDoc(doc)
			File.WriteAllBytes("page-numbers.pdf", create_response)
		Catch [error] As DocRaptor.Client.ApiException
			Console.Write([error].ErrorContent)
		End Try
	End Sub
End Class
VB   C#

翻訳された内容は以下の通りです:

  1. ライセンス

DocRaptorは、HTMLファイルやURLをPDFに変換するAPIベースのドキュメントコンバータであり、XMLをXLSXファイルに変換することもできます。 それは8つの異なるプログラミング言語をサポートしています。 ただし、これは月額ライセンスであり、ドキュメントの制限があります。無料ライセンスは月に5つのドキュメント制限から始まり、シルバーパッケージは40,000ドキュメント制限を含み、価格は月額1000ドルです。 DocRaptorは小規模な組織に最適で、325文書の制限がある小規模なプロフェッショナルパッケージを$29で提供しています。これをチェックしてください。 リンク より詳しい価格情報について。

注:

DocRaptorは、一度限りの購入またはプロジェクトベースのライセンスを提供していません。

IronPDFは、開発者ライセンスを無料で提供するライブラリです。 IronPDFには独特の価格構造もあります:Lite Bundleは、隠れた料金なしで$749から始まります。 SaaSやOEM製品の再配布も可能です。 すべてのライセンスには、30日間の返金保証、1年間のソフトウェアサポートおよびアップグレード、開発/ステージング/本番環境の有効性、そして永久ライセンスが含まれています。 (一回限りの購入). IronPDFの全価格構成とライセンスを見るには、次へ移動してください。 これ.

注:

IronPDFは、2つ以上のPDFを結合するオプションを提供します。 そのほか、ページの抽出、ページのコピー、特定のページの削除、マルチスレッドPDF生成のオプションも提供しており、競合他社では提供されていません。

10. まとめ

リモートサーバーから、IronPDFはHTMLをPDFに変換しません。 舞台裏では、標準に準拠したブラウザーのインスタンスを起動します。 (追加のソフトウェアをインストールする必要なしに). HTMLは完全に正確にレンダリングされ、商業印刷の最高基準に適したベクターフォーマットで提供されます。 結果は鮮明で高品質なPDFです。 ライセンスと価格情報はウェブページで簡単に入手できます。

DocRaptorは、多数のクラウドサーバー上で動作するため、最大限の正確性と最小限のダウンタイムでHTMLを任意の形式でPDFに変換します。 DocRaptorは、オンラインでPDF変換サービスを提供するWebベースのAPIです。DocRaptorのHTMLからPDFへのAPIは、サーバーサイドAPIクライアントライブラリのおかげで簡単に使用できます。 これらのライブラリは、いくつかの主要なサーバーサイドプログラミング言語で見つけることができます。 ウェブページには価格情報があります。

11. 結論

上記の記事では両方のツールを比較し、.NETまたはC#のドキュメント変換において、開発者は多くの理由からDocRaptorよりもIronPDFを好むという結論に達しました。 IronPDFはDocRaptorより多くの機能を提供します。 DocRaptorは小規模な組織にとって適したパッケージを提供していますが、価格が高く、長期的なライセンスは提供していません。 一方、IronPDFはより多くの機能を提供し、より低価格で一回限りの購入ライセンスを提供します。IronPDFは、小規模な組織と大規模なインフラを持つ組織の両方にとって好ましい選択です。 DocRaptorは、異なるサーバーサイド・プラットフォームでPDFを扱う際に便利です。 さらに、IronPDFパッケージは生涯ライセンスを提供しており、継続的なコストは発生しませんが、DocRaptorには継続的なコストがかかります。

< 以前
IronPDFとPDFCrowdの比較
次へ >
IronPDFとDynamicPDF - 包括的な比較

準備はできましたか? バージョン: 2024.9 新発売

無料のNuGetダウンロード 総ダウンロード数: 10,659,073 View Licenses >