產品比較

IronPDF 和 PDFShift 之間的比較

發佈 2022年9月25日
分享:

便攜式文件格式 (PDF)是最受歡迎的文件格式,可以在單個文件中表示文本、鏈接、按鈕、圖形等許多內容。若沒有使用 C# 的 PDF API,在 C# 編程語言中操作 PDF 幾乎是不可能的。在本文中,我們將探索如何使用兩種不同的 API 來交互和操作 PDF 文件,並比較這兩種 API 的性能、功能和許可。

本文中將討論的 PDF API 如下:

  • IronPDF
  • PDFShift

1. IronPDF

IronPDF 是一款強大的 HTML 至 PDF 轉換 API。IronPDF 是在 .NET 和 .NET Core 開發中轉換 HTML 網頁的理想解決方案。它不僅轉換 HTML,還具有多種額外功能。IronPDF 允許開發人員在 .NET Core 和 .NET Framework 項目中創建、修改和檢索 PDF 文件。使用 IronPDF 套件,開發人員可以輕鬆地從 HTML 網頁生成或更改 PDF。

PDF 可以輕鬆地編輯、加蓋印章,並添加頁眉和頁腳。它還使閱讀 PDF 文本和提取圖片變得非常簡單。IronPDF 使用 .NET Chromium 引擎將 HTML 網頁渲染為 PDF 文件。

1.1. IronPDF 功能

1.1.1. PDF 轉換

此功能包括從不同格式創建 PDF,例如 HTML、HTML 字串、MVC 視圖、Web 表單和 URL。

1.1.2. PDF 影像處理

這允許用戶從 PDF 創建圖像,並從圖像創建 PDF。它包括影像提取,支持不同的影像擴展名和 PDF 列印。

1.1.3. PDF 檔案 I/O

IronPDF 還提供 128 位元加密、密碼鎖定和數位簽名功能。

1.1.4. 編輯PDF

IronPDF的這項功能提供各種PDF格式化功能,例如添加水印、添加頁面、刪除頁面、添加背景、添加前景等。簡而言之,IronPDF提供了操縱PDF所需的所有功能。

1.1.5. PDF內容擷取

在許多情況下,您可以直接從PDF中擷取嵌入的文本。如果這樣做不起作用,您的文本很可能實際上嵌入在圖像中。使用IronOCR庫來掃描文件中的視覺文本,而不是純文本。

1.1.6. 頁首和頁尾

當創建 PDF 時或者 добав到現有的 PDFs 時,可以添加頁首和頁尾。Print Options 屬性允許你為每個文件頁面製作頁首和頁尾。可以在 Chrome PDF Renderer 對象中訪問這些選項。此範例在 .NET Core 控制台應用程式內部工作。

1.1.7. 相容性

IronPDF 支援幾乎所有與 C# 相容的作業系統和框架,包括以下內容:

  • Windows
  • Linux
  • .NET Core 2.1, 3.0, 3.1, .NET 6 和 5
  • 適用於通用相容性的 .NET Standard 2.0 規範
  • Microsoft Azure
  • Amazon Web Services (AWS)
  • Docker

2. PDFShift

PDFShift 是一款 HTML 到 PDF 轉換的 API 工具,能讓企業在幾秒鐘內將 HTML 頁面轉換為 PDF。透過雲端伺服器的 API 工具,支援平行轉換、非同步查詢、原始 HTML 支援等許多功能。PDFShift 是一個簡單易用的解決方案,支援多種開發語言,包括 Ruby、Python、JavaScript、Node 和 PHP,使轉換過程更加容易。

PDFShift 讓客戶可以設置自定義的頁首和頁尾,應用自定義的 CSS,加密文件等等,讓企業對其轉換有完全的控制權。

2.1. PDFShift 功能

2.1.1. 並行轉換

PDFShift 支持並行轉換,允許用戶一次轉換多個文檔以提高轉換速度。

2.1.2. 進階頁首和頁尾選項

建立自訂的頁首和頁尾,包含頁碼,使用自定義的CSS和JavaScript,加密你的文件等。

2.1.3. 原始 HTML 數據轉換為 PDF 介面

PDFShift 支持將原始 HTML 轉換為 PDF,而無需將頁面公開。

2.1.4. 高精度 PDF

PDFShift 在數秒鐘內將 HTML 轉換為高保真 PDF 文件。

2.1.5. 異步請求

要在轉換完成時收到通知,請使用我們先進的實時系統。使用強大的 PDFShift API 將 HTML 轉換為 PDF,僅需三行代碼即可整合系統。

3. 在 Visual Studio 中建立新專案

打開 Visual Studio 軟體並進入「檔案」選單。選擇「新專案」,然後選擇主控台應用程式。在本文中,我們將使用主控台應用程式來生成 PDF 文件。

在適當的文本框中輸入專案名稱並選擇路徑。然後,點擊建立按鈕。選擇所需的 .NET 框架,如下圖所示:

Visual Studio 專案現在將為所選應用程式生成結構,如果您選擇了控制台、Windows 和 Web 應用程式,它將打開 program.cs 檔案,您可以在其中輸入程式碼並建構/運行應用程式。

現在我們可以添加庫並測試程序。

4. 安裝 IronPDF 程式庫

IronPDF 程式庫可以透過四種不同的方式下載和安裝。這些方式是:

  • 使用 Visual Studio NuGet 套件管理器
  • 使用 Visual Studio 命令列
  • 從 NuGet 網頁直接下載
  • 從 IronPDF 網頁直接下載

4.1 使用 Visual Studio 的 NuGet 套件管理員

Visual Studio 軟體提供 NuGet 套件管理員選項,可以直接將套件安裝到解決方案中。下圖顯示了如何打開 NuGet 套件管理員。

它提供了一個搜尋框,以顯示來自NuGet網站的可用套件庫列表。在套件管理器中,我們需要搜尋關鍵字「IronPDF」,如下圖所示。

在上圖中,我們可以看到搜索結果中的相關套件列表。我們需要選擇IronPDF選項並將該套件安裝到我們的解決方案中。

4.2 使用 Visual Studio 指令程式

在 Visual Studio 的選單中,前往工具 > NuGet 套件管理員 > 套件管理員主控台

在套件管理器主控台標籤頁中輸入以下行:

Install-Package IronPdf

現在套件將下載/安裝到當前專案並準備好使用。

4.3 從NuGet網頁直接下載

第三種方式是直接從網頁下載NuGet包。

  • 移動到該鏈接 https://www.nuget.org/packages/IronPdf/
  • 從右側選單中選擇下載包選項。
  • 雙擊已下載的包,將自動安裝。
  • 現在重新加載方案並開始在項目中使用它。

4.4 從 IronPDF 網頁直接下載

點擊 連結 請在這裡直接從網頁下載最新的包。下載完成後,按照以下步驟將包添加到項目中。

  • 右鍵單擊解決方案窗口中的項目。
  • 然後,選擇引用選項並瀏覽已下載引用的位置。
  • 接著,單擊確定以添加引用。

5. PDFShift 運作

PDFShift 無法直接整合到專案中,而是以遠端方式運作。你需要使用 C# RestClient 套件向 PDFShift 的 API 提交 POST 請求,並將你的 API 金鑰作為簡單身份驗證的使用者參數。伺服器接收到你的請求後,會進行處理並回傳輸出文件,PDF 轉換 API 的工作是通過 HTTP POST 請求完成的。PDFShift 提供多種語言的 API,並為所有語言遠端工作。

6. 從 HTML 製作 PDF

這兩種工具都包含 HTML 轉換功能,但它們的實現方式稍有不同。

6.1. 使用 IronPDF 從 URL 建立 PDF

使用 URL 在 C# 中建立 PDF 檔案就像上述範例一樣簡單,只需這三行程式碼。以下程式碼將示範如何從 URL 建立 PDF 檔案。

using IronPdf;
var Renderer = new IronPdf.ChromePdfRenderer();
// Create a PDF from a URL or local file path
using var pdf = Renderer.RenderUrlAsPdf("https://www.amazon.com/?tag=hp2-brobookmark-us-20");
// Export to a file or Stream
pdf.SaveAs("url.pdf");
using IronPdf;
var Renderer = new IronPdf.ChromePdfRenderer();
// Create a PDF from a URL or local file path
using var pdf = Renderer.RenderUrlAsPdf("https://www.amazon.com/?tag=hp2-brobookmark-us-20");
// Export to a file or Stream
pdf.SaveAs("url.pdf");
Imports IronPdf
Private Renderer = New IronPdf.ChromePdfRenderer()
' Create a PDF from a URL or local file path
Private pdf = Renderer.RenderUrlAsPdf("https://www.amazon.com/?tag=hp2-brobookmark-us-20")
' Export to a file or Stream
pdf.SaveAs("url.pdf")
VB   C#

以下是上述程式碼的輸出。

6.2. 使用 IronPDF 將 HTML 轉換為 PDF

使用 IronPDF C# .NET 庫將 HTML 轉換為 PDF 相當容易。

var pdf = new ChromePdfRenderer();
PdfDocument doc = pdf.RenderHtmlAsPdf("<h1>This is a heading</h1>");
mypdf.SaveAs("FirstPDFDocument.pdf");
var pdf = new ChromePdfRenderer();
PdfDocument doc = pdf.RenderHtmlAsPdf("<h1>This is a heading</h1>");
mypdf.SaveAs("FirstPDFDocument.pdf");
Dim pdf = New ChromePdfRenderer()
Dim doc As PdfDocument = pdf.RenderHtmlAsPdf("<h1>This is a heading</h1>")
mypdf.SaveAs("FirstPDFDocument.pdf")
VB   C#

6.3. 使用 PDFShift 從 URL 創建 PDF

使用 PDFShift 轉換 URL 非常簡單。您所需的是發送一個 POST 請求,並將 source 參數設置為 URL,如下所示:

using System;
using RestSharp;
using Newtonsoft.Json;
using System.IO;
using RestSharp.Authenticators;
using RestSharp.Serialization;
using System.Net.Mail;
using System.Net;
using System.Collections.Generic;
using Newtonsoft.Json.Linq;

namespace PDFShiftExample
{
  class Program
  {
      static void Main(string [] args)
      {
          IRestClient client = new RestClient("https://api.pdfshift.io/v3/convert/pdf");
          client.Authenticator = new HttpBasicAuthenticator("api", "your_api_key");

          IRestRequest request = new RestRequest(Method.POST);

          var json = new
          {
              source = "https://www.example.com"
          };
          request.AddJsonBody(json);

          IRestResponse response = client.Execute(request);
          if (!response.IsSuccessful)
          {
              // Check why status is not int 2xx.
          }
          else
          {
              File.WriteAllBytes("result.pdf", response.RawBytes);
          }
      }
  }
}
using System;
using RestSharp;
using Newtonsoft.Json;
using System.IO;
using RestSharp.Authenticators;
using RestSharp.Serialization;
using System.Net.Mail;
using System.Net;
using System.Collections.Generic;
using Newtonsoft.Json.Linq;

namespace PDFShiftExample
{
  class Program
  {
      static void Main(string [] args)
      {
          IRestClient client = new RestClient("https://api.pdfshift.io/v3/convert/pdf");
          client.Authenticator = new HttpBasicAuthenticator("api", "your_api_key");

          IRestRequest request = new RestRequest(Method.POST);

          var json = new
          {
              source = "https://www.example.com"
          };
          request.AddJsonBody(json);

          IRestResponse response = client.Execute(request);
          if (!response.IsSuccessful)
          {
              // Check why status is not int 2xx.
          }
          else
          {
              File.WriteAllBytes("result.pdf", response.RawBytes);
          }
      }
  }
}
Imports System
Imports RestSharp
Imports Newtonsoft.Json
Imports System.IO
Imports RestSharp.Authenticators
Imports RestSharp.Serialization
Imports System.Net.Mail
Imports System.Net
Imports System.Collections.Generic
Imports Newtonsoft.Json.Linq

Namespace PDFShiftExample
  Friend Class Program
	  Shared Sub Main(ByVal args() As String)
		  Dim client As IRestClient = New RestClient("https://api.pdfshift.io/v3/convert/pdf")
		  client.Authenticator = New HttpBasicAuthenticator("api", "your_api_key")

		  Dim request As IRestRequest = New RestRequest(Method.POST)

		  Dim json = New With {Key .source = "https://www.example.com"}
		  request.AddJsonBody(json)

		  Dim response As IRestResponse = client.Execute(request)
		  If Not response.IsSuccessful Then
			  ' Check why status is not int 2xx.
		  Else
			  File.WriteAllBytes("result.pdf", response.RawBytes)
		  End If
	  End Sub
  End Class
End Namespace
VB   C#

6.4. 使用 PDFShift 將 HTML 轉換為 PDF

PDFShift 也提供 HTML 轉 PDF 直接轉換,但會從 HTML 文件中讀取 HTML 內容。

namespace PDFShiftExample
{
  class Program
  {
      static void Main(string [] args)
      {
          IRestClient client = new RestClient("https://api.pdfshift.io/v3/convert/pdf");
          client.Authenticator = new HttpBasicAuthenticator("api", "your_api_key");

          IRestRequest request = new RestRequest(Method.POST);

          string documentContent = File.ReadAllText("document.html");
          var json = new
          {
              source = documentContent
          };
          request.AddJsonBody(json);

          IRestResponse response = client.Execute(request);
          if (!response.IsSuccessful)
          {
              // Check why status is not int 2xx.
          }
          else
          {
              File.WriteAllBytes("result.pdf", response.RawBytes);
          }
      }
  }
}
namespace PDFShiftExample
{
  class Program
  {
      static void Main(string [] args)
      {
          IRestClient client = new RestClient("https://api.pdfshift.io/v3/convert/pdf");
          client.Authenticator = new HttpBasicAuthenticator("api", "your_api_key");

          IRestRequest request = new RestRequest(Method.POST);

          string documentContent = File.ReadAllText("document.html");
          var json = new
          {
              source = documentContent
          };
          request.AddJsonBody(json);

          IRestResponse response = client.Execute(request);
          if (!response.IsSuccessful)
          {
              // Check why status is not int 2xx.
          }
          else
          {
              File.WriteAllBytes("result.pdf", response.RawBytes);
          }
      }
  }
}
Namespace PDFShiftExample
  Friend Class Program
	  Shared Sub Main(ByVal args() As String)
		  Dim client As IRestClient = New RestClient("https://api.pdfshift.io/v3/convert/pdf")
		  client.Authenticator = New HttpBasicAuthenticator("api", "your_api_key")

		  Dim request As IRestRequest = New RestRequest(Method.POST)

		  Dim documentContent As String = File.ReadAllText("document.html")
		  Dim json = New With {Key .source = documentContent}
		  request.AddJsonBody(json)

		  Dim response As IRestResponse = client.Execute(request)
		  If Not response.IsSuccessful Then
			  ' Check why status is not int 2xx.
		  Else
			  File.WriteAllBytes("result.pdf", response.RawBytes)
		  End If
	  End Sub
  End Class
End Namespace
VB   C#

7. 自訂頁首和頁尾

在處理 PDF 時,添加頁首和頁尾是必不可少的。討論中的這兩個工具都支持這個選項。

7.1. 使用 IronPDF 自訂頁首和頁尾

使用 IronPDF 你可以通過兩種不同的方式添加頁首和頁尾。

TextHeaderFooter 允許添加基於文本的頁首,並可以選擇合併動態數據。

HtmlHeaderFooter 允許開發者將 HTML 頁首和頁尾渲染到 PDF 文件中,同時也允許動態數據的模板化。這種方式更靈活,但使用起來更困難。

using IronPdf;
var Renderer = new IronPdf.ChromePdfRenderer();
Renderer.RenderingOptions.FirstPageNumber = 1; // use 2 if a coverpage  will be appended
Renderer.RenderingOptions.TextHeader.DrawDividerLine = true;
Renderer.RenderingOptions.TextHeader.CenterText = "{url}";
Renderer.RenderingOptions.TextHeader.Font = IronPdf.Font.FontTypes.Helvetica;
Renderer.RenderingOptions.TextHeader.FontSize = 12;
using IronPdf;
var Renderer = new IronPdf.ChromePdfRenderer();
Renderer.RenderingOptions.FirstPageNumber = 1; // use 2 if a coverpage  will be appended
Renderer.RenderingOptions.TextHeader.DrawDividerLine = true;
Renderer.RenderingOptions.TextHeader.CenterText = "{url}";
Renderer.RenderingOptions.TextHeader.Font = IronPdf.Font.FontTypes.Helvetica;
Renderer.RenderingOptions.TextHeader.FontSize = 12;
Imports IronPdf
Private Renderer = New IronPdf.ChromePdfRenderer()
Renderer.RenderingOptions.FirstPageNumber = 1 ' use 2 if a coverpage  will be appended
Renderer.RenderingOptions.TextHeader.DrawDividerLine = True
Renderer.RenderingOptions.TextHeader.CenterText = "{url}"
Renderer.RenderingOptions.TextHeader.Font = IronPdf.Font.FontTypes.Helvetica
Renderer.RenderingOptions.TextHeader.FontSize = 12
VB   C#

7.2. 使用 PDFShift 自訂頁首和頁尾

您可以通過添加自訂頁首或頁尾來自訂生成的文檔。這些通常用於標識當前頁面或在每頁上顯示您公司的標誌。

using System;
using RestSharp;
using Newtonsoft.Json;
using System.IO;
using RestSharp.Authenticators;
using RestSharp.Serialization;
using System.Net.Mail;
using System.Net;
using System.Collections.Generic;
using Newtonsoft.Json.Linq;

namespace PDFShiftExample
{
  class Program
  {
      static void Main(string [] args)
      {
          IRestClient client = new RestClient("https://api.pdfshift.io/v3/convert/pdf");
          client.Authenticator = new HttpBasicAuthenticator("api", "your_api_key");

          IRestRequest request = new RestRequest(Method.POST);

          var json = new
          {
              source = "https://quillbot.com/",
              footer = new { source = "<div style=\"font-size: 12px\">Page {{page}} of {{total}}</div>", spacing = "50px" }
          };
          request.AddJsonBody(json);

          IRestResponse response = client.Execute(request);
          if (!response.IsSuccessful)
          {
              // Check why status is not int 2xx.
          }
          else
          {
              File.WriteAllBytes("result.pdf", response.RawBytes);
          }
      }
  }
}
using System;
using RestSharp;
using Newtonsoft.Json;
using System.IO;
using RestSharp.Authenticators;
using RestSharp.Serialization;
using System.Net.Mail;
using System.Net;
using System.Collections.Generic;
using Newtonsoft.Json.Linq;

namespace PDFShiftExample
{
  class Program
  {
      static void Main(string [] args)
      {
          IRestClient client = new RestClient("https://api.pdfshift.io/v3/convert/pdf");
          client.Authenticator = new HttpBasicAuthenticator("api", "your_api_key");

          IRestRequest request = new RestRequest(Method.POST);

          var json = new
          {
              source = "https://quillbot.com/",
              footer = new { source = "<div style=\"font-size: 12px\">Page {{page}} of {{total}}</div>", spacing = "50px" }
          };
          request.AddJsonBody(json);

          IRestResponse response = client.Execute(request);
          if (!response.IsSuccessful)
          {
              // Check why status is not int 2xx.
          }
          else
          {
              File.WriteAllBytes("result.pdf", response.RawBytes);
          }
      }
  }
}
Imports System
Imports RestSharp
Imports Newtonsoft.Json
Imports System.IO
Imports RestSharp.Authenticators
Imports RestSharp.Serialization
Imports System.Net.Mail
Imports System.Net
Imports System.Collections.Generic
Imports Newtonsoft.Json.Linq

Namespace PDFShiftExample
  Friend Class Program
	  Shared Sub Main(ByVal args() As String)
		  Dim client As IRestClient = New RestClient("https://api.pdfshift.io/v3/convert/pdf")
		  client.Authenticator = New HttpBasicAuthenticator("api", "your_api_key")

		  Dim request As IRestRequest = New RestRequest(Method.POST)

		  Dim json = New With {
			  Key .source = "https://quillbot.com/",
			  Key .footer = New With {
				  Key .source = "<div style=""font-size: 12px"">Page {{page}} of {{total}}</div>",
				  Key .spacing = "50px"
			  }
		  }
		  request.AddJsonBody(json)

		  Dim response As IRestResponse = client.Execute(request)
		  If Not response.IsSuccessful Then
			  ' Check why status is not int 2xx.
		  Else
			  File.WriteAllBytes("result.pdf", response.RawBytes)
		  End If
	  End Sub
  End Class
End Namespace
VB   C#

9. 水印

使用編程語言對 PDF 進行水印處理是一項相當困難的任務。IronPDF 和 PDFShift 都提供對 PDF 水印處理的支援。

9.1. 使用 IronPDF 添加水印

IronPDF 提供了使用 HTML 為 PDF 文件添加水印的方法。水印可以設置在現有內容的上方或下方渲染,並且具備內建的透明度、旋轉及超連結功能。

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

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

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

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

9.2. 使用 PDFShift 添加水印

用戶需要在 PDF 上明顯標識水印。

using System;
using RestSharp;
using Newtonsoft.Json;
using System.IO;
using RestSharp.Authenticators;
using RestSharp.Serialization;
using System.Net.Mail;
using System.Net;
using System.Collections.Generic;
using Newtonsoft.Json.Linq;

namespace PDFShiftExample
{
  class Program
  {
      static void Main(string [] args)
      {
          IRestClient client = new RestClient("https://api.pdfshift.io/v3/convert/pdf");
          client.Authenticator = new HttpBasicAuthenticator("api", "your_api_key");

          IRestRequest request = new RestRequest(Method.POST);

          var json = new
          {
              source = "https://www.example.com",
              watermark = new { image = "https://pdfshift-dev.netlify.com/images/logo/logo-violet.png", offset_x = 50, offset_y = "100px", rotate = 45 }

          };
          request.AddJsonBody(json);

          IRestResponse response = client.Execute(request);
          if (!response.IsSuccessful)
          {
              // Check why status is not int 2xx.
          }
          else
          {
              File.WriteAllBytes("result.pdf", response.RawBytes);
          }
      }
  }
}
using System;
using RestSharp;
using Newtonsoft.Json;
using System.IO;
using RestSharp.Authenticators;
using RestSharp.Serialization;
using System.Net.Mail;
using System.Net;
using System.Collections.Generic;
using Newtonsoft.Json.Linq;

namespace PDFShiftExample
{
  class Program
  {
      static void Main(string [] args)
      {
          IRestClient client = new RestClient("https://api.pdfshift.io/v3/convert/pdf");
          client.Authenticator = new HttpBasicAuthenticator("api", "your_api_key");

          IRestRequest request = new RestRequest(Method.POST);

          var json = new
          {
              source = "https://www.example.com",
              watermark = new { image = "https://pdfshift-dev.netlify.com/images/logo/logo-violet.png", offset_x = 50, offset_y = "100px", rotate = 45 }

          };
          request.AddJsonBody(json);

          IRestResponse response = client.Execute(request);
          if (!response.IsSuccessful)
          {
              // Check why status is not int 2xx.
          }
          else
          {
              File.WriteAllBytes("result.pdf", response.RawBytes);
          }
      }
  }
}
Imports System
Imports RestSharp
Imports Newtonsoft.Json
Imports System.IO
Imports RestSharp.Authenticators
Imports RestSharp.Serialization
Imports System.Net.Mail
Imports System.Net
Imports System.Collections.Generic
Imports Newtonsoft.Json.Linq

Namespace PDFShiftExample
  Friend Class Program
	  Shared Sub Main(ByVal args() As String)
		  Dim client As IRestClient = New RestClient("https://api.pdfshift.io/v3/convert/pdf")
		  client.Authenticator = New HttpBasicAuthenticator("api", "your_api_key")

		  Dim request As IRestRequest = New RestRequest(Method.POST)

		  Dim json = New With {
			  Key .source = "https://www.example.com",
			  Key .watermark = New With {
				  Key .image = "https://pdfshift-dev.netlify.com/images/logo/logo-violet.png",
				  Key .offset_x = 50,
				  Key .offset_y = "100px",
				  Key .rotate = 45
			  }
		  }
		  request.AddJsonBody(json)

		  Dim response As IRestResponse = client.Execute(request)
		  If Not response.IsSuccessful Then
			  ' Check why status is not int 2xx.
		  Else
			  File.WriteAllBytes("result.pdf", response.RawBytes)
		  End If
	  End Sub
  End Class
End Namespace
VB   C#

9. 授權許可

IronPDF 是一個提供免費開發者許可證的庫。IronPDF 也提供特殊的定價結構:輕量包價格從 $749 開始,無隱藏費用。也可以重新分發 SaaS 和 OEM 產品。所有授權許可包含30天退款保證、一年軟體支援及升級、開發/測試/式場/生產的有效性及永久授權。 (一次性購買)IronPDF 授權提供使用者需求的最佳效能。請點擊此連結查看 IronPDF 的完整定價結構和授權。

PDFShift PDF 轉換 API 提供五種不同的授權套餐,可按月或按年購買。"積分"系統用於購買各種套餐,其詳情如下:

  1. 免費套餐 (每月 50 點數)

  2. 啟動 (每月500點數費用為$9,每年6,000點數費用為$99)

  3. 提升 (每月2,500點數,費用為24美元,每年30,000點數,費用為240美元)

  4. 成長 (每月 5,000 點數,費用為 $39;每年 60,000 點數,費用為 $390)

  5. 業務 (25,000 點數每月 $99)

還有檔案大小限制:免費方案每個檔案限制為1MB,而其他方案每個檔案限制為5MB。

欲了解更多資訊及價格,請訪問以下链接 連結.

10. 結論

IronPDF 是一款免費應用程式,為獨立開發者提供多種功能,能夠修改 PDF 文件並將其轉換為其他格式。IronPDF 提供最佳的編輯和格式化工具,用於 PDF 處理。它將 HTML 轉換成適合高品質商業印刷的向量文件。結果,您將會得到一個清晰且高品質的 PDF。此網頁包含許可和價格資訊。

PDFShift 是一個高品質、高保真且強大的 HTML 到 PDF 轉換 API。它提供一個易於學習的端點,擁有接近全功能的一系列工具,還有多語言軟體包。PDFShift 使用 postMessage 向伺服器發送請求,可以處理文件的並行轉換——這意味著您可以同時轉換多個文件。

IronPDF 的許可是基於開發者的,這意味著您應該根據使用該產品的開發者數量購買許可。另一方面,PDFShift 的許可是基於每月和每年的積分制,這意味著您將根據訂閱的套餐每月獲得特定的積分。IronPDF 支持 OME 和 SaaS 發行,而 PDFShift 並不支持。IronPDF 的許可是一性購買,可以終身使用,而 PDFShift 提供每月和每年的許可。

快速比較這兩個工具後,我們可以得出結論,IronPDF 庫比 PDFShift 提供了更多功能。PDFShift 只提供少數的 PDF 操作功能。IronPDF 用三行代碼即可將 URL 轉換成 PDF,但 PDFShift 需要更多行代碼才能完成相同的任務。集成 IronPDF 很容易,只需幾分鐘即可完成。PDFShift 在雲端系統中運行,不需要集成;然而,它依賴於其他 API 例如 Rest Sharp,因此實際上是一個複雜的過程。

此外,Iron Software 目前以兩款工具的價格提供五款工具包。Iron Suite 包括的工具有:

  • IronBarcode
  • IronXL
  • IronOCR
  • IronPDF
  • IronWebScraper

請訪問此連結以查看更多信息。 IRON SUITE.

< 上一頁
IronPDF 和 NReco .NET Core 之間的比較
下一個 >
IronPDF與SautinSoft PDF Focus的比較

準備開始了嗎? 版本: 2024.10 剛剛發布

免費 NuGet 下載 總下載次數: 10,993,239 查看許可證 >