产品比较

IronPDF与GroupDocs的比较

发布 2022年十一月15日
分享:

GroupDocs 和 IronPDF 都是跨平台应用程序,可为工程师提供文档自动化工具。 它们可以创建、编辑、格式化和打印 PDF 文档--当今流行的文档格式之一。 在使用 .NET 和 .NET Core 构建项目时,开发人员需要选择最适合项目的工具。

开发人员需要充分了解可用的库和工具。 PDF 图书馆也不例外。 由于每种工具都有自己的优缺点,开发人员应使用最适合业务和项目的工具。

本文将对 .NET 和 .NET Core 开发人员最常用的两个 PDF 库进行比较。 这两个图书馆是

  • 集团文件
  • IronPDF

什么是IronPDF?

IronPDF 是一款基于 C# 的商业 PDF 创建软件包,适用于 .NET 平台。 它可通过 HTML、CSS、图像和 JavaScript 生成 PDF。 它同样适用于网络应用程序、安全内网、控制台应用程序、WPF 应用程序和 MVC 模式网站。

IronPDF 兼容从第 4 版开始的所有 .NET Framework 和 .NET Core 项目。

什么是 GroupDocs 库?

GroupDocs.Editor API 是一个跨平台的 .NET 库,它使开发人员能够创建简单的应用程序,轻松与流行的 HTML 编辑器对接 (免费和付费) 转换、编辑和处理各种文件格式的文档。

开发人员可以使用 GroupDocs.Editor 加载文档,将其转换为 HTML,将 HTML 发送给外部编辑器,然后将 HTML 保存为原始格式。 此外,API 还可以访问编辑器内与文档链接的资源。 它支持多种网络和文字处理文件格式,包括 Microsoft Word、Microsoft Excel、OpenDocument、文本、水印等。

这两个图书馆有何不同? 让我们一探究竟。

注释 PDF 文档

GroupDocs.Annotation

GroupDocs.Annotation for .NET 使开发人员能够用 C#、ASP.NET 和其他能够执行文档注释功能的 .NET 技术制作应用程序。 该库支持的文档注释包括:绘制形状和箭头、放置点和呼出气泡、添加文本和图像、插入注释和突出显示、删除/下划线文本和图像等。 GroupDocs.Annoation 还可以操作文档注释。

注释文件后,图书馆可将文件保存为原始文件类型。 这款功能强大的文档注释器可以注释 PDF 文件、HTML 文件、Word 文档、Excel 电子表格、PowerPoint 演示文稿、Visio 文件、CAD 图纸、图像格式等。

// Initialize list of AnnotationInfo
List<AnnotationInfo> annotations = new List<AnnotationInfo>();
// Initialize text annotation
AnnotationInfo textAnnotation = new AnnotationInfo
{
  Box = new Rectangle((float)265.44, (float)153.86, 206, 36), Type = AnnotationType.Text
};
// Add annotation to list
annotations.Add(textAnnotation);
// Get input file stream
Stream inputFile = new FileStream("D:/input.pdf", FileMode.Open, File
.ReadWrite);
// Export annotation and savthe e output file
CommonUtilities.SaveOutputDocument(inputFile, annotations, DocumentType.Pdf);
// Initialize list of AnnotationInfo
List<AnnotationInfo> annotations = new List<AnnotationInfo>();
// Initialize text annotation
AnnotationInfo textAnnotation = new AnnotationInfo
{
  Box = new Rectangle((float)265.44, (float)153.86, 206, 36), Type = AnnotationType.Text
};
// Add annotation to list
annotations.Add(textAnnotation);
// Get input file stream
Stream inputFile = new FileStream("D:/input.pdf", FileMode.Open, File
.ReadWrite);
// Export annotation and savthe e output file
CommonUtilities.SaveOutputDocument(inputFile, annotations, DocumentType.Pdf);
' Initialize list of AnnotationInfo
Dim annotations As New List(Of AnnotationInfo)()
' Initialize text annotation
Dim textAnnotation As New AnnotationInfo With {
	.Box = New Rectangle(CSng(265.44), CSng(153.86), 206, 36),
	.Type = AnnotationType.Text
}
' Add annotation to list
annotations.Add(textAnnotation)
' Get input file stream
Dim inputFile As Stream = New FileStream("D:/input.pdf", FileMode.Open, File.ReadWrite)
' Export annotation and savthe e output file
CommonUtilities.SaveOutputDocument(inputFile, annotations, DocumentType.Pdf)
VB   C#

IronPDF

用户可以使用 "IronPDF.PdfDocument.AddTextAnnotation "方法和 "PdfDocument.TextAnnotation "类以编程方式为 PDF 文档添加注释。

using PdfDocument Pdf = PdfDocument.FromFile("existing.pdf");// Create a PDF annotation object
var Annotation = new IronPdf.Annotations.TextAnnotation()
{
    Title = "This is the major title",
    Subject = "This is a subtitle",
    Contents = "This is the long 'sticky note' comment content...",
    Icon = IronPdf.Annotations.TextAnnotation.AnnotationIcon.Help,
    Opacity = 0.9,
    Printable = false,
    Hidden = false,
    OpenByDefault = true,
    ReadOnly = false,
    Rotateable = true
};
// Add the annotation "sticky note" to a specific page and location within any new or existing PDF.
Pdf.AddTextAnnotation(Annotation, 1, 150, 250);
Pdf.SaveAs("existing.pdf");
using PdfDocument Pdf = PdfDocument.FromFile("existing.pdf");// Create a PDF annotation object
var Annotation = new IronPdf.Annotations.TextAnnotation()
{
    Title = "This is the major title",
    Subject = "This is a subtitle",
    Contents = "This is the long 'sticky note' comment content...",
    Icon = IronPdf.Annotations.TextAnnotation.AnnotationIcon.Help,
    Opacity = 0.9,
    Printable = false,
    Hidden = false,
    OpenByDefault = true,
    ReadOnly = false,
    Rotateable = true
};
// Add the annotation "sticky note" to a specific page and location within any new or existing PDF.
Pdf.AddTextAnnotation(Annotation, 1, 150, 250);
Pdf.SaveAs("existing.pdf");
IRON VB CONVERTER ERROR developers@ironsoftware.com
VB   C#

IronPDF 的文本注释功能包括添加/更改颜色、调整元素大小、设置不透明度、添加符号和编辑文本。

文件类型转换

将某些文件格式转换为 PDF 是保持文件完整性的一个重要方面。 让我们看看这两种软件解决方案是如何进行不同转换的。

使用 GroupDocs 将文件转换为 PDF

可使用 GroupDocs 的 GroupDocs.Conversion API 转换 MS Word、Excel、PowerPoint、Visio 和其他文档类型。 GroupDocs.Conversion是一个独立的应用程序接口,专为需要高速度的服务器端应用程序而设计。 它不依赖于 Microsoft Office 或 Open Office 等生产力软件套件。

在 C# 中将 XLSB 转换为 PDF;

XLSB (Excel 二进制文件格式) 是一种以二进制而非 XML 格式存储 Excel 工作簿数据的文件类型 (就像 Excel XLSX 文件类型一样).

下面的示例代码用 C# 将 XLSB 转换为 PDF。

using System;
using GroupDocs.Conversion.Options.Convert;
namespace ConvertXlsbToPdfInCSharp
{
    class Program
    {
        public static void Main(string [] args) // Main function to convert XLSB to PDF using C#
        {
            // Remove the watermathe rk in output PDF document by adding license
            string licensePath = "GroupDocs.Conversion.lic";
            GroupDocs.Conversion.License lic = new GroupDocs.Conversion.License();
            lic.SetLicense(licensePath);
            // Load the source XLSB file for conversion to PDF
            var converter = new GroupDocs.Conversion.Converter("sample.xlsb");
            // Set convert options for the PDF document
            var convertOptions = new PdfConvertOptions();
            // Convert and save the XLSB in PDF format
            converter.Convert("converted.pdf", convertOptions);
            Console.WriteLine("Done");
        }
    }
}
using System;
using GroupDocs.Conversion.Options.Convert;
namespace ConvertXlsbToPdfInCSharp
{
    class Program
    {
        public static void Main(string [] args) // Main function to convert XLSB to PDF using C#
        {
            // Remove the watermathe rk in output PDF document by adding license
            string licensePath = "GroupDocs.Conversion.lic";
            GroupDocs.Conversion.License lic = new GroupDocs.Conversion.License();
            lic.SetLicense(licensePath);
            // Load the source XLSB file for conversion to PDF
            var converter = new GroupDocs.Conversion.Converter("sample.xlsb");
            // Set convert options for the PDF document
            var convertOptions = new PdfConvertOptions();
            // Convert and save the XLSB in PDF format
            converter.Convert("converted.pdf", convertOptions);
            Console.WriteLine("Done");
        }
    }
}
IRON VB CONVERTER ERROR developers@ironsoftware.com
VB   C#

在 C# 中将 VSDX 转换为 PDF;

使用 GroupDocs.Conversion API 将 Visio VSDX 文件转换为 PDF 文件的步骤如下:

  1. 使用 NuGet 软件包管理器安装 GroupDocs.Conversion 库。
  2. 在项目源文件中包含 GroupDocs.Conversion 命名空间(s).
  3. 使用 VSDX 文件的位置实例化一个新的 GroupDocs.Conversion.Converter 对象。
  4. 创建 PdfConvertOptions 类的实例,并用它来指定文件转换选项。
  5. 调用转换器实例的 Convert 方法创建 PDF 文件。
using System;
using GroupDocs.Conversion.Options.Convert;
namespace ConvertVsdxToPdfInCSharp
{
    class Program
    {
        public static void Main(string [] args) // Main function to convert VSDX to PDF using C#
        {
            // Remove the watermark in output PDF document by adding license
            string licensePath = "GroupDocs.Conversion.lic";
            GroupDocs.Conversion.License lic = new GroupDocs.Conversion.License();
            lic.SetLicense(licensePath);
            // Load the source VSDX file for conversion to PDF
            var converter = new GroupDocs.Conversion.Converter("sample.vsdx");
            // Set the convert options for PDF document
            var convertOptions = new PdfConvertOptions();
            // Convert and save the VSDX in PDF format
            converter.Convert("converted.pdf", convertOptions);
            Console.WriteLine("Done");
        }
    }
}
using System;
using GroupDocs.Conversion.Options.Convert;
namespace ConvertVsdxToPdfInCSharp
{
    class Program
    {
        public static void Main(string [] args) // Main function to convert VSDX to PDF using C#
        {
            // Remove the watermark in output PDF document by adding license
            string licensePath = "GroupDocs.Conversion.lic";
            GroupDocs.Conversion.License lic = new GroupDocs.Conversion.License();
            lic.SetLicense(licensePath);
            // Load the source VSDX file for conversion to PDF
            var converter = new GroupDocs.Conversion.Converter("sample.vsdx");
            // Set the convert options for PDF document
            var convertOptions = new PdfConvertOptions();
            // Convert and save the VSDX in PDF format
            converter.Convert("converted.pdf", convertOptions);
            Console.WriteLine("Done");
        }
    }
}
IRON VB CONVERTER ERROR developers@ironsoftware.com
VB   C#

使用 C# 将 HTML 转换为 PDF;

此示例演示了如何使用 GroupDocs.Conversion 来实现以下功能 从 HTML 生成 PDF 文件. 它使用 Converter 类加载源文档,使用 PdfConvertOptions 类定义输出文档的属性,并使用 Convert 函数将源文档渲染为 PDF 文件。

using System;
using GroupDocs.Conversion.Options.Convert;
namespace ConvertVsdxToPdfInCSharp
{
    class Program
    {
        public static void Main(string [] args) // Main function to convert VSDX to PDF using C#
        {
            // Remove the watermark in output PDF document by adding license
            string licensePath = "GroupDocs.Conversion.lic";
            GroupDocs.Conversion.License lic = new GroupDocs.Conversion.License();
            lic.SetLicense(licensePath);
            // Load the source VSDX file for conversion to PDF
            var converter = new GroupDocs.Conversion.Converter("sample.vsdx");
            // Set the convert options for PDF document
            var convertOptions = new PdfConvertOptions();
            // Convert and save the VSDX in PDF format
            converter.Convert("converted.pdf", convertOptions);
            Console.WriteLine("Done");
        }
    }
}
using System;
using GroupDocs.Conversion.Options.Convert;
namespace ConvertVsdxToPdfInCSharp
{
    class Program
    {
        public static void Main(string [] args) // Main function to convert VSDX to PDF using C#
        {
            // Remove the watermark in output PDF document by adding license
            string licensePath = "GroupDocs.Conversion.lic";
            GroupDocs.Conversion.License lic = new GroupDocs.Conversion.License();
            lic.SetLicense(licensePath);
            // Load the source VSDX file for conversion to PDF
            var converter = new GroupDocs.Conversion.Converter("sample.vsdx");
            // Set the convert options for PDF document
            var convertOptions = new PdfConvertOptions();
            // Convert and save the VSDX in PDF format
            converter.Convert("converted.pdf", convertOptions);
            Console.WriteLine("Done");
        }
    }
}
IRON VB CONVERTER ERROR developers@ironsoftware.com
VB   C#

本示例只介绍了生成 PDF 文档的几个参数。 开发人员可以指定其他文件转换选项,如调整边际空间、设置密码、添加水印等。

使用 C# 将 RTF 转换为 PDF;

使用 GroupDocs 将 RTF 文件快速转换为 PDF:

  1. 首先安装所需的 NuGet 软件包 并在项目源代码中引用适当的命名空间
  2. 创建一个 Converter 类实例,以加载 RTF 源文件。
  3. 初始化一个 PdfConvertOptions 对象,用于定义渲染 PDF 文档的属性。
  4. 最后,利用 "Convert (传递输出位置和 PdfConvertOptions 实例) 将 RTF 文件渲染为 PDF 文件。
using System;
using GroupDocs.Conversion.Options.Convert;
namespace ConvertRtfToPdfUsingCSharp
{
    class Program
    {
        public static void Main(string [] args) // Main function to convert RTF to PDF using C#
        {
            // Remove the watermark in output PDF document by adding license
            string licensePath = "GroupDocs.Conversion.lic";
            GroupDocs.Conversion.License lic = new GroupDocs.Conversion.License();
            lic.SetLicense(licensePath);
            // Load the source RTF file for conversion to PDF
            var converter = new GroupDocs.Conversion.Converter("sample.rtf");
            // Set the properties for the output PDF document
            var convertOptions = new PdfConvertOptions()
            {
                Height = 500,
                Width = 500,
                Dpi = 100,
                PageNumber = 1,
                PagesCount = 1
            };
            // Convert and save the RTF in PDF format
            converter.Convert("converted.pdf", convertOptions);
            Console.WriteLine("Done");
        }
    }
}
using System;
using GroupDocs.Conversion.Options.Convert;
namespace ConvertRtfToPdfUsingCSharp
{
    class Program
    {
        public static void Main(string [] args) // Main function to convert RTF to PDF using C#
        {
            // Remove the watermark in output PDF document by adding license
            string licensePath = "GroupDocs.Conversion.lic";
            GroupDocs.Conversion.License lic = new GroupDocs.Conversion.License();
            lic.SetLicense(licensePath);
            // Load the source RTF file for conversion to PDF
            var converter = new GroupDocs.Conversion.Converter("sample.rtf");
            // Set the properties for the output PDF document
            var convertOptions = new PdfConvertOptions()
            {
                Height = 500,
                Width = 500,
                Dpi = 100,
                PageNumber = 1,
                PagesCount = 1
            };
            // Convert and save the RTF in PDF format
            converter.Convert("converted.pdf", convertOptions);
            Console.WriteLine("Done");
        }
    }
}
Imports System
Imports GroupDocs.Conversion.Options.Convert
Namespace ConvertRtfToPdfUsingCSharp
	Friend Class Program
		Public Shared Sub Main(ByVal args() As String) ' Main function to convert RTF to PDF using C#
			' Remove the watermark in output PDF document by adding license
			Dim licensePath As String = "GroupDocs.Conversion.lic"
			Dim lic As New GroupDocs.Conversion.License()
			lic.SetLicense(licensePath)
			' Load the source RTF file for conversion to PDF
			Dim converter = New GroupDocs.Conversion.Converter("sample.rtf")
			' Set the properties for the output PDF document
			Dim convertOptions = New PdfConvertOptions() With {
				.Height = 500,
				.Width = 500,
				.Dpi = 100,
				.PageNumber = 1,
				.PagesCount = 1
			}
			' Convert and save the RTF in PDF format
			converter.Convert("converted.pdf", convertOptions)
			Console.WriteLine("Done")
		End Sub
	End Class
End Namespace
VB   C#

在 C&#35 中将 Excel 转换为 PDF;

using System;
using GroupDocs.Conversion.Options.Convert;
namespace ConvertExcelToPdfInCSharp
{
    class Program
    {
        public static void Main(string [] args) // Main function to convert Excel to PDF using C#
        {
            // Remove the watermark in output PDF document by adding license
            string licensePath = "GroupDocs.Conversion.lic";
            GroupDocs.Conversion.License lic = new GroupDocs.Conversion.License();
            lic.SetLicense(licensePath);
            // Load the source Excel file for conversion to PDF
            var converter = new GroupDocs.Conversion.Converter("sample.xlsx");
            // Set the starting sheet number and consecutive sheet count
            var convertOptions = new PdfConvertOptions()
            {
                PageNumber = 1,
                PagesCount = 2
            };
            // Convert and save the Excel in PDF format
            converter.Convert("converted.pdf", convertOptions);
            Console.WriteLine("Done");
        }
    }
}
using System;
using GroupDocs.Conversion.Options.Convert;
namespace ConvertExcelToPdfInCSharp
{
    class Program
    {
        public static void Main(string [] args) // Main function to convert Excel to PDF using C#
        {
            // Remove the watermark in output PDF document by adding license
            string licensePath = "GroupDocs.Conversion.lic";
            GroupDocs.Conversion.License lic = new GroupDocs.Conversion.License();
            lic.SetLicense(licensePath);
            // Load the source Excel file for conversion to PDF
            var converter = new GroupDocs.Conversion.Converter("sample.xlsx");
            // Set the starting sheet number and consecutive sheet count
            var convertOptions = new PdfConvertOptions()
            {
                PageNumber = 1,
                PagesCount = 2
            };
            // Convert and save the Excel in PDF format
            converter.Convert("converted.pdf", convertOptions);
            Console.WriteLine("Done");
        }
    }
}
Imports System
Imports GroupDocs.Conversion.Options.Convert
Namespace ConvertExcelToPdfInCSharp
	Friend Class Program
		Public Shared Sub Main(ByVal args() As String) ' Main function to convert Excel to PDF using C#
			' Remove the watermark in output PDF document by adding license
			Dim licensePath As String = "GroupDocs.Conversion.lic"
			Dim lic As New GroupDocs.Conversion.License()
			lic.SetLicense(licensePath)
			' Load the source Excel file for conversion to PDF
			Dim converter = New GroupDocs.Conversion.Converter("sample.xlsx")
			' Set the starting sheet number and consecutive sheet count
			Dim convertOptions = New PdfConvertOptions() With {
				.PageNumber = 1,
				.PagesCount = 2
			}
			' Convert and save the Excel in PDF format
			converter.Convert("converted.pdf", convertOptions)
			Console.WriteLine("Done")
		End Sub
	End Class
End Namespace
VB   C#

在 C#中将图像转换为 PDF;

使用 GroupDocs,只需几行代码就能将 JPG 图像格式转换为 PDF 文档。 GroupDocs 可轻松转换其他图像类型,如 PNG、TIFF、BMP 等。

using System;
using GroupDocs.Conversion.Options.Convert;
namespace ConvertExcelToPdfInCSharp
{
    class Program
    {
        public static void Main(string [] args) // Main function to convert Excel to PDF using C#
        {
            // Remove the watermark in output PDF document by adding license
            string licensePath = "GroupDocs.Conversion.lic";
            GroupDocs.Conversion.License lic = new GroupDocs.Conversion.License();
            lic.SetLicense(licensePath);
            // Load the source Excel file for conversion to PDF
            var converter = new GroupDocs.Conversion.Converter("sample.xlsx");
            // Set the starting sheet number and consecutive sheet count
            var convertOptions = new PdfConvertOptions()
            {
                PageNumber = 1,
                PagesCount = 2
            };
            // Convert and save the Excel in PDF format
            converter.Convert("converted.pdf", convertOptions);
            Console.WriteLine("Done");
        }
    }
}
using System;
using GroupDocs.Conversion.Options.Convert;
namespace ConvertExcelToPdfInCSharp
{
    class Program
    {
        public static void Main(string [] args) // Main function to convert Excel to PDF using C#
        {
            // Remove the watermark in output PDF document by adding license
            string licensePath = "GroupDocs.Conversion.lic";
            GroupDocs.Conversion.License lic = new GroupDocs.Conversion.License();
            lic.SetLicense(licensePath);
            // Load the source Excel file for conversion to PDF
            var converter = new GroupDocs.Conversion.Converter("sample.xlsx");
            // Set the starting sheet number and consecutive sheet count
            var convertOptions = new PdfConvertOptions()
            {
                PageNumber = 1,
                PagesCount = 2
            };
            // Convert and save the Excel in PDF format
            converter.Convert("converted.pdf", convertOptions);
            Console.WriteLine("Done");
        }
    }
}
Imports System
Imports GroupDocs.Conversion.Options.Convert
Namespace ConvertExcelToPdfInCSharp
	Friend Class Program
		Public Shared Sub Main(ByVal args() As String) ' Main function to convert Excel to PDF using C#
			' Remove the watermark in output PDF document by adding license
			Dim licensePath As String = "GroupDocs.Conversion.lic"
			Dim lic As New GroupDocs.Conversion.License()
			lic.SetLicense(licensePath)
			' Load the source Excel file for conversion to PDF
			Dim converter = New GroupDocs.Conversion.Converter("sample.xlsx")
			' Set the starting sheet number and consecutive sheet count
			Dim convertOptions = New PdfConvertOptions() With {
				.PageNumber = 1,
				.PagesCount = 2
			}
			' Convert and save the Excel in PDF format
			converter.Convert("converted.pdf", convertOptions)
			Console.WriteLine("Done")
		End Sub
	End Class
End Namespace
VB   C#

GroupDocs API 可将照片转换为其他文档格式,如 Microsoft Word、Excel 和 PowerPoint。

使用 IronPDF 将文件转换为 PDF

IronPDF for .NET Core 和 .NET Framework 使用 Chromium 运行时引擎将 HTML 内容转换为 PDF 文件。 HTML 是 IronPDF 核心功能的基础。 它将 HTML 文档渲染成 PDF 文件的效果堪称完美,与桌面版 Google Chrome 浏览器上的效果完全相同。

图书馆为此提供了多种选择。 下文将详细探讨其中一些问题。

HTML 转 PDF

IronPDF 可以将原始 HTML、CSS 和 JavaScript 源代码直接渲染为 PDF 文件,如下图所示。

using IronPdf;
var Renderer = new IronPdf.ChromePdfRenderer();
using var PDF = Renderer.RenderHtmlAsPdf("<h1>Html with CSS and Images</h1>")
PDF.SaveAs("pixel-perfect.pdf");
/****** Advanced ******/
// Load external html assets: images, css and javascript.
// An optional BasePath 'C:\site\assets\' is set as the file location to load assets from
using var AdvancedPDF = Renderer.RenderHtmlAsPdf("<img src='icons/iron.png'>", @"C:\site\assets\");
AdvancedPDF.SaveAs("html-with-assets.pdf");
using IronPdf;
var Renderer = new IronPdf.ChromePdfRenderer();
using var PDF = Renderer.RenderHtmlAsPdf("<h1>Html with CSS and Images</h1>")
PDF.SaveAs("pixel-perfect.pdf");
/****** Advanced ******/
// Load external html assets: images, css and javascript.
// An optional BasePath 'C:\site\assets\' is set as the file location to load assets from
using var AdvancedPDF = Renderer.RenderHtmlAsPdf("<img src='icons/iron.png'>", @"C:\site\assets\");
AdvancedPDF.SaveAs("html-with-assets.pdf");
Imports IronPdf
Private Renderer = New IronPdf.ChromePdfRenderer()
Private PDF = Renderer.RenderHtmlAsPdf("<h1>Html with CSS and Images</h1>") PDF.SaveAs("pixel-perfect.pdf")
'''**** Advanced *****
' Load external html assets: images, css and javascript.
' An optional BasePath 'C:\site\assets\' is set as the file location to load assets from
Private AdvancedPDF = Renderer.RenderHtmlAsPdf("<img src='icons/iron.png'>", "C:\site\assets\")
AdvancedPDF.SaveAs("html-with-assets.pdf")
VB   C#

URL 到 PDF

IronPDF 可轻松地从现有 URL 将 HTML 转换为 PDF 文档。

using IronPdf;
IronPdf.ChromePdfRenderer Renderer = new IronPdf.ChromePdfRenderer();
using var Pdf = Renderer.RenderUrlAsPdf("https://ironpdf.com/");
Pdf.SaveAs("url.pdf");
using IronPdf;
IronPdf.ChromePdfRenderer Renderer = new IronPdf.ChromePdfRenderer();
using var Pdf = Renderer.RenderUrlAsPdf("https://ironpdf.com/");
Pdf.SaveAs("url.pdf");
Imports IronPdf
Private Renderer As New IronPdf.ChromePdfRenderer()
Private Pdf = Renderer.RenderUrlAsPdf("https://ironpdf.com/")
Pdf.SaveAs("url.pdf")
VB   C#

有了这项功能,设计人员和编码人员可以通过支持查询字符串变量的 ASP.NET URL 渲染 PDF,从而更高效地协作开发 PDF。

ASPX 页面到 PDF

IronPDF 库可以渲染 ASP.NET 只需在应用程序的 "Form_Load "事件中添加一行代码,就能将网页转换为 PDF 而不是 HTML:

private void Form1_Load(object sender, EventArgs e)
{
    IronPdf.AspxToPdf.RenderThisPageAsPdf();
}
private void Form1_Load(object sender, EventArgs e)
{
    IronPdf.AspxToPdf.RenderThisPageAsPdf();
}
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
	IronPdf.AspxToPdf.RenderThisPageAsPdf()
End Sub
VB   C#

这样,数据驱动的 PDF 就可以先以 HTML 的形式进行设计和测试,以简化操作。

图像转换为PDF

使用 "IronPDF.ImageToPdfConverter "类可以轻松地从一个或多个图像文件创建 PDF 文档。

// PM> Install-Package IronPdf
using IronPdf;
using System.IO;
using System.Linq;
// One or more images as IEnumerable.  This example selects all JPEG images in a spe-cific folder.
var ImageFiles = System.IO.Directory.EnumerateFiles(@"C:\project\assets").Where(f => f.EndsWith(".jpg") 
 f.EndsWith(".jpeg"));
// Convert the images to a PDF and save it.
ImageToPdfConverter.ImageToPdf(ImageFiles).SaveAs(@"C:\project\composite.pdf");
//Also see PdfDocument.RasterizeToImageFiles() method to flatten a PDF to images or thumbnails
// PM> Install-Package IronPdf
using IronPdf;
using System.IO;
using System.Linq;
// One or more images as IEnumerable.  This example selects all JPEG images in a spe-cific folder.
var ImageFiles = System.IO.Directory.EnumerateFiles(@"C:\project\assets").Where(f => f.EndsWith(".jpg") 
 f.EndsWith(".jpeg"));
// Convert the images to a PDF and save it.
ImageToPdfConverter.ImageToPdf(ImageFiles).SaveAs(@"C:\project\composite.pdf");
//Also see PdfDocument.RasterizeToImageFiles() method to flatten a PDF to images or thumbnails
' PM> Install-Package IronPdf
Imports IronPdf
Imports System.IO
Imports System.Linq
' One or more images as IEnumerable.  This example selects all JPEG images in a spe-cific folder.
Private ImageFiles = System.IO.Directory.EnumerateFiles("C:\project\assets").Where(Function(f) f.EndsWith(".jpg") f.EndsWith(".jpeg"))
' Convert the images to a PDF and save it.
ImageToPdfConverter.ImageToPdf(ImageFiles).SaveAs("C:\project\composite.pdf")
'Also see PdfDocument.RasterizeToImageFiles() method to flatten a PDF to images or thumbnails
VB   C#

在HTML中将JavaScript转为PDF

IronPDF 在 HTML 到 PDF 的转换中包含全面的 JavaScript 兼容性,包括支持 Angular.js 和其他流行的前端和单页网页框架。

IronPDF 允许用户使用 JavaScript 在 PDF 中嵌入图片和其他内容类型。 该库可将它们直接嵌入 HTML 字符串。

IronPDF 可以通过这种方式嵌入的内容包括 (但不限于):

  • 带图像的文件
  • 系统.绘图.图像
  • 系统.绘图.位图

    这对于在 HTML 到 PDF 的渲染过程中避免外部加载资产非常有用。 它可以提高速度,并允许对存储在字符串或数据库等非文件系统位置的作业进行整体渲染。

// PM> Install-Package IronPdf
using IronPdf;
var htmlWithJs = @"
    <h1>This is HTML</h1>
    <script>
          document.write('<h1>This is JavaScript</h1>');
    </script>";
var Renderer = new IronPdf.ChromePdfRenderer();
Renderer.RenderingOptions.EnableJavaScript = true;
Renderer.RenderingOptions.RenderDelay = 100;
using var pdfdoc = Renderer.RenderHtmlAsPdf(htmlWithJs);
pdfdoc.SaveAs("js.pdf");
// PM> Install-Package IronPdf
using IronPdf;
var htmlWithJs = @"
    <h1>This is HTML</h1>
    <script>
          document.write('<h1>This is JavaScript</h1>');
    </script>";
var Renderer = new IronPdf.ChromePdfRenderer();
Renderer.RenderingOptions.EnableJavaScript = true;
Renderer.RenderingOptions.RenderDelay = 100;
using var pdfdoc = Renderer.RenderHtmlAsPdf(htmlWithJs);
pdfdoc.SaveAs("js.pdf");
' PM> Install-Package IronPdf
Imports IronPdf
Private htmlWithJs = "
    <h1>This is HTML</h1>
    <script>
          document.write('<h1>This is JavaScript</h1>');
    </script>"
Private Renderer = New IronPdf.ChromePdfRenderer()
Renderer.RenderingOptions.EnableJavaScript = True
Renderer.RenderingOptions.RenderDelay = 100
Dim pdfdoc = Renderer.RenderHtmlAsPdf(htmlWithJs)
pdfdoc.SaveAs("js.pdf")
VB   C#

Angular.JS 转 PDF

对于利用 Angular 动态加载内容的网页,IronPDF 可以为异步内容加载预留时间。

在下面的示例中,程序将等待半秒后再显示整个网页。

// PM> Install-Package IronPdf
using IronPdf;
var Renderer = new IronPdf.ChromePdfRenderer();
Renderer.RenderingOptions.EnableJavaScript = true;
Renderer.RenderingOptions.RenderDelay = 500;
using var pdfdoc = Renderer.RenderUrlAsPdf("https://angular.io/");
pdfdoc.SaveAs("angular.pdf");
// PM> Install-Package IronPdf
using IronPdf;
var Renderer = new IronPdf.ChromePdfRenderer();
Renderer.RenderingOptions.EnableJavaScript = true;
Renderer.RenderingOptions.RenderDelay = 500;
using var pdfdoc = Renderer.RenderUrlAsPdf("https://angular.io/");
pdfdoc.SaveAs("angular.pdf");
' PM> Install-Package IronPdf
Imports IronPdf
Private Renderer = New IronPdf.ChromePdfRenderer()
Renderer.RenderingOptions.EnableJavaScript = True
Renderer.RenderingOptions.RenderDelay = 500
Dim pdfdoc = Renderer.RenderUrlAsPdf("https://angular.io/")
pdfdoc.SaveAs("angular.pdf")
VB   C#

PDF 文档签名

PDF 文件是存储数据、保留文档布局以及保存字体和图形的绝佳工具。 在家工作已成为我们这个世界的常态。 填写和签署文件、递送文件和处理文件只是各组织必须完成的几项日常任务。 提供 PDF 签名以替代实物签名现在已成为一项重要活动。 随着企业寻求签署协议和合同以及在线交换 PDF 文档的新方法,数字签名变得越来越重要。

使用 Groupdocs 进行数字文件签署

使用 GroupDocs.Signature for .NET API,在 C#、ASP.NET 和其他基于 .NET 的技术中构建应用程序,让用户无需安装任何其他第三方软件即可签署数字商业文档。 该电子签名库易于使用。 .NET 开发人员可以将广泛的数字签名功能集成到他们的应用程序中,使用户可以对各种文档类型进行签名、执行搜索操作和验证电子签名。

GroupDocs.Signature 支持 PDF、Word、Excel、PowerPoint、OpenDocument、图像和其他行业标准文件格式。 它可以使用文本、图像、条形码、二维码、表单字段、印章和元数据作为签名类型。

using (Signature signature = new Signature("D:\\sample.pdf"))
{
TextSignOptions options = new TextSignOptions("John Smith")
{
// set Text color
ForeColor = Color.Red
};
// sign document to file
signature.Sign("D:\\signed.pdf", options);
}
using (Signature signature = new Signature("D:\\sample.pdf"))
{
TextSignOptions options = new TextSignOptions("John Smith")
{
// set Text color
ForeColor = Color.Red
};
// sign document to file
signature.Sign("D:\\signed.pdf", options);
}
Using signature As New Signature("D:\sample.pdf")
Dim options As New TextSignOptions("John Smith") With {.ForeColor = Color.Red}
' sign document to file
signature.Sign("D:\signed.pdf", options)
End Using
VB   C#

IronPDF 数字文件签署流程

IronPDF 是在台式电脑上开展所有基于 C# 的 PDF 活动的绝佳选择。 开发人员可以用它来添加签名、填写和签署 PDF 文档、加密保护 PDF 表单,甚至添加签名图像。

开发人员经常询问如何利用 IronPDF 和 C# 以编程方式在 PDF 中添加签名。 这对开发人员来说有多种含义:

  • 从图像文件向现有 PDF 文件添加图形数字签名图像
  • 对 PDF 文件进行加密签名,以确认未经他人篡改
  • 为已加密签名的 PDF 添加人工手写签名图标。

    第一种方法是在已存在的 PDF 页面上印上签名 PNG。 它可以用作签名或公司印章。只需几行代码即可完成该程序。

// open an existing PDF document or create a new one
PdfDocument Pdf = PdfDocument.FromFile(@"C:\Path\To\ASPX to PDF.pdf");
var SignatureStamp = new HtmlStamp() { Html = "<img src='signature.png' />", Width = 150, Height = 50, Bottom = 300, Left=85, ZIndex = HtmlStamp.StampLayer.OnTopOfExistingPDFContent };
Pdf.StampHTML(SignatureStamp,1);
Pdf.SaveAs(@"C:\Path\To\ASPX to PDF.pdf");
// open an existing PDF document or create a new one
PdfDocument Pdf = PdfDocument.FromFile(@"C:\Path\To\ASPX to PDF.pdf");
var SignatureStamp = new HtmlStamp() { Html = "<img src='signature.png' />", Width = 150, Height = 50, Bottom = 300, Left=85, ZIndex = HtmlStamp.StampLayer.OnTopOfExistingPDFContent };
Pdf.StampHTML(SignatureStamp,1);
Pdf.SaveAs(@"C:\Path\To\ASPX to PDF.pdf");
' open an existing PDF document or create a new one
Dim Pdf As PdfDocument = PdfDocument.FromFile("C:\Path\To\ASPX to PDF.pdf")
Dim SignatureStamp = New HtmlStamp() With {
	.Html = "<img src='signature.png' />",
	.Width = 150,
	.Height = 50,
	.Bottom = 300,
	.Left=85,
	.ZIndex = HtmlStamp.StampLayer.OnTopOfExistingPDFContent
}
Pdf.StampHTML(SignatureStamp,1)
Pdf.SaveAs("C:\Path\To\ASPX to PDF.pdf")
VB   C#

以下代码使用 .pfx.p12 X509Certificate2 数字证书对 PDF 文件进行加密签名。

// 123456 below represents the signature password
new IronPdf.PdfSignature("CertificateFile.p12", "123456").SignPdfFile("ASPX to PDF.pdf");
// 123456 below represents the signature password
new IronPdf.PdfSignature("CertificateFile.p12", "123456").SignPdfFile("ASPX to PDF.pdf");
' 123456 below represents the signature password
Call (New IronPdf.PdfSignature("CertificateFile.p12", "123456")).SignPdfFile("ASPX to PDF.pdf")
VB   C#

下面这个更复杂的例子使用了 X509Certificate2 数字身份证签名方法和手写签名扫描件。

var Signature = new IronPdf.PdfSignature("Iron.pfx", "123456");
PdfDocument doc = Renderer.RenderHtmlAsPdf("<h1>Testing 2048 bit digital securi-ty</h1>");
// Step 3. Optional signing options and a handwritten Signature graphic
Signature.SigningContact = "support@ironsoftware.com";
Signature.SigningLocation = "Chicago, USA";
Signature.SigningReason = "To show how to sign a PDF";
Signature.LoadSignatureImageFromFile("handwriting.png");
doc.SignPdfWithDigitalSignature(Signature);
doc.SaveAs("ASPX to PDF.pdf"); 
var Signature = new IronPdf.PdfSignature("Iron.pfx", "123456");
PdfDocument doc = Renderer.RenderHtmlAsPdf("<h1>Testing 2048 bit digital securi-ty</h1>");
// Step 3. Optional signing options and a handwritten Signature graphic
Signature.SigningContact = "support@ironsoftware.com";
Signature.SigningLocation = "Chicago, USA";
Signature.SigningReason = "To show how to sign a PDF";
Signature.LoadSignatureImageFromFile("handwriting.png");
doc.SignPdfWithDigitalSignature(Signature);
doc.SaveAs("ASPX to PDF.pdf"); 
Dim Signature = New IronPdf.PdfSignature("Iron.pfx", "123456")
Dim doc As PdfDocument = Renderer.RenderHtmlAsPdf("<h1>Testing 2048 bit digital securi-ty</h1>")
' Step 3. Optional signing options and a handwritten Signature graphic
Signature.SigningContact = "support@ironsoftware.com"
Signature.SigningLocation = "Chicago, USA"
Signature.SigningReason = "To show how to sign a PDF"
Signature.LoadSignatureImageFromFile("handwriting.png")
doc.SignPdfWithDigitalSignature(Signature)
doc.SaveAs("ASPX to PDF.pdf")
VB   C#

合并 PDF 文件

使用 GroupDocs.Merger 合并 PDF 文件

当需要将多个 PDF 文件合并为一个文档或提供更少的附件时,GroupDocs.Merger 允许开发人员合并 PDF 文件。 GroupDocs.Merger 无需使用第三方软件或进行任何手工操作即可实现这一目标。

GroupDocs.Merger 可以合并任何大小和结构的 PDF 文档。 API 将保留所有文本、照片、表格、图形、表单和其他内容的原始大小和格式。

通过几行 C# 代码,下面的示例展示了如何合并 PDF 文件:

  • 创建一个 Merger 实例,并提供 PDF 源文件的路径作为构造参数。 您可以根据需要指定绝对或相对文件路径。
  • 使用 Join 方法将文档合并在一起。 对要集成的其他 PDF 文档重复上述步骤。
  • 使用输出文件位置调用 Save 方法保存生成的 PDF 文档。
// Load the source PDF file
using (Merger merger = new Merger(@"c:\sample1.pdf"))
{
    // Add another PDF file to merge
    merger.Join(@"c:\sample2.pdf");
    // Merge PDF files and save result
    merger.Save(@"c:\merged.pdf");
}
// Load the source PDF file
using (Merger merger = new Merger(@"c:\sample1.pdf"))
{
    // Add another PDF file to merge
    merger.Join(@"c:\sample2.pdf");
    // Merge PDF files and save result
    merger.Save(@"c:\merged.pdf");
}
' Load the source PDF file
Using merger As New Merger("c:\sample1.pdf")
	' Add another PDF file to merge
	merger.Join("c:\sample2.pdf")
	' Merge PDF files and save result
	merger.Save("c:\merged.pdf")
End Using
VB   C#

使用 IronPDF 合并 PDF 文件

IronPDF for .NET 使用 IronPdf.PdfDocument.Merge 在 C#.NET 中轻松合并两个或多个 PDF 文档。

// PM> Install-Package IronPdf
using IronPdf;
var html_a = @"<p> [PDF_A] </p>
        <p> [PDF_A] 1st Page </p>
        <div style = 'page-break-after: always;' ></div>
        <p> [PDF_A] 2nd Page</p>";
var html_b = @"<p> [PDF_B] </p>
        <p> [PDF_B] 1st Page </p>
        <div style = 'page-break-after: always;' ></div>
        <p> [PDF_B] 2nd Page</p>";
var Renderer = new IronPdf.ChromePdfRenderer();
using var pdfdoc_a = Renderer.RenderHtmlAsPdf(html_a);
using var pdfdoc_b = Renderer.RenderHtmlAsPdf(html_b);
using var merged = IronPdf.PdfDocument.Merge(pdfdoc_a, pdfdoc_b);
merged.SaveAs("Merged.pdf");
// PM> Install-Package IronPdf
using IronPdf;
var html_a = @"<p> [PDF_A] </p>
        <p> [PDF_A] 1st Page </p>
        <div style = 'page-break-after: always;' ></div>
        <p> [PDF_A] 2nd Page</p>";
var html_b = @"<p> [PDF_B] </p>
        <p> [PDF_B] 1st Page </p>
        <div style = 'page-break-after: always;' ></div>
        <p> [PDF_B] 2nd Page</p>";
var Renderer = new IronPdf.ChromePdfRenderer();
using var pdfdoc_a = Renderer.RenderHtmlAsPdf(html_a);
using var pdfdoc_b = Renderer.RenderHtmlAsPdf(html_b);
using var merged = IronPdf.PdfDocument.Merge(pdfdoc_a, pdfdoc_b);
merged.SaveAs("Merged.pdf");
' PM> Install-Package IronPdf
Imports IronPdf
Private html_a = "<p> [PDF_A] </p>
        <p> [PDF_A] 1st Page </p>
        <div style = 'page-break-after: always;' ></div>
        <p> [PDF_A] 2nd Page</p>"
Private html_b = "<p> [PDF_B] </p>
        <p> [PDF_B] 1st Page </p>
        <div style = 'page-break-after: always;' ></div>
        <p> [PDF_B] 2nd Page</p>"
Private Renderer = New IronPdf.ChromePdfRenderer()
Private pdfdoc_a = Renderer.RenderHtmlAsPdf(html_a)
Private pdfdoc_b = Renderer.RenderHtmlAsPdf(html_b)
Private merged = IronPdf.PdfDocument.Merge(pdfdoc_a, pdfdoc_b)
merged.SaveAs("Merged.pdf")
VB   C#

分割 PDF 文档格式

使用 IronPDF 进行拆分

IronPDF 可以通过将单页或页面范围提取到新的 IronPdf.PdfDocument 对象中来拆分 PDF 文档。 IronPDF.PdfDocument.CopyPage "可以从一个或多个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();
using var pdfdoc = Renderer.RenderHtmlAsPdf(html);
using var pdfdoc_page1 = pdfdoc.CopyPage(0);
pdfdoc_page1.SaveAs("Spli1.pdf");
using var pdfdoc_page2_3 = pdfdoc.CopyPages(1, 2);
pdfdoc_page2_3.SaveAs("Spli2.pdf");
//take the pages 2 & 3
// 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();
using var pdfdoc = Renderer.RenderHtmlAsPdf(html);
using var pdfdoc_page1 = pdfdoc.CopyPage(0);
pdfdoc_page1.SaveAs("Spli1.pdf");
using var pdfdoc_page2_3 = pdfdoc.CopyPages(1, 2);
pdfdoc_page2_3.SaveAs("Spli2.pdf");
//take the pages 2 & 3
' 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()
Private pdfdoc = Renderer.RenderHtmlAsPdf(html)
Private pdfdoc_page1 = pdfdoc.CopyPage(0)
pdfdoc_page1.SaveAs("Spli1.pdf")
Dim pdfdoc_page2_3 = pdfdoc.CopyPages(1, 2)
pdfdoc_page2_3.SaveAs("Spli2.pdf")
'take the pages 2 & 3
VB   C#

使用 GroupDocs 分割

GroupDocs.Merger 可将源文件分割成多个结果文件。 通过指定页码数组、起始/结束页码和不同的拆分选项模式,可以以不同的方式拆分文档。 以下是可能的使用案例:

  1. 指定了页码数组,分割模式设置为 SplitMode.Pages --- 页码表示存储在单独一页文档中的准确页码。 例如:阵列{ 3, 6, 8 } 将生成 3 份文件,分别为第 3 页、第 6 页和第 8 页。
  2. 指定页码数组,并将分割模式设置为 "SplitMode.Interval"--给定的页码表示在单独的多页文档中保存的页面间隔的边界。 例如:阵列{ 3, 6, 8 } 将产生 1-2、3-5、6-7、8-10 共 4 页的间隔。

    还可以设置 ParameterRangeMode 选项,从所需的页面范围中只获取偶数或奇数页面。

    按照准确的页码将文件拆分成若干单页文件

string filePath = @"c:\sample.docx";
string filePathOut = @"c:\output\document_{0}.{1}";
SplitOptions splitOptions = new SplitOptions(filePathOut, new int [] { 3, 6, 8 });
using (Merger merger = new Merger(filePath))
{
     merger.Split(splitOptions);
}
string filePath = @"c:\sample.docx";
string filePathOut = @"c:\output\document_{0}.{1}";
SplitOptions splitOptions = new SplitOptions(filePathOut, new int [] { 3, 6, 8 });
using (Merger merger = new Merger(filePath))
{
     merger.Split(splitOptions);
}
Dim filePath As String = "c:\sample.docx"
Dim filePathOut As String = "c:\output\document_{0}.{1}"
Dim splitOptions As New SplitOptions(filePathOut, New Integer () { 3, 6, 8 })
Using merger As New Merger(filePath)
	 merger.Split(splitOptions)
End Using
VB   C#

按起始/结束页码将文件拆分成若干单页文件

string filePath = @"c:\sample.docx";
string filePathOut = @"c:\output\document_{0}.{1}";
SplitOptions splitOptions = new SplitOptions(filePathOut, 3, 7);
using (Merger merger = new Merger(filePath))
{
     merger.Split(splitOptions);
}
string filePath = @"c:\sample.docx";
string filePathOut = @"c:\output\document_{0}.{1}";
SplitOptions splitOptions = new SplitOptions(filePathOut, 3, 7);
using (Merger merger = new Merger(filePath))
{
     merger.Split(splitOptions);
}
Dim filePath As String = "c:\sample.docx"
Dim filePathOut As String = "c:\output\document_{0}.{1}"
Dim splitOptions As New SplitOptions(filePathOut, 3, 7)
Using merger As New Merger(filePath)
	 merger.Split(splitOptions)
End Using
VB   C#

按开始/结束页码和偶数/多数筛选器将文件拆分成若干单页文件

string filePath = @"c:\sample.docx";
string filePathOut = @"c:\output\document_{0}.{1}";
SplitOptions splitOptions = new SplitOptions(filePathOut, 3, 7, RangeMode.OddPages);
using (Merger merger = new Merger(filePath))
{
     merger.Split(splitOptions);
}
string filePath = @"c:\sample.docx";
string filePathOut = @"c:\output\document_{0}.{1}";
SplitOptions splitOptions = new SplitOptions(filePathOut, 3, 7, RangeMode.OddPages);
using (Merger merger = new Merger(filePath))
{
     merger.Split(splitOptions);
}
Dim filePath As String = "c:\sample.docx"
Dim filePathOut As String = "c:\output\document_{0}.{1}"
Dim splitOptions As New SplitOptions(filePathOut, 3, 7, RangeMode.OddPages)
Using merger As New Merger(filePath)
	 merger.Split(splitOptions)
End Using
VB   C#

将文件分割成多个多页文件

string filePath = @"c:\sample.docx";
string filePathOut = @"c:\output\document_{0}.{1}";
SplitOptions splitOptions = new SplitOptions(filePathOut, new int [] { 3, 6, 8 }, Split-Mode.Interval);
using (Merger merger = new Merger(filePath))
{
     merger.Split(splitOptions);
}
string filePath = @"c:\sample.docx";
string filePathOut = @"c:\output\document_{0}.{1}";
SplitOptions splitOptions = new SplitOptions(filePathOut, new int [] { 3, 6, 8 }, Split-Mode.Interval);
using (Merger merger = new Merger(filePath))
{
     merger.Split(splitOptions);
}
Dim filePath As String = "c:\sample.docx"
Dim filePathOut As String = "c:\output\document_{0}.{1}"
Dim splitOptions As New SplitOptions(filePathOut, New Integer () { 3, 6, 8 }, Split-Mode.Interval)
Using merger As New Merger(filePath)
	 merger.Split(splitOptions)
End Using
VB   C#

许可和定价

开发人员可以使用 GroupDocs 的 .NETJava 通过应用程序接口(API),可在其网络、移动或桌面应用程序中添加显示、注释、转换、电子签名、比较和组装文档的功能。 GroupDocs 授予您使用其服务的非独占、不可再许可、不可转让的许可。

IronPDF 与 GroupDocs 的比较,图 2:GroupDocs 许可证定价表

该系列单个产品的起价为 1999 美元。

IronPDF 是一个免费的 C# PDF 库。 它可免费用于开发。 对于商业用途,可通过以下方式安排为期 30 天的部署试用 联系工程团队.

IronPDF 提供简单明了的定价许可证起价为 $749,并提供大量自定义选项。

IronPDF 与 GroupDocs 的比较,图 2:IronPDF 许可证定价表

结论

IronPDF 无法从远程服务器将 HTML 转换为 PDF。 相反,它使用的是符合标准的内部网络浏览器引擎 (无需安装任何其他软件). HTML 的格式完全符合最高商业印刷标准。 结果就是一份清晰、高质量的 PDF 文件。

另一方面,GroupDocs.Total 产品系列可以处理 90 多种流行的文件格式。 它支持文档查看、文档注释、文档比较、文档转换、文档操作和文档自动化。 此外,用户还可以使用桌面解决方案的在线文档查看器查看文档。

与 GroupDocs 相比,IronPDF 的优势在于首次设置后无需额外下载;这既节省了时间,又能保证快速实现预期结果。 只需下载一次,IronPDF 就能提供所有必要的功能。 不过,PDFTron 包含一些模块,在组装成完整的软件包之前,必须分别下载这些模块。 可下载特定模块以增加更多功能。

IronPDF 为您提供了简短的代码行,您可以用它们快速完成 PDF 操作任务。

更重要的是,IronPDF 的许可证发放非常简单,所有事实都可在网站上一目了然,这使其在竞争中更具优势。 目前的特惠活动让您只需花两套软件的价格就能获得五套 Iron Software 产品。

< 前一页
IronPDF与Apitron PDF Kit对比
下一步 >
IronPDF 与 PDFNet 之间的比较

准备开始了吗? 版本: 2024.9 刚刚发布

免费NuGet下载 总下载量: 10,731,156 查看许可证 >