A Comparison between IronPDF and GroupDocs

GroupDocs and IronPDF are both cross-platform applications that give engineers the tools for document automation. They can create, edit, format, and print PDF documents ---one of the popular document formats used today. While building projects with .NET and .NET Core, developers need to choose the tools that best suit the project.

Developers need to be well-informed about the libraries and tools that are available. PDF libraries are no exception to this. As each one has its own set of strengths and weaknesses, it is up to the developer to use the tool that best suits the business and the project.

This article will compare two of the most popular PDF libraries for .NET and .NET Core developers. These two libraries are:

  • GroupDocs
  • IronPDF

What is IronPDF?

IronPDF is a C#-based, commercial PDF creation package for the .NET platform. It produces PDFs from HTML, CSS, images, and JavaScript. It works equally well in web applications, secure intranets, console apps, WPF apps, and MVC-patterned websites.

IronPDF is compatible with all .NET Framework and .NET Core projects starting with version 4.

What is the GroupDocs library?

The GroupDocs.Editor API is a cross-platform .NET library that enables developers to create simple applications that interface easily with popular HTML editors (both free and paid) to convert, edit, and manipulate documents in a variety of file formats.

Developers can use GroupDocs.Editor to load a document, convert it to HTML, send the HTML to an external editor, and then save the HTML back to its original format. Additionally, the API can access resources linked to the document within the editor. It supports numerous Web and Word processing file formats, including Microsoft Word, Microsoft Excel, OpenDocument, Text, Watermarks, etc.

What differentiates these two libraries? Let's find out.

Annotating PDF documents

GroupDocs.Annotation

GroupDocs.Annotation for .NET enables the developer to produce apps in C#, ASP.NET, and other .NET technologies capable of performing document annotation functions. Document annotations that this library supports include: drawing shapes and arrows, placing points and callout bubbles, adding text and images, inserting comments and highlights, striking-out/underlining texts and images, and others. GroupDocs.Annoation can also manipulate document annotations.

After annotating a document, the library can save the document back in its original file type. The powerful document annotator can annotate PDF files, HTML files, Word documents, Excel spreadsheets, PowerPoint presentations, Visio files, CAD drawings, image formats, and many more.

// 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

Users can annotate PDF documents programmatically with IronPDF using both the IronPdf.PdfDocument.AddTextAnnotation method and the PdfDocument.TextAnnotation class.

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");
Using Pdf As PdfDocument = PdfDocument.FromFile("existing.pdf") ' Create a PDF annotation object
	Dim Annotation = New IronPdf.Annotations.TextAnnotation() With {
		.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")
End Using
VB   C#

IronPDF's text-annotation features include adding/changing color, resizing elements, setting opacity, adding symbols, and editing text.

File Type Conversion

Converting from certain file formats to PDF is an essential aspect of maintaining file integrity. Let's take a look at how both software solutions perform the different conversions.

Converting Files to PDF with GroupDocs

MS Word, Excel, PowerPoint, Visio, and other document types can be converted using GroupDocs's GroupDocs.Conversion API. GroupDocs.Conversion is a stand-alone API designed for server-side applications that require high speed. It does not depend on productivity software suites such as Microsoft Office or Open Office.

Convert XLSB to PDF in C#

XLSB (Excel Binary File Format) is an file type that stores Excel workbook data as binary rather than as XML (as is the case with the Excel XLSX file type).

The sample code below converts XLSB to PDF in C#.

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");
        }
    }
}
Imports System
Imports GroupDocs.Conversion.Options.Convert
Namespace ConvertXlsbToPdfInCSharp
	Friend Class Program
		Public Shared Sub Main(ByVal args() As String) ' Main function to convert XLSB to PDF using C#
			' Remove the watermathe rk 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 XLSB file for conversion to PDF
			Dim converter = New GroupDocs.Conversion.Converter("sample.xlsb")

			' Set convert options for the PDF document
			Dim convertOptions = New PdfConvertOptions()

			' Convert and save the XLSB in PDF format
			converter.Convert("converted.pdf", convertOptions)
			Console.WriteLine("Done")
		End Sub
	End Class
End Namespace
VB   C#

Convert VSDX to PDF in C#

The procedures for converting a Visio VSDX file to a PDF file using the GroupDocs.Conversion API are as follows:

  1. Install GroupDocs.Conversion library using the NuGet package manager.
  2. Include the GroupDocs.Conversion namespace in the project source file(s).
  3. Instantiate a new GroupDocs.Conversion.Converter object with the location of the VSDX file.
  4. Create an instance of the PdfConvertOptions class and use it to specify file conversion options.
  5. Call the Convert method on the Converter instance to create the PDF file.
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");
        }
    }
}
Imports System
Imports GroupDocs.Conversion.Options.Convert

Namespace ConvertVsdxToPdfInCSharp
	Friend Class Program
		Public Shared Sub Main(ByVal args() As String) ' Main function to convert VSDX 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 VSDX file for conversion to PDF
			Dim converter = New GroupDocs.Conversion.Converter("sample.vsdx")

			' Set the convert options for PDF document
			Dim convertOptions = New PdfConvertOptions()

			' Convert and save the VSDX in PDF format
			converter.Convert("converted.pdf", convertOptions)

			Console.WriteLine("Done")
		End Sub
	End Class
End Namespace
VB   C#

Convert HTML to PDF using C#

This example demonstrates how to use GroupDocs.Conversion to produce PDF files from HTML. It uses the Converter class to load the source document, the PdfConvertOptions class to define the properties for the output document, and the Convert function to render the source document as a PDF file.

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");
        }
    }
}
Imports System
Imports GroupDocs.Conversion.Options.Convert

Namespace ConvertVsdxToPdfInCSharp
	Friend Class Program
		Public Shared Sub Main(ByVal args() As String) ' Main function to convert VSDX 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 VSDX file for conversion to PDF
			Dim converter = New GroupDocs.Conversion.Converter("sample.vsdx")

			' Set the convert options for PDF document
			Dim convertOptions = New PdfConvertOptions()

			' Convert and save the VSDX in PDF format
			converter.Convert("converted.pdf", convertOptions)

			Console.WriteLine("Done")
		End Sub
	End Class
End Namespace
VB   C#

Only a few parameters for the resulting PDF document have been described in this example. Developers can specify additional file conversion options, such as adjusting marginal space, setting passwords, adding watermarks, etc.

Convert RTF to PDF using C#

To convert an RTF file to PDF quickly using GroupDocs:

  1. Begin by first installing the required NuGet package and by referencing the proper namespace in the project source code
  2. Create an instance of the Converter class to load the source RTF file.
  3. Initialize a PdfConvertOptions object to define the properties for the rendered PDF document.
  4. Lastly, utilize the Convert (passing in an output location and the PdfConvertOptions instance) to render the RTF file as a PDF file.
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#

Convert Excel to PDF in C#

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#

Convert Image to PDF in C#

With GroupDocs, you can convert a JPG image format to a PDF document in just a few lines of code. GroupDocs can readily convert other image types, such as PNG, TIFF, BMP, and others.

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#

The GroupDocs API can convert photos to other document formats such as Microsoft Word, Excel, and PowerPoint.

Converting Files to PDF with IronPDF

IronPDF for .NET Core and .NET Framework uses a Chromium runtime engine to convert HTML content to PDF files. HTML is the bread and butter of IronPDF's core feature set. Its rendering of HTML documents into PDF files are pixel-perfect, exact duplicates of how they appear on Google Chrome for desktop.

The library offers several options for doing so. The following sections will explore some of them in detail.

HTML to PDF

IronPDF can render raw HTML, CSS, and JavaScript source code directly as PDF files, as per the example below.

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 to PDF

IronPDF makes it easy to convert HTML into PDF documents from existing URLs.

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#

With this ability, designers and coders may collaborate more efficiently on PDF development by rendering PDFs from ASP.NET URLs that support query string variables.

ASPX Pages to PDF

The IronPDF library can render ASP.NET web pages as PDFs instead of as HTML with just one line of code added to an application's Form_Load event:

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#

This enables data-driven PDFs to be designed and tested first as HTML for the sake of simplicity.

Images To PDF

PDF documents can be easily created from one or more image files using the IronPdf.ImageToPdfConverter class.

// 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") OrElse 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#

JavaScript in HTML To PDF

IronPDF includes comprehensive JavaScript compatibility in HTML to PDF conversion, including support for Angular.js and other popular front-end and single-page web frameworks.

IronPDF allows users to use JavaScript to embed images and other content types into PDFs. The library does this by enabling them to be directly embedded as HTML strings.

Content that IronPDF can embed in this way include (but are not limited to):

  • Files with images
  • System.Drawing.Image
  • System.Drawing.Bitmap

This is useful to avoid external loading assets during HTML to PDF rendering. It can improve speed and allow entire render jobs stored in non-file-system locations such as strings or databases.

// 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 to PDF

For web pages that make use of Angular to load content dynamically, IronPDF can allow time for asynchronous content loading.

In the example below, the program will wait for half a second before rendering the web page in its entirety.

// 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 Document Signing

PDF files are great for storing data, keeping document layouts, and conserving fonts and graphics. Working from home has become a norm in our world. Filling out and signing paperwork, delivering files, and processing documents are just a few of the daily tasks that organizations must accomplish. Giving PDF signatures as a substitute for physical signatures is now a key activity. Digital signatures have become increasingly important as businesses seek new ways to sign agreements and contracts, as well as exchange PDF documents online.

Digital document signing with Groupdocs

Build applications in C#, ASP.NET, and other .NET-based technologies that allow users to sign digital business documents without installing any other third-party software using the GroupDocs.Signature for .NET API. This electronic signature library is easy to use. .NET developers can integrate extensive digital signature features into their applications, allowing users to sign, perform search operations, and validate e-Signatures from various document types.

GroupDocs.Signature supports PDFs, Word, Excel, PowerPoint, OpenDocument, images, and other industry-standard file formats. It can use text, images, barcodes, QR codes, form fields, stamps, and metadata as signature types.

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#

Digital document signing process with IronPDF

IronPDF is an excellent choice for all C#-based PDF activities on desktop computers. Developers can use it to add signatures, fill and sign PDF documents, secure PDF forms cryptographically, and even add an image of their signature.

Developers frequently inquire about utilizing IronPDF and C# to add a signature to a PDF programmatically. This can mean a variety of things to developers:

  • Adding a graphical digital signature image to existing PDF files from an image file
  • Signing a PDF cryptographically to confirm that someone has not tampered with it
  • Add a human handwritten signature icon to a PDF that has been cryptographically signed.

The first method involves stamping a signature PNG into a PDF page that already exists. It can be used as a signature or a company stamp. Only a few lines of code are required to complete the procedure.

// 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#

The following code uses a .pfx and .p12 X509Certificate2 digital certificate to cryptographically sign a 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#

The more complex example below uses the X509Certificate2 digital ID signing method along with a scan of a handwritten signature.

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#

Merging PDF Files

Merging pdfs with GroupDocs.Merger

When it is necessary to consolidate multiple PDF files into a single document or provide fewer attachments, GroupDocs.Merger allows developers to merge PDF files. GroupDocs.Merger achieves this without using third-party software or doing any manual labor.

GroupDocs.Merger can combine PDF documents of any size and structure. The API will retain all text, photos, tables, graphs, forms, and other content in their original size and formatting.

With a few lines of C# code, the following example shows how to combine PDF files:

  • Create a Merger instance and supply the path to the source PDF file as a constructor argument. You can specify an absolute or relative file path depending on your needs.
  • Use the Join method to merge documents together. Repeat for any additional PDF documents you want to integrate.
  • Call the Save method with the output file location to save the resulting PDF document.
// 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#

Merging PDFs with IronPDF

IronPDF makes it easy to merge two or more PDF documents in C#.NET with IronPdf.PdfDocument.Merge.

// 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#

Splitting PDF document formats

Splitting with IronPDF

IronPDF can split PDF documents by extracting single pages or page ranges into new IronPdf.PdfDocument objects. IronPdf.PdfDocument.CopyPage can extract pages from one or more PDF files and pasting them into a new document.

// 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#

Splitting with GroupDocs

GroupDocs.Merger enables the splitting of the source document into multiple result documents. Document splitting can be done differently by specifying a page number array, start/end page numbers, and different split option modes. Here are the possible use cases:

  1. Page number array is specified, and split mode is set to SplitMode.Pages --- page numbers indicate exact page numbers stored in separate one-page documents. Ex: Array{ 3, 6, 8 } will produce 3 documents with the third, sixth, and eighth pages.
  2. The page number array is specified, and the split mode is set to SplitMode.Interval --- given page numbers indicate the boundaries of the page intervals saved in the separate multi-page documents. Ex: Array{ 3, 6, 8 } will produce 4 page intervals 1-2, 3-5, 6-7, 8-10.

There is also an option to set ParameterRangeMode and get only even or odd pages from the desired page range.

Split the document into several one-page documents by exact page numbers

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#

Split the document into several one-page documents by start/end page numbers

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#

Split the document into several one-page documents by start/end page numbers and even/odd filters

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#

Split the document into several multi-page documents

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#

Licensing and Pricing

Developers can use GroupDocs' .NET and Java APIs to add the ability to display, annotate, convert, e-sign, compare and assemble documents in their web, mobile, or desktop applications. GroupDocs grants you a non-exclusive, non-sublicensable, non-assignable license to use their services.

A Comparison Between IronPDF and GroupDocs, Figure 2: GroupDocs License Pricing Table

The pricing starts from $1999 for a single product from the range.

IronPDF is a free C# PDF library. It is free to use for development. For commercial use, 30-day deployment trials can be arranged by contacting the engineering team.

IronPDF offers straightforward pricing, with licenses starting at $749, with numerous customization options.

A Comparison Between IronPDF and GroupDocs, Figure 2: IronPDF License Pricing Table

Conclusion

IronPDF does not render HTML to PDF from a remote server. Rather, it makes use of an internal, standard-compliant web browser engine (without any additional software needing to be installed). The HTML is reproduced perfectly in a format that meets the highest commercial printing standards. The result is a crisp, high-quality PDF.

On the other hand, the GroupDocs.Total product family can process more than 90 popular file formats. It enables document viewing, document annotation, document comparison, document conversion, document manipulation and document automation. Furthemore, users can view documents using online document viewer for desktop solutions.

IronPDF has the edge over GroupDocs because it does not require any additional downloads after the first setup; this saves time and guarantees that the intended outcome is achieved quickly. With just one download, IronPDF provides all of the necessary features. However, PDFTron includes modules that must be downloaded separately before the complete package can be assembled. Specific modules can be downloaded to add more functionality.

IronPDF provides you with short lines of code that you can use to get your PDF manipulation task done in no time.

More importantly, IronPDF licensing is simple, with all facts readily available on the website, giving it an edge over competitors. The current special deal allows you to get five Iron Software products for the price of just two.