產品比較

Jsreport和IronPDF的比較

發佈 2023年12月12日
分享:

1. 介紹

在數位時代,PDF,或稱可攜式文件格式,已成為日常必需品,對於可靠且一致地儲存和分享資訊至為重要。無論是要將數據屬性轉換成整齊格式的PDF,還是製作專業的發票,開發人員通常會選擇像IronPDF和本地JSReport Studio這樣強大的C#客戶端庫,而不是用於伺服器開發的Phantom PDF。

IronPDF 提供在 .NET 框架中將 HTML 轉換為 PDF 的最佳性能,而 JSReport SDK 則提供動態報告解決方案,重點在於使用本地 JSReport 伺服器和配置或配置文件的靈活性和定制化。這兩個庫都帶來了獨特的解決方案,滿足了開發人員在 PDF 生成和操作領域的不同需求。

2. 在 .NET 中使用 JSReport 伺服器

JSReport SDK .NET 是一個用於 .NET 應用程式的先進報告解決方案,特別針對 ASP.NET Core 環境進行了優化。它的獨特之處在於能夠直接從 HTML 和 JavaScript 將視圖輸出轉換為多種格式,如 PDF、Excel、DOCX 和 CSV。這種功能是通過利用 ASP.NET MVC 引擎如 Razor 來生成報告並使用報告伺服器實現的。

JSReport .NET 提供了一套全面的本地默認擴充功能,包括排程、模板版本管理、子報告、用戶管理、導入/導出模板和備份,增強了其在各種業務場景中的多功能性和適用性。它還支持多種 API,包括 REST API、CLI 或 SDK,可以從幾乎任何地方渲染報告。

2.1 主要功能

2.1.1 ASP.NET Core 整合

JSReport SDK 提供了專門針對 ASP.NET Core 應用程式的 jsreport.AspNetCore NuGet 包。這其中包含了中介承載過濾器,這些過濾器能夠將 MVC 視圖的輸出轉換成所需格式,使用視圖作為 HTML 生成器並使用 JSReport 伺服器作為輸出轉換器。

2.1.2 彈性設置

設置涉及使用如 jsreport.AspNetCorejsreport.Localjsreport.Binary 的套件。這些輔助類幫助連接到本地的 JSReport 實例,亦或是通過 jsreport.Client 連接到遠程實例。

2.1.3 輸出轉換

開發人員可以輕鬆指定 JSReport 配方來進行輸出轉換。例如,使用 MiddlewareFilterChromePdf 配方,ASP.NET 過濾器會捕獲視圖的渲染結果並將其轉換為 PDF 格式。此功能對於基於 ASP.NET 的應用程序特別有用。

2.1.4 遠端實例相容性

JSReport .NET 無縫整合遠端 JSReport 實例。這在協調 Docker 環境中特別有利,JSReport 運行在一個單獨的容器而非一個容器中。這樣整合有助於使用 Docker-compose 等工具協調 JSReport 和 .NET Core 應用程式。

2.1.5 高級回應處理

OnAfterRender 鉤子允許操作回應標頭和其他屬性。此鉤子還可用於將輸出存儲到文件中,提供處理報告生成過程中回應的靈活性。

2.1.6 自訂頁首

JSReport .NET 允許通過部分視圖指定自訂 PDF 頁首。這些頁首可以在運行時與主要 PDF 內容一起渲染,為報告生成提供額外的自訂選項。

2.1.7 無需 MVC 視圖的渲染

框架支持從原始 HTML 渲染報告,而不僅僅是從 MVC 視圖。該功能允許在報告生成過程中擁有更大的靈活性,使開發人員可以直接渲染 HTML 內容。

3. IronPDF

IronPDF 是一個對 .NET 應用程式非常有用的函式庫,它的宗旨是使處理 PDF 變得更加容易。其主要功能之一是 將 HTML 轉換為 PDF適合從網頁產生報告或發票。而且無論是在伺服器端還是客戶端工作,它都非常快速,使它成為商業項目和個人使用的絕佳庫。

IronPDF 適用於許多不同的 .NET 環境,如 ASP.NET、MVC、Windows Forms 和 WPF。它能順利整合至 .NET Core 和 Framework。它還能與 Azure 和其他雲服務配合工作,這對基於雲的應用程式開發來說是一大優勢。

IronPDF的3.1主要功能

3.1.1 HTML 轉換成 PDF

IronPDF非常適合將HTML轉換為PDF文件。它能完美處理HTML、CSS、JavaScript和圖像,確保您的網頁內容在最終的PDF中看起來非常合適。轉換過程中保持原HTML的布局和樣式。

3.1.2 ASP.NET 整合

與 ASP.NET 的整合無縫銜接,讓你不需要大量編碼就能將 ASPX 頁面轉換為 PDF。這對於將現有的 Web 應用程式轉換為 PDF 非常方便。

3.1.3 編輯和操作

IronPDF讓您 編輯現有的 PDF 文件,例如添加文本、圖像和頁面或合併多個PDF。編輯功能對使用者友好,因此您不需要成為PDF專家即可使用它們。您還可以添加 註解, 附件, 大綱和書籤 到您的 PDF。

3.1.4 表格填寫和提取

IronPDF 支持填寫和提取數據從 PDF 表單這對於處理表單的應用程式來說是關鍵的。IronPDF 使管理表單數據的整個過程更加順暢。它還能處理不同類型的 PDF 表單,這增加了它的靈活性。

3.1.5 安全功能

IronPDF 具有安全功能,如對 PDF 文件進行密碼保護和設定權限,這對於保護敏感信息至關重要。它還具有加密和解密功能,增加了另一層保護。 您的 PDF 安全性.

3.1.6 可自定義渲染

您可以對 PDF 的渲染方式進行多種控制,例如設置 自訂頁首和頁尾調整 頁邊距以及選擇特定的 HTML 部分進行轉換。這種程度的自定義可確保您的 PDF 正好符合您的需求。

3.1.7 高級 PDF 功能

IronPDF 支援 PDF/A 合規性數位簽章它還具備 OCR 能力,這意味著它可以將掃描的文件和圖像轉換為您可以搜索和編輯的 PDF。這些功能對於更複雜的項目非常有用。

3.1.8 簡易部署

設置 IronPDF 非常簡單——不需要額外的安裝或依賴。它很輕量,因此不會降低應用程式的性能。此外,它經常更新以跟上最新的 .NET 技術,為您提供一個不會過時的 PDF 解決方案。

4. 建立 .NET 專案

4.1 啟動新專案

開啟 Visual Studio,並按下「建立新專案」按鈕來啟動新專案。

Jsreport 和 IronPDF 比較:圖 1 - 建立項目

然後,選擇'Console App'、'.NET Core App'或任何其他選項。

Jsreport 與 IronPDF 的比較:圖 2 - 獨立專案 - 控制台應用程式

4.2 設置專案

您需要為您的專案命名。找到專案名稱的文本框並輸入您想要的名稱。另外,通過選擇保存專案的路徑來選擇專案的位置。輸入這些詳細信息後,點擊“創建”按鈕以繼續。

Jsreport與IronPDF比較:圖表 3 - 專案設置

4.3 選擇 .NET 框架

接下來的步驟是為您的專案選擇所需的 .NET 框架。此選擇取決於您的專案需求和相容性。之後,點擊「Create」按鈕。

Jsreport 與 IronPDF 之間的比較:圖表 4 - 選擇框架

安裝IronPDF庫

5.1 使用 NuGet 套件管理器

要使用 Visual Studio 中的 NuGet 套件管理器安裝 IronPDF,請按照以下步驟進行:

  • 在 Visual Studio 中打開您的專案。
  • 點擊「工具」選單,選擇「NuGet 套件管理器」,然後選擇「管理解決方案的 NuGet 套件」。

    Jsreport和IronPDF之比較:圖5 - NuGet套件管理器

  • 在 NuGet 套件管理器中,點擊「瀏覽」選項卡。
  • 搜尋「IronPDF」。
  • 找到 IronPDF 套件後,選擇它並點擊「安裝」。

    Jsreport和IronPDF之間的比較:圖6 - 安裝IronPDF

  • 按照提示完成安裝。

5.2 使用 Visual Studio 命令行

如果你喜歡使用命令行,可以按以下步驟在 Visual Studio 中安裝 IronPDF:

  • 打開 Visual Studio。
  • 移動到“工具”菜單,懸停在“NuGet 套件管理器”上,然後從側邊菜單中選擇“套件管理器控制台”。
  • 在控制台中輸入以下命令:
    Install-Package IronPdf
    Install-Package IronPdf
'INSTANT VB TODO TASK: The following line uses invalid syntax:
'Install-Package IronPdf
VB   C#
  • 按 Enter 鍵執行命令並等待安裝完成。

    Jsreport 與 IronPDF 的比較:圖 7 - IronPDF 安裝

5.3 從NuGet網頁直接下載

IronPDF也可以從NuGet網站直接下載:

  • 訪問NuGet官方網站。
  • 使用搜索欄尋找IronPDF套件。

    Jsreport與IronPDF之間的比較:圖8 - IronPDF套件

  • IronPDF套件頁面,您將看到直接下載套件的選項。
  • 下載 .nupkg 檔案並手動將其新增到您的專案中。

    Jsreport與IronPDF之比較:圖9 - 下載 .nupkg

6. 安裝JSReport

6.1 在 Visual Studio 中使用 NuGet 套件管理器

要使用 Visual Studio 的 NuGet 套件管理器運行 JSReport,請移至“工具”菜單並選擇“管理 NuGet 套件”。這將打開 NuGet 套件管理器介面。在 NuGet 套件管理器中,根據您的專案需求,您可以搜索 jsreport.Localjsreport.Binary

Jsreport與IronPDF之間的比較:圖10 - jsreport.Binary

這些是將 JSReport 整合到 .NET 應用程式中的主要套件。找到適當的套件後,點選「安裝」以將其新增到您的專案中。這個過程會自動下載並引用專案中的套件,使其可以立即使用。

6.2 使用 NuGet 套件管理器主控台

替代方法是使用 Visual Studio 的 NuGet 套件管理器主控台來安裝 JSReport。要做到這一點,請從‘工具’選單中選擇‘NuGet 套件管理器’,然後選擇‘套件管理器主控台’。

Jsreport和IronPDF之間的比較:圖11 - 套件管理控制台

在控制台中,您需要執行特定命令來安裝 JSReport 套件。如果您想要安裝 jsreport.Local 套件,可以使用命令 Install-Package jsreport.Local。對於 jsreport.Binary 套件,命令為 Install-Package jsreport.Binary。在套件管理器控制台中執行這些命令將會下載並將相應的 JSReport 套件新增到您的專案中。

Jsreport 和 IronPDF 的比較:圖 12 - 安裝 jsreport.Local

7. 比較 IronPDF 和 JSReport 中的 HTML 到 PDF 功能

7.1 IronPDF 的 HTML 转 PDF 轉換

IronPDF 是 HTML 转 PDF 轉換的最佳庫。它以易於使用和高性能而脫穎而出,成為開發者的首選。它支持高級功能如 CSS 渲染、JavaScript 執行和自訂頁眉頁腳,進一步增強了從 HTML 源生成高質量 PDF 的能力。IronPDF 提供了 3 種將 HTML 转 PDF 的方法:

  1. HTML 字串转 PDF
  2. HTML 文件转 PDF
  3. URL 转 PDF

讓我們一個一個討論這些功能。

7.1.1 HTML 字串轉換成 PDF

此功能允許您直接從字串中轉換 HTML 內容。這在 HTML 內容於應用程式內動態生成或修改時特別有用。您可以將 HTML 字串傳遞給 IronPDF,它將其渲染為 PDF。

using IronPdf;
var renderer = new ChromePdfRenderer();
IronPdf.License.LicenseKey = "Your-License-Key";
string htmlString = @"
            <html>
                <head>
                    <title>Example HTML</title>
                </head>
                <body>
                    <h1>Hello, World!</h1>
                    <p>This is an HTML string converted to PDF using IronPDF.</p>
                </body>
            </html>";
// Convert HTML string to PDF
var pdfDocument = renderer.RenderHtmlAsPdf(htmlString);
pdfDocument.SaveAs("HtmlStringToPdf.pdf");
using IronPdf;
var renderer = new ChromePdfRenderer();
IronPdf.License.LicenseKey = "Your-License-Key";
string htmlString = @"
            <html>
                <head>
                    <title>Example HTML</title>
                </head>
                <body>
                    <h1>Hello, World!</h1>
                    <p>This is an HTML string converted to PDF using IronPDF.</p>
                </body>
            </html>";
// Convert HTML string to PDF
var pdfDocument = renderer.RenderHtmlAsPdf(htmlString);
pdfDocument.SaveAs("HtmlStringToPdf.pdf");
Imports IronPdf
Private renderer = New ChromePdfRenderer()
IronPdf.License.LicenseKey = "Your-License-Key"
Dim htmlString As String = "
            <html>
                <head>
                    <title>Example HTML</title>
                </head>
                <body>
                    <h1>Hello, World!</h1>
                    <p>This is an HTML string converted to PDF using IronPDF.</p>
                </body>
            </html>"
' Convert HTML string to PDF
Dim pdfDocument = renderer.RenderHtmlAsPdf(htmlString)
pdfDocument.SaveAs("HtmlStringToPdf.pdf")
VB   C#

這是輸出 PDF 文件:

Jsreport和IronPDF之間的比較:圖13 - 輸出

7.1.2 HTML File To PDF

使用此方法,您可以將現有的 HTML 檔案轉換為 PDF。當您擁有需要以 PDF 方式呈現或分發的靜態 HTML 檔案時,這非常有用。您需要提供 HTML 檔案的路徑,IronPDF 會處理轉換。

using IronPdf;
var renderer = new ChromePdfRenderer();
IronPdf.License.LicenseKey = "Your-License-Key";
var pdfDocument = renderer.RenderHtmlFileAsPdf("invoice.html");
pdfDocument.SaveAs("Invoice.pdf");
using IronPdf;
var renderer = new ChromePdfRenderer();
IronPdf.License.LicenseKey = "Your-License-Key";
var pdfDocument = renderer.RenderHtmlFileAsPdf("invoice.html");
pdfDocument.SaveAs("Invoice.pdf");
Imports IronPdf
Private renderer = New ChromePdfRenderer()
IronPdf.License.LicenseKey = "Your-License-Key"
Dim pdfDocument = renderer.RenderHtmlFileAsPdf("invoice.html")
pdfDocument.SaveAs("Invoice.pdf")
VB   C#

這是發票 HTML 的輸出 PDF 文件:

7.1.2 URL To PDF

此功能可以透過使用網站的 URL 將整個網頁轉換成 PDF。這對於捕捉網頁的當前狀態(包括樣式、圖片和其他資源)非常方便。IronPDF 會從給定的 URL 加載網頁並將其轉換為 PDF 文件,儘可能逼真地複製其佈局和內容。

using IronPdf;
var renderer = new ChromePdfRenderer();
IronPdf.License.LicenseKey = "Your-License-Key";
renderer.RenderingOptions.PaperSize = IronPdf.Rendering.PdfPaperSize.A2;
//https url
var pdfDocument = renderer.RenderUrlAsPdf("https://dotnet.microsoft.com/");
pdfDocument.SaveAs("UrlToPdf.pdf");
using IronPdf;
var renderer = new ChromePdfRenderer();
IronPdf.License.LicenseKey = "Your-License-Key";
renderer.RenderingOptions.PaperSize = IronPdf.Rendering.PdfPaperSize.A2;
//https url
var pdfDocument = renderer.RenderUrlAsPdf("https://dotnet.microsoft.com/");
pdfDocument.SaveAs("UrlToPdf.pdf");
Imports IronPdf
Private renderer = New ChromePdfRenderer()
IronPdf.License.LicenseKey = "Your-License-Key"
renderer.RenderingOptions.PaperSize = IronPdf.Rendering.PdfPaperSize.A2
'https url
Dim pdfDocument = renderer.RenderUrlAsPdf("https://dotnet.microsoft.com/")
pdfDocument.SaveAs("UrlToPdf.pdf")
VB   C#

以下是使用上述邏輯生成的 Microsoft .NET 網站 PDF。

Jsreport與IronPDF的比較:圖14 - Microsoft HTTP網站PDF

7.2 JSReport C# HTML 轉 PDF 轉換

在 JSReport 中將 HTML 轉換為 PDF 的過程涉及多個步驟,通常包括設置 JSReport 伺服器或使用其線上 API。在 C# 中,典型的實現可能如下所示:

using JsReport.AspNetCore;
using JsReport.Types;
using System.Threading.Tasks;
public async Task<IActionResult> GeneratePdf()
{
    var report = new LocalReporting()
                 .UseBinary(JsReportBinary.GetBinary())
                 .AsUtility()
                 .Create();
    var reportResult = await report.RenderAsync(new RenderRequest()
    {
        Template = new Template()
        {
            Content = "<html><body><h1>Example HTML</h1><p>This is converted to PDF using JSReport.</p></body></html>",
            Engine = Engine.None,
            Recipe = Recipe.ChromePdf
        },
        Options = new RenderOptions()
        {
            Debug = new DebugOptions() { Preview = true }
        }
    });
    var stream = new MemoryStream();
    reportResult.Content.CopyTo(stream);
    stream.Position = 0;
    return File(stream, "application/pdf", "Report.pdf");
}
using JsReport.AspNetCore;
using JsReport.Types;
using System.Threading.Tasks;
public async Task<IActionResult> GeneratePdf()
{
    var report = new LocalReporting()
                 .UseBinary(JsReportBinary.GetBinary())
                 .AsUtility()
                 .Create();
    var reportResult = await report.RenderAsync(new RenderRequest()
    {
        Template = new Template()
        {
            Content = "<html><body><h1>Example HTML</h1><p>This is converted to PDF using JSReport.</p></body></html>",
            Engine = Engine.None,
            Recipe = Recipe.ChromePdf
        },
        Options = new RenderOptions()
        {
            Debug = new DebugOptions() { Preview = true }
        }
    });
    var stream = new MemoryStream();
    reportResult.Content.CopyTo(stream);
    stream.Position = 0;
    return File(stream, "application/pdf", "Report.pdf");
}
Imports JsReport.AspNetCore
Imports JsReport.Types
Imports System.Threading.Tasks
Public Async Function GeneratePdf() As Task(Of IActionResult)
	Dim report = (New LocalReporting()).UseBinary(JsReportBinary.GetBinary()).AsUtility().Create()
	Dim reportResult = Await report.RenderAsync(New RenderRequest() With {
		.Template = New Template() With {
			.Content = "<html><body><h1>Example HTML</h1><p>This is converted to PDF using JSReport.</p></body></html>",
			.Engine = Engine.None,
			.Recipe = Recipe.ChromePdf
		},
		.Options = New RenderOptions() With {
			.Debug = New DebugOptions() With {.Preview = True}
		}
	})
	Dim stream = New MemoryStream()
	reportResult.Content.CopyTo(stream)
	stream.Position = 0
	Return File(stream, "application/pdf", "Report.pdf")
End Function
VB   C#

你還可以從以下找到 JSReport .NET 的範例 連結. 這是發票 PDF 報告的範例輸出。

Jsreport 與 IronPDF 之間的比較:圖15 - 發票輸出 PDF

8. 彈性及高級功能

8.1 IronPDF 的高級功能和自訂化

IronPDF 因其高級功能和高度自訂化而脫穎而出,滿足各種 PDF 操作需求。主要的高級功能包括:

PDF/A 合規:它支持 PDF/A 格式,對於長期存檔和符合行業標準至關重要。此合規性對於法律、金融和政府部門來說尤為關鍵,因為這些部門需要確保文件的長期完整性。

using IronPdf;
// Create a PdfDocument object or open any PDF File
PdfDocument pdf = PdfDocument.FromFile("wikipedia.pdf");
// Use the SaveAsPdfA method to save to file
pdf.SaveAsPdfA("pdf-a3-wikipedia.pdf", PdfAVersions.PdfA3);
using IronPdf;
// Create a PdfDocument object or open any PDF File
PdfDocument pdf = PdfDocument.FromFile("wikipedia.pdf");
// Use the SaveAsPdfA method to save to file
pdf.SaveAsPdfA("pdf-a3-wikipedia.pdf", PdfAVersions.PdfA3);
Imports IronPdf
' Create a PdfDocument object or open any PDF File
Private pdf As PdfDocument = PdfDocument.FromFile("wikipedia.pdf")
' Use the SaveAsPdfA method to save to file
pdf.SaveAsPdfA("pdf-a3-wikipedia.pdf", PdfAVersions.PdfA3)
VB   C#

编辑、合并和拆分PDF:IronPDF允許編輯现有的PDF,將多個PDF合併成一個,以及將PDF拆分為单独的文檔。此功能在需要將大型文檔拆分以便于分发或将不同文檔的各个部分合并时特别有用。

安全功能:包括强大的安全功能,如密码保护、加密和设置用户权限的功能。IronPDF支持PDF文件的加密,添加一层额外的安全保护,以防止内容被更改或复制。

using IronPdf;
// Open a PDF File
var pdfDoc = PdfDocument.FromFile("invoice.pdf");
// The following code makes a PDF read only and will disallow copy & paste and printing
pdfDoc.SecuritySettings.RemovePasswordsAndEncryption();
pdfDoc.SecuritySettings.AllowUserAnnotations = false;
pdfDoc.SecuritySettings.AllowUserCopyPasteContent = false;
pdfDoc.SecuritySettings.AllowUserPrinting = IronPdf.Security.PdfPrintSecurity.FullPrintRights;
pdfDoc.SecuritySettings.MakePdfDocumentReadOnly("secret-key");
pdfDoc.SecuritySettings.AllowUserFormData = false;
// Change or set the document encryption password
pdfDoc.SecuritySettings.OwnerPassword = "passForOpen"; // password to edit the pdf
pdfDoc.SecuritySettings.UserPassword = "onlyForShare"; // password to open the pdf
pdfDoc.SaveAs("InvoiceProtected.pdf");
using IronPdf;
// Open a PDF File
var pdfDoc = PdfDocument.FromFile("invoice.pdf");
// The following code makes a PDF read only and will disallow copy & paste and printing
pdfDoc.SecuritySettings.RemovePasswordsAndEncryption();
pdfDoc.SecuritySettings.AllowUserAnnotations = false;
pdfDoc.SecuritySettings.AllowUserCopyPasteContent = false;
pdfDoc.SecuritySettings.AllowUserPrinting = IronPdf.Security.PdfPrintSecurity.FullPrintRights;
pdfDoc.SecuritySettings.MakePdfDocumentReadOnly("secret-key");
pdfDoc.SecuritySettings.AllowUserFormData = false;
// Change or set the document encryption password
pdfDoc.SecuritySettings.OwnerPassword = "passForOpen"; // password to edit the pdf
pdfDoc.SecuritySettings.UserPassword = "onlyForShare"; // password to open the pdf
pdfDoc.SaveAs("InvoiceProtected.pdf");
Imports IronPdf
' Open a PDF File
Private pdfDoc = PdfDocument.FromFile("invoice.pdf")
' The following code makes a PDF read only and will disallow copy & paste and printing
pdfDoc.SecuritySettings.RemovePasswordsAndEncryption()
pdfDoc.SecuritySettings.AllowUserAnnotations = False
pdfDoc.SecuritySettings.AllowUserCopyPasteContent = False
pdfDoc.SecuritySettings.AllowUserPrinting = IronPdf.Security.PdfPrintSecurity.FullPrintRights
pdfDoc.SecuritySettings.MakePdfDocumentReadOnly("secret-key")
pdfDoc.SecuritySettings.AllowUserFormData = False
' Change or set the document encryption password
pdfDoc.SecuritySettings.OwnerPassword = "passForOpen" ' password to edit the pdf
pdfDoc.SecuritySettings.UserPassword = "onlyForShare" ' password to open the pdf
pdfDoc.SaveAs("InvoiceProtected.pdf")
VB   C#

標題和頁腳控制:開發人員可以輕鬆地為他們的PDF文件添加自定義標題和頁腳,這個功能對於專業外觀的報告、發票和其他商業文件是必不可少的。這包括添加頁碼、日期和自定義文本的能力。

PDF轉圖片:IronPDF允許將PDF頁面轉換為圖片。這個功能在需要將PDF內容顯示為網頁應用程式中的圖片或生成縮略圖的場景中特別有用。

using IronPdf;
using IronSoftware.Drawing;
var pdf = PdfDocument.FromFile("Example.pdf");
// Extract all pages to a folder as image files
pdf.RasterizeToImageFiles(@"C:\image\folder\*.png");
// Dimensions and page ranges may be specified
pdf.RasterizeToImageFiles(@"C:\image\folder\example_pdf_image_*.jpg", 100, 80);
// Extract all pages as AnyBitmap objects
AnyBitmap [] pdfBitmaps = pdf.ToBitmap();
using IronPdf;
using IronSoftware.Drawing;
var pdf = PdfDocument.FromFile("Example.pdf");
// Extract all pages to a folder as image files
pdf.RasterizeToImageFiles(@"C:\image\folder\*.png");
// Dimensions and page ranges may be specified
pdf.RasterizeToImageFiles(@"C:\image\folder\example_pdf_image_*.jpg", 100, 80);
// Extract all pages as AnyBitmap objects
AnyBitmap [] pdfBitmaps = pdf.ToBitmap();
Imports IronPdf
Imports IronSoftware.Drawing
Private pdf = PdfDocument.FromFile("Example.pdf")
' Extract all pages to a folder as image files
pdf.RasterizeToImageFiles("C:\image\folder\*.png")
' Dimensions and page ranges may be specified
pdf.RasterizeToImageFiles("C:\image\folder\example_pdf_image_*.jpg", 100, 80)
' Extract all pages as AnyBitmap objects
Dim pdfBitmaps() As AnyBitmap = pdf.ToBitmap()
VB   C#

8.2 JSReport .NET 高級功能和可擴展性

JSReport .NET 以其高級功能和可擴展性而聞名,使其成為報告生成的多功能工具。其主要功能包括:

動態報告生成:它支持多種模板引擎,包括 Handlebars 和 EJS,便於複雜且靈活的報告設計。這種多引擎兼容性允許各種設計可能性,適應不同要求和報告創建的複雜性。

var report = new LocalReporting()
    .UseBinary(JsReportBinary.GetBinary())
    .RunInDirectory(Path.Combine(Directory.GetCurrentDirectory(), "jsreport"))
    .KillRunningJsReportProcesses()
    .Configure(cfg => cfg.AllowLocalFilesAccess().FileSystemStore().BaseUrlAsWorkingDirectory())
    .AsUtility()
    .Create();
var reportResult = await report.RenderAsync(new RenderRequest()
{
    Template = new Template()
    {
        Content = "{{{message}}}",
        Engine = Engine.Handlebars,
        Recipe = Recipe.ChromePdf
    },
    Data = new
    {
        message = "PDF Generation with JSReport .NET"
    }
});
var report = new LocalReporting()
    .UseBinary(JsReportBinary.GetBinary())
    .RunInDirectory(Path.Combine(Directory.GetCurrentDirectory(), "jsreport"))
    .KillRunningJsReportProcesses()
    .Configure(cfg => cfg.AllowLocalFilesAccess().FileSystemStore().BaseUrlAsWorkingDirectory())
    .AsUtility()
    .Create();
var reportResult = await report.RenderAsync(new RenderRequest()
{
    Template = new Template()
    {
        Content = "{{{message}}}",
        Engine = Engine.Handlebars,
        Recipe = Recipe.ChromePdf
    },
    Data = new
    {
        message = "PDF Generation with JSReport .NET"
    }
});
Dim report = (New LocalReporting()).UseBinary(JsReportBinary.GetBinary()).RunInDirectory(Path.Combine(Directory.GetCurrentDirectory(), "jsreport")).KillRunningJsReportProcesses().Configure(Function(cfg) cfg.AllowLocalFilesAccess().FileSystemStore().BaseUrlAsWorkingDirectory()).AsUtility().Create()
Dim reportResult = Await report.RenderAsync(New RenderRequest() With {
	.Template = New Template() With {
		.Content = "{{{message}}}",
		.Engine = Engine.Handlebars,
		.Recipe = Recipe.ChromePdf
	},
	.Data = New With {Key .message = "PDF Generation with JSReport .NET"}
})
VB   C#

模板引擎:JSReport .NET 具有排程和自動化報告生成功能,非常適合日常或每月摘要等定期報告需求。此功能確保報告的及時交付,並可與業務流程集成以進行事件觸發報告。

自訂腳本的擴展性:JSReport C# 通過自訂腳本擴展其功能,增強了如自訂數據處理或專門格式化等功能。這種擴展性對於根據特定業務邏輯和數據處理需求創建報告至關重要。

9. 支援

9.1 IronPDF 文件質量和可用性

IronPDF 的文件內容全面且易於使用,適合初學者和有經驗的開發人員。它包括詳細的指南、API 參考和豐富的代碼示例,使開發人員更容易理解和實現庫的功能,這些示例支持多種語言如 C# 和 Node。

這些文件結構良好並定期更新,反映了最新的功能和最佳實踐。此外,IronPDF 的網站提供快速入門指南和常見問題解答,這對於那些新接觸 .NET 環境中 PDF 操作的人特別有幫助。

IronPDF 還有一個在線遊樂場,在那裡你可以不下載代碼就在線試用 IronPDF 的功能。您可以使用以下方式進行探索 連結.

9.1.1 支援選項

IronPDF 提供多種支援選項,包括專門的支援團隊處理查詢和技術問題。他們提供電子郵件支援,並積極參與開發者論壇,提供解決方案和建議。您還可以通過網站上的即時支援選項聯繫即時支援代理。

9.2 JSReport .NET 文檔質量和可用性

JSReport .NET 以其廣泛且維護良好的文檔為榮。文檔涵蓋了從基本設置到高級使用場景的廣泛主題,並附有代碼片段和實施示例。它的組織結構合乎邏輯,易於導航和找到相關信息。線上資源還包括全面的 API 參考,確保開發人員可以獲取有關工具功能的詳細信息。

9.2.1 支援選項

在支援方面,JSReport .NET 提供多種選擇。他們有一支專門的支援團隊,可通過電子郵件聯繫,並且在 GitHub 上保持活躍,提供報告問題和功能請求的平台。

10. 授權模式

10.1 IronPDF 的授權

Jsreport 和 IronPDF 之間的比較:圖 16 - 授權

IronPDF 提供三種 獨特的定價選項, 適用於不同規模的使用和預算需求:

Lite Edition:價格為 $749,這是雲端部署的一次性費用。它適用於較小的項目或剛開始使用 PDF 處理的團隊。

Professional Edition:價格為 $1,499,這也是雲端部署的一次性費用。本版本適用於需要更多高級功能和能力的專業開發人員。

Unlimited Edition:最全面的套裝,價格為 $2,999,這是雲端部署的一次性費用。它非常適合大型企業使用,提供廣泛的功能且無使用限制。

10.2 JSReport .NET 授權

JSReport 與 IronPDF 的比較:圖 17 - JSReport 授權

JSReport .NET 提供 靈活的授權選項,包含基於訂閱和永久許可證:

免費許可證:這提供了一個功能齊全但最多限制5個報告模板的實例。不需要許可證密鑰,適用於小型項目或評估用途。

企業訂閱:每年 $395,這個計劃提供了一個無限制的功能齊全的單一 JSReport 實例並包含更新。適合需要強大全面報告解決方案的單個企業。

企業規模訂閱:每年 $1,295,這個計劃最適合大規模部署,提供了一個無限實例有效的單一許可證密鑰。此計劃包括更新且免版稅,適合運行多個實例的組織或作為其他產品的一部分部署給多個客戶。

11. 結論

總之,雖然 IronPDF 和 JSReport .NET 在各自的領域中都很有價值,但 IronPDF 由於其全面的 PDF 操作能力,佔有一點優勢。它在 PDF/A 合規、高級編輯和安全功能方面表現出色,使其成為在 .NET 環境中進行詳細 PDF 處理的更靈活工具。JSReport .NET 在動態報告生成和模板方面具有優勢,對於以報告為中心的任務非常有效。然而,對於大多數需要詳細和多樣化的 PDF 處理與操作的場景,IronPDF 是更具優勢的選擇。

IronPDF 提供免費的開發者授權,並且 免費試用. Iron Software 提供了一個名為 Iron Suite 的綜合包。這個套件包含 IronBarcode, IronXL, IronQR, IronOCR, IronPDF,和 IronWebScraper軟體價格為兩個軟體的價格,為尋求廣泛功能的開發者增加了顯著的價值。

最後,選擇兩者之間將取決於項目或開發者的具體需求和環境。

< 上一頁
IronPDF與DinktoPdf之間的比較
下一個 >
在 C# 中使用 ITextSharp 和 IronPDF 創建 PDF 的比較

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

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