用 C# 将 HTML 转换为 PDF - 库选项的现实意义
对于开发人员/年的Document Solutions .NET捆绑包的入门级,每开发人员1,799美元,而永久Iron Suite Lite许可证则为$2,998,单单美元基准便重新构建了采购问题。 MESCIUS销售四个核心.NET库(DsPdf, DsExcel, DsWord, DsImaging)按年度订阅,只有在Unlimited级别才解锁免版税部署,并单独销售查看器SKU。 Iron Suite以一个永久的每开发者捆绑包提供十个Iron Software产品,对已授权的席位免版税开箱即用,SaaS和OEM再分发涵盖在一个单一的Redistribution Add-On中。
这种比较带出一个采购驱动的决策实际依赖于:每个套件在一个许可证周期中的定价,此捆绑包涵盖的内容,以及如何处理再分发。 能力详情和代码接下来是给将要交付的工程师们的。
一目了然的比较
| 维度 | Document Solutions for .NET | Iron Suite |
|---|---|---|
| 定价定位 | .NET捆绑包:开发人员1,799美元/无限开发人员4,950美元/无限团队10,345美元(5个开发人员)。 各个产品:$999/$2,799/$5,799 | Lite $2,998 / Plus $4,498 / Professional $8,998 / Unlimited $17,998(Enterprise自定义)。 所有10款产品以2款的价格,节省75% |
| 许可模式 | 每开发者年度订阅,含1年维护和支持; 在Unlimited级别享有免版税部署; 降低的续订费率 | 每开发者的永久许可; 许可席位免版税; SaaS/OEM通过Redistribution Add-On |
| 捆绑中的组件 | 4个核心.NET库(DsPdf, DsExcel, DsWord, DsImaging)+ 3个单独销售的查看器SKU | 10个产品(IronPDF、IronWord、IronXL、IronPPT、IronOCR、IronBarcode、IronQR、IronPrint、IronZIP、IronWebScraper) |
| 格式/能力覆盖 | PDF, Excel, Word, Imaging + 查看器家族 | PDF、Office、OCR、Barcode/QR、ZIP、Print、Web Scraping |
| 跨平台/云 | Windows, macOS, Linux, Azure, AWS, AWS Lambda | Windows、Linux、macOS、Docker、Azure、AWS Lambda |
| .NET运行时支持 | .NET Standard 2.0(涵盖.NET Framework 4.6.2+,.NET Core 2.0+,.NET 6/7/8/9/10) | .NET Framework 4.6.2+, .NET Core, .NET 6/7/8/9/10 |
| 目标市场 | 企业和ISV的.NET团队; financial services and reporting-heavy verticals | 独立开发者,小型中型市场.NET团队,ISVs |
| 供应商 | MESCIUS inc.(前身为GrapeCity) | Iron Software |
买家通过询问决定:工作负载是否主要是PDF、Excel、Word和Imaging,具有流畅的代码优先布局API和深入的Excel计算深度作为决定轴? 如果是,那么Document Solutions for .NET符合决定轴。 如果工作负载涵盖OCR、条形码、QR、网络抓取或印刷在一个许可证下的较低入门级,Iron Suite涵盖了更广泛的表面($2,998 Lite与1,799美元MESCIUS Developer相比)。
定价和许可
Document Solutions for .NET使用每开发者年度订阅模式,每个SKU有三个许可证级别。 对于.NET捆绑包:开发者许可证$1,799/开发者,开发者Unlimited $4,950/开发者,团队Unlimited为五个开发者$10,345。 单个产品(DsPdf,DsExcel,DsWord,DsImaging)遵循相同的矩阵,价格为$999/$2,799/$5,799。每个许可证包括1年年度维护和支持,续订价格降低(大约$649对比最初$999用于单个产品开发者级别)。 在Unlimited级别包含免版税部署。
Iron Suite以每开发人员的永久许可证销售,分为五个等级(Lite, Plus, Professional, Unlimited, 和Enterprise),起价为$2,998,市场定位为"10个产品的价格仅相当于2个,节省75%。" 基本许可证对被许可的席位、位置或项目免版税,而SaaS、OEM或超出基本许可证的分发使用单独定价的再分发附加组件。
在3至5年的范围内,Document Solutions作为一个每开发者年度订阅运行,从第2年开始续订费降低(开发者层级从$1,799初始降至大约$649续订)。 Iron Suite以$2,998对Lite(或更高等级根据需要)一次性购买永久所有权。 版本永久拥有,续订可选以继续获得更新和支持。
什么是Document Solutions for .NET
Document Solutions for .NET是重新命名的GrapeCity Documents产品系列,现在由MESCIUS inc.发布。(GrapeCity的2023年更名)。 .NET目录目前包括PDF的Document Solutions(DsPdf),Excel(DsExcel),Word(DsWord)和Imaging(DsImaging),外加一个单独的Document Solutions PDF Viewer / Data Viewer / Image Viewer家族用于嵌入式UI场景。 库以.NET Standard 2.0为目标,从.NET Framework 4.6.2+到.NET Core 2.0+以及现代表的.NET 6/7/8/9/10提供广泛的运行时覆盖。NuGet包现以GrapeCity.Documents.</em>以保证向后兼容。 最新的参考版本是DS.Documents.Pdf 9.1.0,发布于2026-05-04。
关键的捆绑组件和功能:
- PDF的Document Solutions(DsPdf):流畅的代码优先PDF生成器,带有真实的文本布局引擎
- Excel的Document Solutions(DsExcel):快速XLSX引擎,附带450多个内置功能
- Word的Document Solutions(DsWord):DOCX创建和操控,具有类似流畅的风格
- Imaging的Document Solutions(DsImaging):跨平台的图像处理基元
- PDF查看器/数据查看器/图像查看器:嵌入UI组件(单独定价)
- 姊妹Java和JS版本:DsPdf JS,DsExcel Java用于跨语言同等
什么是Iron Suite
Iron Suite是Iron Software的十产品.NET捆绑包,其Office堆栈带来了DOCX、XLSX和PPTX表面以及对PDF的IronPDF,带有针对OCR和条形码工作的识别堆栈,外加三个用于打印、归档和抓取的实用工具。 以单个永久每开发人员许可销售,从每开发人员的$2,998 (Lite)起, 每个级别包括一年的更新。 对已授权席位免版税。 SaaS和OEM再分发使用单独的Redistribution Add-On。
这十个组件,按与编程的Office和PDF工作流的相关性进行分组:
- Office堆栈(锚点):IronWord(DOCX带有段落和文本运行对象图,自定义风格、字体、页眉、页脚、内容提取); IronXL(XLSX带有公式重新计算、图表、数据透视表、单元格样式); IronPPT(PPTX创建、编辑、内容提取)。
- PDF生成 (IronPDF): HTML到PDF以及URL到PDF渲染,本地合并和拆分,PKCS#12加HSM加TSA签名,通过PDF/A/4,PDF/UA-1和PDF/UA-2的PDF/A, 加密,AcroForm填充和平坦化,通过
Fonts.Add().Embed()和WaitFor.AllFontsLoaded()实现完整的字体管理,栅格化, 压缩和线性化。 - 识别:IronOCR(Tesseract 5,125+种语言,手写支持约90%英语); IronBarcode(30多种符号); IronQR(基于ML,批量
ReadPdfs)。 - 实用工具: IronPrint(安静和对话打印); IronZIP(ZIP/TAR/GZIP/BZIP2,带AES); IronWebScraper(进程内结构化抓取)。
能力比较
PDF生成(流畅代码优先对比HTML优先)
PDF生成风格是两种套件差异最大的地方。DsPdf正在树立一种流畅的代码优先PDF布局库的地位,拥有GcPdfGraphics和内置文本布局引擎。IronPDF使用真实的Chrome引擎从HTML渲染PDF。
// DsPdf builds PDFs with a fluent code-first layout API — the defining strength of Document Solutions.
// NuGet: Install-Package DS.Documents.Pdf
using GrapeCity.Documents.Pdf;
using GrapeCity.Documents.Text;
using System.Drawing;
class Program
{
static void Main()
{
GcPdfDocument doc = new GcPdfDocument();
GcPdfGraphics g = doc.NewPage().Graphics;
TextFormat title = new TextFormat { Font = StandardFonts.HelveticaBold, FontSize = 20 };
g.DrawString("Statement of Account", title, new PointF(72, 72));
TextFormat body = new TextFormat { Font = StandardFonts.Helvetica, FontSize = 11 };
g.DrawString("Generated 2026-05-26 — fluent code-first layout.", body, new PointF(72, 110));
doc.Save("statement.pdf");
}
}// DsPdf builds PDFs with a fluent code-first layout API — the defining strength of Document Solutions.
// NuGet: Install-Package DS.Documents.Pdf
using GrapeCity.Documents.Pdf;
using GrapeCity.Documents.Text;
using System.Drawing;
class Program
{
static void Main()
{
GcPdfDocument doc = new GcPdfDocument();
GcPdfGraphics g = doc.NewPage().Graphics;
TextFormat title = new TextFormat { Font = StandardFonts.HelveticaBold, FontSize = 20 };
g.DrawString("Statement of Account", title, new PointF(72, 72));
TextFormat body = new TextFormat { Font = StandardFonts.Helvetica, FontSize = 11 };
g.DrawString("Generated 2026-05-26 — fluent code-first layout.", body, new PointF(72, 110));
doc.Save("statement.pdf");
}
}Imports GrapeCity.Documents.Pdf
Imports GrapeCity.Documents.Text
Imports System.Drawing
Class Program
Shared Sub Main()
Dim doc As New GcPdfDocument()
Dim g As GcPdfGraphics = doc.NewPage().Graphics
Dim title As New TextFormat With {
.Font = StandardFonts.HelveticaBold,
.FontSize = 20
}
g.DrawString("Statement of Account", title, New PointF(72, 72))
Dim body As New TextFormat With {
.Font = StandardFonts.Helvetica,
.FontSize = 11
}
g.DrawString("Generated 2026-05-26 — fluent code-first layout.", body, New PointF(72, 110))
doc.Save("statement.pdf")
End Sub
End Class// NuGet: Install-Package IronPdf
using IronPdf;
class Program
{
static void Main()
{
var renderer = new ChromePdfRenderer();
string html = @"<h1>Invoice 2026-0428</h1><p>Customer: Acme Corp</p><p>Total due: $1,240.00</p>";
using var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs("invoice.pdf");
}
}// NuGet: Install-Package IronPdf
using IronPdf;
class Program
{
static void Main()
{
var renderer = new ChromePdfRenderer();
string html = @"<h1>Invoice 2026-0428</h1><p>Customer: Acme Corp</p><p>Total due: $1,240.00</p>";
using var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs("invoice.pdf");
}
}Imports IronPdf
Class Program
Shared Sub Main()
Dim renderer = New ChromePdfRenderer()
Dim html As String = "<h1>Invoice 2026-0428</h1><p>Customer: Acme Corp</p><p>Total due: $1,240.00</p>"
Using pdf = renderer.RenderHtmlAsPdf(html)
pdf.SaveAs("invoice.pdf")
End Using
End Sub
End ClassDsPdf适用于希望通过流畅的布局API对文本布局进行原始级别控制的开发者。 IronPDF采取了不同的机制,通过捆绑的Chromium引擎加完整的字体管理API、通过WaitFor.AllFontsLoaded()支持网页字体和Google字体以及对TrueType集合的支持来渲染HTML和CSS。 IronPDF是从Web应用数据生成PDF时的正确选择 - DsPdf适用于设计页面布局为原始序列而不是HTML标记的开发者。
Excel处理
两个套件都涵盖Excel创建、公式重新计算和PDF导出。 DsExcel被广泛基准测试为.NET上最快的XLSX引擎之一,具有450多个内置功能。
// DsExcel is known for fast formula recalculation with 450+ built-in functions.
using GrapeCity.Documents.Excel;
class Program
{
static void Main()
{
Workbook book = new Workbook();
IWorksheet sheet = book.Worksheets[0];
sheet.Range["A1"].Value = "Region";
sheet.Range["B1"].Value = "Revenue";
sheet.Range["A2"].Value = "EMEA";
sheet.Range["B2"].Value = 120000;
sheet.Range["B4"].Formula = "=SUM(B2:B3)";
book.Calculate();
book.Save("revenue.xlsx");
book.Save("revenue.pdf");
}
}// DsExcel is known for fast formula recalculation with 450+ built-in functions.
using GrapeCity.Documents.Excel;
class Program
{
static void Main()
{
Workbook book = new Workbook();
IWorksheet sheet = book.Worksheets[0];
sheet.Range["A1"].Value = "Region";
sheet.Range["B1"].Value = "Revenue";
sheet.Range["A2"].Value = "EMEA";
sheet.Range["B2"].Value = 120000;
sheet.Range["B4"].Formula = "=SUM(B2:B3)";
book.Calculate();
book.Save("revenue.xlsx");
book.Save("revenue.pdf");
}
}Imports GrapeCity.Documents.Excel
Class Program
Shared Sub Main()
Dim book As New Workbook()
Dim sheet As IWorksheet = book.Worksheets(0)
sheet.Range("A1").Value = "Region"
sheet.Range("B1").Value = "Revenue"
sheet.Range("A2").Value = "EMEA"
sheet.Range("B2").Value = 120000
sheet.Range("B4").Formula = "=SUM(B2:B3)"
book.Calculate()
book.Save("revenue.xlsx")
book.Save("revenue.pdf")
End Sub
End Class// NuGet: Install-Package IronXL.Excel
using IronXL;
class Program
{
static void Main()
{
WorkBook workbook = WorkBook.Create(ExcelFileFormat.XLSX);
WorkSheet sheet = workbook.CreateWorkSheet("Sales");
sheet["A1"].Value = "Product";
sheet["B1"].Value = "Units";
sheet["A2"].Value = "Widget A";
sheet["B2"].Value = 1024;
sheet["A3"].Value = "Widget B";
sheet["B3"].Value = 768;
sheet["B4"].Formula = "=SUM(B2:B3)";
workbook.EvaluateAll();
workbook.SaveAs("sales.xlsx");
}
}// NuGet: Install-Package IronXL.Excel
using IronXL;
class Program
{
static void Main()
{
WorkBook workbook = WorkBook.Create(ExcelFileFormat.XLSX);
WorkSheet sheet = workbook.CreateWorkSheet("Sales");
sheet["A1"].Value = "Product";
sheet["B1"].Value = "Units";
sheet["A2"].Value = "Widget A";
sheet["B2"].Value = 1024;
sheet["A3"].Value = "Widget B";
sheet["B3"].Value = 768;
sheet["B4"].Formula = "=SUM(B2:B3)";
workbook.EvaluateAll();
workbook.SaveAs("sales.xlsx");
}
}Imports IronXL
Module Program
Sub Main()
Dim workbook As WorkBook = WorkBook.Create(ExcelFileFormat.XLSX)
Dim sheet As WorkSheet = workbook.CreateWorkSheet("Sales")
sheet("A1").Value = "Product"
sheet("B1").Value = "Units"
sheet("A2").Value = "Widget A"
sheet("B2").Value = 1024
sheet("A3").Value = "Widget B"
sheet("B3").Value = 768
sheet("B4").Formula = "=SUM(B2:B3)"
workbook.EvaluateAll()
workbook.SaveAs("sales.xlsx")
End Sub
End ModuleDsExcel已投入工程小时提高计算深度,450多个内置功能和多百万单元工作簿上快速计算。 IronXL涵盖了大多数后端XLSX工作所需的读/写/重新计算范围,提供符合现代.NET的索引器风格单元API(sheet["B4"].Formula = …, workbook.EvaluateAll())。 需要针对多百万单元工作簿进行繁重公式重新计算的工作负载偏好DsExcel; 日常的从数据库导出的数据到XLSX流程,可以更快地达到目标与IronXL。
文字处理
这两个套件都涵盖了DOCX的创建。 DsWord使用与DsPdf相同的流畅代码优先风格,直接将正文/段落/段落/运行模型映射到OOXML。
// DsWord generates and edits DOCX with a similar fluent code-first style.
using GrapeCity.Documents.Word;
class Program
{
static void Main()
{
GcWordDocument doc = new GcWordDocument();
Section section = doc.Body.Sections.Add();
Paragraph title = section.GetRange().Paragraphs.Add("Quarterly Report");
title.Style = doc.Styles[BuiltInStyleId.Heading1];
Paragraph body = section.GetRange().Paragraphs.Add(
"Generated from a .NET service with no Microsoft Word dependency.");
body.Style = doc.Styles[BuiltInStyleId.Normal];
doc.Save("report.docx");
doc.Save("report.pdf");
}
}// DsWord generates and edits DOCX with a similar fluent code-first style.
using GrapeCity.Documents.Word;
class Program
{
static void Main()
{
GcWordDocument doc = new GcWordDocument();
Section section = doc.Body.Sections.Add();
Paragraph title = section.GetRange().Paragraphs.Add("Quarterly Report");
title.Style = doc.Styles[BuiltInStyleId.Heading1];
Paragraph body = section.GetRange().Paragraphs.Add(
"Generated from a .NET service with no Microsoft Word dependency.");
body.Style = doc.Styles[BuiltInStyleId.Normal];
doc.Save("report.docx");
doc.Save("report.pdf");
}
}Imports GrapeCity.Documents.Word
Class Program
Shared Sub Main()
Dim doc As New GcWordDocument()
Dim section As Section = doc.Body.Sections.Add()
Dim title As Paragraph = section.GetRange().Paragraphs.Add("Quarterly Report")
title.Style = doc.Styles(BuiltInStyleId.Heading1)
Dim body As Paragraph = section.GetRange().Paragraphs.Add("Generated from a .NET service with no Microsoft Word dependency.")
body.Style = doc.Styles(BuiltInStyleId.Normal)
doc.Save("report.docx")
doc.Save("report.pdf")
End Sub
End Class// NuGet: Install-Package IronWord
using IronWord;
using IronWord.Models;
class Program
{
static void Main()
{
var doc = new WordDocument();
var heading = new Paragraph();
heading.AddChild(new TextRun("Quarterly Report — Q1 2026") { FontSize = 18, Bold = true });
doc.AddParagraph(heading);
var body = new Paragraph();
body.AddChild(new TextRun("Revenue grew 14% quarter-over-quarter."));
doc.AddParagraph(body);
doc.SaveAs("report.docx");
}
}// NuGet: Install-Package IronWord
using IronWord;
using IronWord.Models;
class Program
{
static void Main()
{
var doc = new WordDocument();
var heading = new Paragraph();
heading.AddChild(new TextRun("Quarterly Report — Q1 2026") { FontSize = 18, Bold = true });
doc.AddParagraph(heading);
var body = new Paragraph();
body.AddChild(new TextRun("Revenue grew 14% quarter-over-quarter."));
doc.AddParagraph(body);
doc.SaveAs("report.docx");
}
}Imports IronWord
Imports IronWord.Models
Class Program
Shared Sub Main()
Dim doc As New WordDocument()
Dim heading As New Paragraph()
heading.AddChild(New TextRun("Quarterly Report — Q1 2026") With {.FontSize = 18, .Bold = True})
doc.AddParagraph(heading)
Dim body As New Paragraph()
body.AddChild(New TextRun("Revenue grew 14% quarter-over-quarter."))
doc.AddParagraph(body)
doc.SaveAs("report.docx")
End Sub
End ClassDsWord的流畅风格与DsPdf和DsExcel一致; 一旦开发人员学会了一个Document Solutions API,他们实际上也学会了所有四个。 IronWord使用一个段落/文本运行对象图形,同样干净,并与Iron Suite的其余API风格一致。 两者都可以直接保存为PDF; DsWord通过其自身的文本布局引擎路由,IronWord通过HTML路由。
图像处理
DsImaging是四个.NET侧Document Solutions核心库之一,提供跨平台的图像处理基元。 Iron Suite不包含专用的图像处理库; 图像需求通常在IronPDF内部处理(渲染页面到图像),IronOCR(在OCR之前的图像预处理),或通过第三方成像库处理。
// DsImaging provides cross-platform image processing primitives that integrate with DsPdf and DsWord.
using GrapeCity.Documents.Imaging;
class Program
{
static void Main()
{
using GcBitmap source = new GcBitmap();
source.Load("source.jpg");
using GcBitmap thumbnail = source.Resize(240, 160, InterpolationMode.Cubic);
thumbnail.SaveAsJpeg("thumbnail.jpg");
}
}// DsImaging provides cross-platform image processing primitives that integrate with DsPdf and DsWord.
using GrapeCity.Documents.Imaging;
class Program
{
static void Main()
{
using GcBitmap source = new GcBitmap();
source.Load("source.jpg");
using GcBitmap thumbnail = source.Resize(240, 160, InterpolationMode.Cubic);
thumbnail.SaveAsJpeg("thumbnail.jpg");
}
}Imports GrapeCity.Documents.Imaging
Class Program
Shared Sub Main()
Using source As New GcBitmap()
source.Load("source.jpg")
Using thumbnail As GcBitmap = source.Resize(240, 160, InterpolationMode.Cubic)
thumbnail.SaveAsJpeg("thumbnail.jpg")
End Using
End Using
End Sub
End ClassIron Suite的成像路径位于IronOCR内(通过输入管道中去斜、去噪和对比对OCR馈送进行清理)。专用的光栅图象变换在OCR流程之外进行,调整大小、裁剪和格式转换作为独立的基元,是DsImaging构建的工作负载——Iron Suite的用户在需要这些光栅操作时,与专用成像库(例如ImageSharp)以及IronPDF和IronOCR组合使用。
为何选择Iron Suite进行代码优先的.NET文档自动化
十个产品在一个永久每开发者许可证之下。 $2,998入门级(与1,799美元MESCIUS .NET捆绑包相比)。 对许可的席位免版税部署。 带有约90%英语准确性的手写OCR。 30多种条形码符号。 ML驱动的QR。 在过程中进行网络抓取。 编程打印。 具有AES的ZIP/TAR/GZIP/BZIP2。 PDF/A-1到PDF/A-4。 PDF/UA-1和PDF/UA-2。这是针对跨越MESCIUS PDF/Excel/Word/Imaging象限的团队的Iron Suite proposition。 对日常代码优先.NET文档工作的结构性边缘:
- 永久所有权对比年度订阅:您拥有您购买的版本
- 较低入门级:Iron SuiteLite从$2,998开始; MESCIUS .NET捆绑包从$1,799开始
- 更广泛的10个产品捆绑包括OCR、条形码、QR、网络抓取、ZIP和打印,MESCIUS .NET目录中没有任何
- HTML优先PDF生成附有网页数据到PDF工作流的浏览器保真度
- 许可席位免版税部署为开箱即用; SaaS/OEM通过一个Redistribution Add-On
- 所有10个产品共享的单许可证密钥注册模型
Iron Suite与Document Solutions for .NET有何不同
- 更广泛的捆绑且价格更低。 Iron Suite覆盖了10个产品类别,其入门价格低于MESCIUS .NET Bundle的$1,799层级,并且增加了OCR、条形码、QR、抓取、ZIP和打印,而这些在MESCIUS中没有对应的。
- 永久对订阅。 Iron Suite开发者永久; Document Solutions是年度订阅,第一年后的续订费降低。
- 开箱即用的识别堆栈(IronOCR,IronBarcode,IronQR)。 MESCIUS在.NET目录中没有OCR或条形码产品。
- 支持PowerPoint。 IronPPT在捆绑包内覆盖PPTX; MESCIUS没有DsPowerPoint产品。
- HTML优先的PDF流程对比DsPdf的流畅原始级布局,不同的风格针对不同的工作负载(web数据对精确的程序化布局)。
- 品牌过渡面。 Document Solutions包现在作为
GrapeCity.Documents.</em>; 入门文档和工具配置可能需要在两个名称之间更新。
结论
Document Solutions for .NET和Iron Suite服务于相同的Office和PDF表面的不同编程风格。 Document Solutions提供一个流畅的代码优先PDF布局API(DsPdf)和一个深度的Excel计算引擎(DsExcel),这适用于报告重和金融服务工作流,围绕四个.NET库的订阅与维护模型。 Iron Suite提供了一个更广泛的十产品捆绑包,包括识别(IronOCR携手书写,IronBarcode,IronQR),网页抓取和相关实用程序,按五个等级销售为每开发人员的永久许可证,从$2,998起。 对于工作超出PDF和Office到识别和抓取的团队,Iron Suite捆绑包在ironsoftware.com/csharp/suite。
