PRODUCT COMPARISONS

A Comparison between IronPDF and PDFCrowd

Published December 13, 2021
Share:

IronPDF and PDFCrowd - A Comprehensive Comparison

Ever-improving technology means smarter time-saving solutions for everyone, and especially developers. Automation is now the key to the software development processes. Working with PDF files in C# has proved difficult for developers over many years. There is a wide variety of factors to take into account when rendering content from PDF files, and even more so when converting content from different formats to PDF. These issues have now been solved with the completion of numerous libraries designed to read, write, create, and convert to PDF from different formats.

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

  • IronPDF
  • PDFCrowd

IronPDF and PDFCrowd are both libraries that provide methods to create, manipulate and print PDFs in .NET and .NET Core. The next question is to decide which C# PDF Library is best suited for your .NET project? You can weigh up your decision as you read the following comparison between the two libraries and their respective standout features for converting and manipulating PDFs.

Let's have a look at what both libraries have to offer first, and then move on to the comparison itself.

IronPDF and its Main Features

IronPDF .NET PDF Library solution is a dream for developers, especially software engineers who use C#. You can easily create a core pdf library for .NET with this excellent tool.

IronPDF uses a .NET Chromium engine to render HTML pages to PDF files. With HTML to PDF there is no need to use complex APIs to position or design PDFs. IronPDF supports standard web documents: HTML, ASPX, JS, CSS, and images.

It also enables you to create a .NET PDF library using HTML5, CSS, JavaScript, and images. You can effortlessly edit, stamp, and add headers and footers to a PDF. Further, it makes it very easy to read PDF text and extract images.

The IronPDF C# Library - Standout Features

Some of the important features include:

Create PDFs (Html to Pdf)

  • Create PDF documents from HTML 4 and 5, CSS, and JavaScript
  • Generate PDF documents from URL
  • Load URL with custom network login credentials, User-Agents, Proxies, Cookies, HTTP headers, form variables allowing login behind HTML login forms

Edit Existing PDF Documents Without Adobe Acrobat

  • Read and fill form fields data
  • Extract images and texts from PDF
  • Stamp new HTML Content onto any existing PDF page
  • Add logical or HTML headers and footers

Manipulate Existing PDF Documents

  • Load and parse existing PDF documents
  • Merge and split content in PDF documents
  • Add headers, footers, annotations, bookmarks, watermarks, text, and image assets

Convert from Multiple Formats

  • ASPX WebForms – convert, with 3 lines of code, ASP.NET webforms to downloadable PDFs viewable in the browser
  • HTML Document – convert HTML to PDF
  • Custom ‘base URL’ to allow accessible asset files across the web
  • Responsive layouts through Virtual Viewport (width and height)
  • Accept HTML encoded in any major file encoding (Default to UTF-8)

Save and Print

  • Save and load from file, binary data, or MemoryStreams
  • Screen or Print CSS media types
  • Turn PDF files into a PrintDocument object and print without Adobe (with minimal code)
  • Export official Log files with details about API success and debug errors in source code

The PDFCrowd Library - Standout Features

The Pdfcrowd.com API is a professional solution for creating PDF and screenshot images from web pages and HTML documents. It is an online web service that allows you to convert any web page to PDF. The API is a web service where your input is converted on PDFCrowd servers.

It is high-quality and fast, thereby saving you time. It is safe and has the ability to compress files.

PDFCrowd API Features

Here are some of the most important PDFCrowd Features:

HTML to PDF API

  • Easy to use API client SDK libraries
  • Support for the latest web standards
  • The integration takes only a few minutes to set up, no third-party libraries are needed
  • Available virtually on any platform - Windows, Linux, macOS, BSD, Unix-like systems, etc.
  • Reliable, widely available, and with support for the latest HTML5, CSS3 and JavaScript specifications

API Playground

  • Interactively explore API settings
  • PDF preview, automatic code generation
  • Convert web pages, HTML files or HTML code

Note: PDFCrowd does not provide a standalone SDK that can be used offline.

The rest of this article will look at the following topics:

  1. Creating a Project
  2. IronPDF C# Library Installation
  3. PDFCrowd API Installation
  4. Create a PDF from an Existing URL
  5. Create a PDF from HTML Input String
  6. Convert ASPX Pages to PDF
  7. Convert XML to PDF
  8. Convert Images to PDF
  9. Licensing
  10. Summary and Conclusion

1. Creating an ASP.NET Project

Use the following steps to create an ASP.NET website:

  • Open Visual Studio 2019
  • Click on File from menu and then click on "New Project" to create a new project
  • Select Web under Visual C# in the project type list box
  • Select ASP.NET Web Application (.NET Framework) and click OK as shown in the below screenshot

Figure 1New Project Dialog Box

  • From the next screen, choose "Web Forms" as showing in the screenshot below.

Figure 2Web Forms

  • Once all is selected, Click Ok.

Now the project is created and we are almost ready to test the libraries. However, we still need to install and integrate them into our project. Let's install IronPDF first.

2. IronPDF C# Library Installation

There are four ways to download and install the IronPDF library. They are as follows:

  1. Using Visual Studio
  2. The Developer Command Prompt
  3. Download the NuGet Package directly
  4. Download the IronPDF .DLL Library

Let’s take a closer look at each one.

2.1 Using Visual Studio

Visual Studio provides the NuGet Package Manager to install NuGet packages in your projects. You can access it through the Project Menu, or by right-clicking your project in the Solution Explorer. Both these options are shown below in screenshots as Figures 3 and 4.

Figure 3Project Menu > Manage NuGet Packages

Figure 4Right Click Solution Explorer

Once selected, browse for the IronPDF package and install it, as shown in the screenshot below.

Figure 5Install IronPDF from NuGet Package

2.2 Using the Developer Command Prompt

Another way to download and install IronPDF C# Library is to make use of the following steps to install the IronPDF NuGet package through the Developer Command Prompt.

  • Open the Developer Command Prompt – usually found under the Visual Studio folder
  • Type the following command:

    Install-Package IronPdf
  • Press Enter
  • This will download and install the package
  • Reload your Visual Studio project and start using it

2.3. Download the NuGet Package Directly

The third way to download and install IronPDF is to follow the steps below. This can be done by visiting the NuGet site directly and downloading the package. The steps are:

2.4. Install IronPDF by Downloading the Library

You can directly download the IronPDF .DLL file directly from the website. It can be directly downloaded from the IronPDF DLL download.

Figure 6Direct Download IronPDF C# Library

Reference the Library in your project by using the next steps:

  • Right-click the Solution in the Solution Explorer
  • Select References
  • Browse for the IronPDF.dll library
  • Click OK

All done! IronPDF is downloaded, installed and ready to use. However, before that we should install PDFCrowd API.

3.PDFCrowd API Installation

Authentication

Authentication is needed in order to use the Pdfcrowd API client. The credentials used to access the API are your Pdfcrowd username and the API key.

Pdfcrowd API Client Library for .NET

The Pdfcrowd API client library allows you to run conversions between HTML, PDF and various image formats. The .NET API client library enables easy implementation of the Pdfcrowd API in your .NET applications.

There are three ways to install PDFCrowd API Client Library for .NET:

  1. Direct Download of the Pdfcrowd client as a Zip
  2. Via the NuGet Package Manager for the Pdfcrowd official client package
  3. The Pdfcrowd GitHub Repository

Let's have a closer look at each one.

3.1 Direct Download

Download pdfcrowd-5.2.0-dotnet.zip, unzip it and add a reference to pdfcrowd.dll to your project.

Reference the Library in your project by using the next steps:

  • Right-click the Solution in the Solution Explorer
  • Select References
  • Browse for the pdfcrowd.dll library
  • Click OK

3.2 The NuGet Package Manager via the Developer Command Prompt

Another way to download and install the PDFCrowd API is to make use of the following steps to install the PDFCrowd API Client NuGet package using the Developer Command Prompt.

  • Open Developer Command Prompt – usually found under the Visual Studio folder
  • Type the following command: PM > Install-Package Pdfcrowd.official -Version 5.2.0
  • Press Enter
  • This will download and install the package
  • Reload your Visual Studio project and start using it

3.3 GitHub Repository

To install PDFCrowd, you can clone pdfcrowd-dotnet from Github and build the library. This client library is licensed under the MIT License.

Use the following commands to build the PDFCrowd API Client library:

  • git clone https://github.com/pdfcrowd/pdfcrowd-dotnet
  • cd pdfcrowd-dotnet
  • make.bat # on Windows
  • make all # on Unix

Now that we have created the project and installed the necessary libraries, let's start comparing the IronPDF and PDFCrowd libraries in terms of code.

4. Create a PDF from an Existing URL

Both libraries provide the facility to convert an HTML webpage to PDF. Let's have a look at the code for each library one-by-one.

4.1. Existing URL to PDF using IronPDF

IronPDF makes it very straightforward to render HTML from existing URLs as PDF documents. There is a very high level of support for JavaScript, Images, Forms and CSS.

The following code is using IronPDF to create a PDF document directly from a website address.

IronPdf.ChromePdfRenderer Renderer = new IronPdf.ChromePdfRenderer();
using var Pdf = Renderer.RenderUrlAsPdf("https://ironpdf.com/");

Pdf.SaveAs("url.pdf");
IronPdf.ChromePdfRenderer Renderer = new IronPdf.ChromePdfRenderer();
using var Pdf = Renderer.RenderUrlAsPdf("https://ironpdf.com/");

Pdf.SaveAs("url.pdf");
Dim Renderer As New IronPdf.ChromePdfRenderer()
Dim Pdf = Renderer.RenderUrlAsPdf("https://ironpdf.com/")

Pdf.SaveAs("url.pdf")
VB   C#

4.2 Existing URL to PDF using PDFCrowd

With PDFCrowd it is also very easy to convert URLs into PDF documents. The following code is using PDFCrowd to generate a PDF document directly from a website address.

// create the API client instance
pdfcrowd.HtmlToPdfClient client = new pdfcrowd.HtmlToPdfClient("demo", "ce544b6ea52a5621fb9d55f8b542d14d");

// run the conversion and write the result to a file
client.convertUrlToFile("http://www.pdfcrowd.com", "example.pdf");
// create the API client instance
pdfcrowd.HtmlToPdfClient client = new pdfcrowd.HtmlToPdfClient("demo", "ce544b6ea52a5621fb9d55f8b542d14d");

// run the conversion and write the result to a file
client.convertUrlToFile("http://www.pdfcrowd.com", "example.pdf");
' create the API client instance
Dim client As New pdfcrowd.HtmlToPdfClient("demo", "ce544b6ea52a5621fb9d55f8b542d14d")

' run the conversion and write the result to a file
client.convertUrlToFile("http://www.pdfcrowd.com", "example.pdf")
VB   C#

5. Create a PDF from HTML Input String

IronPDF and PDFCrowd both provide the facility to generate PDF from a string containing HTML. Both use only two lines of code to accomplish this task.

5.1. HTML Input String using IronPDF

The following code shows that a PDF document can be rendered using an HTML input string. You can choose simple HTML, or also incorporate CSS, images and JavaScript.

var Renderer = new IronPdf.ChromePdfRenderer();
using var PDF = Renderer.RenderHtmlAsPdf("<h1>Html with CSS and Images</h1>");
PDF.SaveAs("pixel-perfect.pdf");

// 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");
var Renderer = new IronPdf.ChromePdfRenderer();
using var PDF = Renderer.RenderHtmlAsPdf("<h1>Html with CSS and Images</h1>");
PDF.SaveAs("pixel-perfect.pdf");

// 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");
Dim Renderer = New IronPdf.ChromePdfRenderer()
Dim PDF = Renderer.RenderHtmlAsPdf("<h1>Html with CSS and Images</h1>")
PDF.SaveAs("pixel-perfect.pdf")

' Load external html assets: images, css and javascript.
' An optional BasePath 'C:\site\assets\' is set as the file location to load assets from 
Dim AdvancedPDF = Renderer.RenderHtmlAsPdf("<img src='icons/iron.png'>", "C:\site\assets\")
AdvancedPDF.SaveAs("html-with-assets.pdf")
VB   C#

5.2. HTML Input String using PDFCrowd

The following code shows that a PDF document can be generated using a string containing HTML. The HTML input string can also be used to convert to in-memory PDF, and write the resulting PDF to an Output Stream.

// create the API client instance
pdfcrowd.HtmlToPdfClient client = new pdfcrowd.HtmlToPdfClient("demo", "ce544b6ea52a5621fb9d55f8b542d14d");

// run the conversion and write the result to a file
client.convertStringToFile("<html><body><h1>Hello World!</h1></body></html>", "HelloWorld.pdf");

// run the conversion and store the result into the "pdf" variable
byte [] pdf = client.convertString("<html><body><h1>Hello World!</h1></body></html>");
// at this point the "pdf" variable contains PDF raw data and
// can be sent in an HTTP response, saved to a file, etc.

// create an output stream for the conversion result
FileStream outputStream = new FileStream("HelloWorld.pdf", FileMode.CreateNew);

// run the conversion and write the result into the output stream
client.convertStringToStream("<html><body><h1>Hello World!</h1></body></html>", outputStream);

// close the output stream
outputStream.Close();
// create the API client instance
pdfcrowd.HtmlToPdfClient client = new pdfcrowd.HtmlToPdfClient("demo", "ce544b6ea52a5621fb9d55f8b542d14d");

// run the conversion and write the result to a file
client.convertStringToFile("<html><body><h1>Hello World!</h1></body></html>", "HelloWorld.pdf");

// run the conversion and store the result into the "pdf" variable
byte [] pdf = client.convertString("<html><body><h1>Hello World!</h1></body></html>");
// at this point the "pdf" variable contains PDF raw data and
// can be sent in an HTTP response, saved to a file, etc.

// create an output stream for the conversion result
FileStream outputStream = new FileStream("HelloWorld.pdf", FileMode.CreateNew);

// run the conversion and write the result into the output stream
client.convertStringToStream("<html><body><h1>Hello World!</h1></body></html>", outputStream);

// close the output stream
outputStream.Close();
' create the API client instance
Dim client As New pdfcrowd.HtmlToPdfClient("demo", "ce544b6ea52a5621fb9d55f8b542d14d")

' run the conversion and write the result to a file
client.convertStringToFile("<html><body><h1>Hello World!</h1></body></html>", "HelloWorld.pdf")

' run the conversion and store the result into the "pdf" variable
Dim pdf() As Byte = client.convertString("<html><body><h1>Hello World!</h1></body></html>")
' at this point the "pdf" variable contains PDF raw data and
' can be sent in an HTTP response, saved to a file, etc.

' create an output stream for the conversion result
Dim outputStream As New FileStream("HelloWorld.pdf", FileMode.CreateNew)

' run the conversion and write the result into the output stream
client.convertStringToStream("<html><body><h1>Hello World!</h1></body></html>", outputStream)

' close the output stream
outputStream.Close()
VB   C#

Convert ASPX Pages to PDF

The next code for both IronPDF and PDFCrowd creates a PDF document from an ASP.NET web page.

6.1. ASPX Page to PDF using IronPDF

The following code renders the ASPX web page file to PDF using IronPDF. This is a one-line code and very easy to use. More options can be added to PDF settings while rendering.

protected void Page_Load(object sender, EventArgs e)
{
    IronPdf.AspxToPdf.RenderThisPageAsPdf();
}
protected void Page_Load(object sender, EventArgs e)
{
    IronPdf.AspxToPdf.RenderThisPageAsPdf();
}
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
	IronPdf.AspxToPdf.RenderThisPageAsPdf()
End Sub
VB   C#

6.2. ASPX Page to PDF using PDFCrowd

The following code renders the ASPX web page file to PDF using PDFCrowd. This allows you to set complete HTTP response headers and send the result in HTTP response to be viewed in the web browser as PDF.

// create the API client instance
pdfcrowd.HtmlToPdfClient client = new pdfcrowd.HtmlToPdfClient("demo", "ce544b6ea52a5621fb9d55f8b542d14d");

// run the conversion and store the result into the "pdf" variable
byte [] pdf = client.convertUrl("https://en.wikipedia.org");

// set HTTP response headers
Response.ContentType = "application/pdf";
Response.Headers.Add("Cache-Control", "max-age=0");
Response.Headers.Add("Accept-Ranges", "none");
Response.Headers.Add("Content-Disposition", "attachment; filename*=UTF-8''" + Uri.EscapeUriString("result.pdf"));

// send the result in the HTTP response
Response.OutputStream.Write(pdf, 0, pdf.Length);
Response.Flush();
// create the API client instance
pdfcrowd.HtmlToPdfClient client = new pdfcrowd.HtmlToPdfClient("demo", "ce544b6ea52a5621fb9d55f8b542d14d");

// run the conversion and store the result into the "pdf" variable
byte [] pdf = client.convertUrl("https://en.wikipedia.org");

// set HTTP response headers
Response.ContentType = "application/pdf";
Response.Headers.Add("Cache-Control", "max-age=0");
Response.Headers.Add("Accept-Ranges", "none");
Response.Headers.Add("Content-Disposition", "attachment; filename*=UTF-8''" + Uri.EscapeUriString("result.pdf"));

// send the result in the HTTP response
Response.OutputStream.Write(pdf, 0, pdf.Length);
Response.Flush();
' create the API client instance
Dim client As New pdfcrowd.HtmlToPdfClient("demo", "ce544b6ea52a5621fb9d55f8b542d14d")

' run the conversion and store the result into the "pdf" variable
Dim pdf() As Byte = client.convertUrl("https://en.wikipedia.org")

' set HTTP response headers
Response.ContentType = "application/pdf"
Response.Headers.Add("Cache-Control", "max-age=0")
Response.Headers.Add("Accept-Ranges", "none")
Response.Headers.Add("Content-Disposition", "attachment; filename*=UTF-8''" & Uri.EscapeUriString("result.pdf"))

' send the result in the HTTP response
Response.OutputStream.Write(pdf, 0, pdf.Length)
Response.Flush()
VB   C#

7. Convert XML to PDF

The following code takes XML and converts it to PDF for IronPDF and PDFCrowd API.

7.1. Convert XML to PDF Using IronPDF

C# XML to PDF directly can be a complex challenge. We have found that when converting XML to PDF in C# it is best to start with XSLT. XML may be rendered to PDF via HTML(5) using XLST transformations.

private void XMLtoPDF(string XSLT, string XML)
{
    XslCompiledTransform transform = new XslCompiledTransform();
    using(XmlReader reader = XmlReader.Create(new StringReader(XSLT)))  
    {
        transform.Load(reader);
    }
    StringWriter results = new StringWriter();
    using(XmlReader reader = XmlReader.Create(new StringReader(XML))) 
    {
        transform.Transform(reader, null, results);
    }
    IronPdf.ChromePdfRenderer Renderer = new IronPdf.ChromePdfRenderer();
    // options, headers, and footers may be set there
    // Render our XML as a PDF via XSLT
    using var PDF = Renderer.RenderHtmlAsPdf(results.ToString())l
    PDF.SaveAs("XMLtoPDF.pdf");
}
private void XMLtoPDF(string XSLT, string XML)
{
    XslCompiledTransform transform = new XslCompiledTransform();
    using(XmlReader reader = XmlReader.Create(new StringReader(XSLT)))  
    {
        transform.Load(reader);
    }
    StringWriter results = new StringWriter();
    using(XmlReader reader = XmlReader.Create(new StringReader(XML))) 
    {
        transform.Transform(reader, null, results);
    }
    IronPdf.ChromePdfRenderer Renderer = new IronPdf.ChromePdfRenderer();
    // options, headers, and footers may be set there
    // Render our XML as a PDF via XSLT
    using var PDF = Renderer.RenderHtmlAsPdf(results.ToString())l
    PDF.SaveAs("XMLtoPDF.pdf");
}
Private Sub XMLtoPDF(ByVal XSLT As String, ByVal XML As String)
	Dim transform As New XslCompiledTransform()
	Using reader As XmlReader = XmlReader.Create(New StringReader(XSLT))
		transform.Load(reader)
	End Using
	Dim results As New StringWriter()
	Using reader As XmlReader = XmlReader.Create(New StringReader(XML))
		transform.Transform(reader, Nothing, results)
	End Using
	Dim Renderer As New IronPdf.ChromePdfRenderer()
	' options, headers, and footers may be set there
	' Render our XML as a PDF via XSLT
	Dim PDF = Renderer.RenderHtmlAsPdf(results.ToString())l PDF.SaveAs("XMLtoPDF.pdf")
End Sub
VB   C#

The structure of the XSLT file is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
  <html>
  <body>
    <h2>My CD Collection</h2>
    <p>Titles:
    <xsl:for-each select="catalog/cd">
      <xsl:value-of select="title"/>
      <xsl:if test="position() < last()-1">
        <xsl:text>, </xsl:text>
      </xsl:if>
      <xsl:if test="position()=last()-1">
        <xsl:text>, and </xsl:text>
      </xsl:if>
      <xsl:if test="position()=last()">
        <xsl:text>!</xsl:text>
      </xsl:if>
    </xsl:for-each>
    </p>
  </body>
  </html>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
  <html>
  <body>
    <h2>My CD Collection</h2>
    <p>Titles:
    <xsl:for-each select="catalog/cd">
      <xsl:value-of select="title"/>
      <xsl:if test="position() < last()-1">
        <xsl:text>, </xsl:text>
      </xsl:if>
      <xsl:if test="position()=last()-1">
        <xsl:text>, and </xsl:text>
      </xsl:if>
      <xsl:if test="position()=last()">
        <xsl:text>!</xsl:text>
      </xsl:if>
    </xsl:for-each>
    </p>
  </body>
  </html>
</xsl:template>
</xsl:stylesheet>
'INSTANT VB TODO TASK: The following line uses invalid syntax:
'<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <body> <h2> My CD Collection</h2> <p> Titles: <xsl:for-@each @select="catalog/cd"> <xsl:value-@of @select="title"/> <xsl:if test="position() < last()-1"> <xsl:text>, </xsl:text> </xsl:if> <xsl:if test="position()=last()-1"> <xsl:text>, @and </xsl:text> </xsl:if> <xsl:if test="position()=last()"> <xsl:text>!</xsl:text> </xsl:if> </xsl:for-@each> </p> </body> </html> </xsl:template> </xsl:stylesheet>
VB   C#

7.2. Convert XML to PDF using PDFCrowd

The PDFCrowd API Client enables the rendering of HTML templates. The template syntax is based on the Jinja template rendering engine. The XML format is also supported by PDFCrowd API Client and can be used with this syntax.

// create the API client instance
pdfcrowd.HtmlToPdfClient client = new pdfcrowd.HtmlToPdfClient("{{ user_name }}", "{{ api_key }}");

// configure the conversion
client.setDataString(@"<?xml version=""1.0"" encoding=""UTF-8""?>
        <data>
          <name>World</name>
          <product>Pdfcrowd API</product>
        </data>");

// run the conversion and write the result to a file
client.convertStringToFile("Hello {{ data.name }} from {{ data.product }}", "output.pdf");
// create the API client instance
pdfcrowd.HtmlToPdfClient client = new pdfcrowd.HtmlToPdfClient("{{ user_name }}", "{{ api_key }}");

// configure the conversion
client.setDataString(@"<?xml version=""1.0"" encoding=""UTF-8""?>
        <data>
          <name>World</name>
          <product>Pdfcrowd API</product>
        </data>");

// run the conversion and write the result to a file
client.convertStringToFile("Hello {{ data.name }} from {{ data.product }}", "output.pdf");
' create the API client instance
Dim client As New pdfcrowd.HtmlToPdfClient("{{ user_name }}", "{{ api_key }}")

' configure the conversion
client.setDataString("<?xml version=""1.0"" encoding=""UTF-8""?>
        <data>
          <name>World</name>
          <product>Pdfcrowd API</product>
        </data>")

' run the conversion and write the result to a file
client.convertStringToFile("Hello {{ data.name }} from {{ data.product }}", "output.pdf")
VB   C#

8. Convert Images to PDF

8.1. Convert Images to PDF using IronPDF

In the IronPDF library, PDF documents can be easily constructed from one or more image files using the IronPdf.ImageToPdfConverter Class.

// One or more images as IEnumerable.  This example selects all JPEG images in a specific 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.
using var PDF = ImageToPdfConverter.ImageToPdf(ImageFiles);
PDF.SaveAs(@"C:\project\composite.pdf");

//Also see PdfDocument.RasterizeToImageFiles() method to flatten a PDF to images or thumbnails
// One or more images as IEnumerable.  This example selects all JPEG images in a specific 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.
using var PDF = ImageToPdfConverter.ImageToPdf(ImageFiles);
PDF.SaveAs(@"C:\project\composite.pdf");

//Also see PdfDocument.RasterizeToImageFiles() method to flatten a PDF to images or thumbnails
' One or more images as IEnumerable.  This example selects all JPEG images in a specific folder.
Dim 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.
Dim PDF = ImageToPdfConverter.ImageToPdf(ImageFiles)
PDF.SaveAs("C:\project\composite.pdf")

'Also see PdfDocument.RasterizeToImageFiles() method to flatten a PDF to images or thumbnails
VB   C#

8.2. Convert Images to PDF using PDFCrowd

PDFCrowd also provides the facility to convert images to PDF with a variety of options. It also provides an option to convert an image from a URL. The following code shows how to convert an image to PDF from local storage.

// create the API client instance
pdfcrowd.ImageToPdfClient client = new pdfcrowd.ImageToPdfClient("your_username", "your_apikey");

// run the conversion and write the result to a file
client.convertFileToFile("/path/to/logo.png", "logo.pdf");
// create the API client instance
pdfcrowd.ImageToPdfClient client = new pdfcrowd.ImageToPdfClient("your_username", "your_apikey");

// run the conversion and write the result to a file
client.convertFileToFile("/path/to/logo.png", "logo.pdf");
' create the API client instance
Dim client As New pdfcrowd.ImageToPdfClient("your_username", "your_apikey")

' run the conversion and write the result to a file
client.convertFileToFile("/path/to/logo.png", "logo.pdf")
VB   C#

9. Licensing

PDFCrowd is a web service that creates PDF files from other formats online. It comes with different price structures, the lowest being $11/month for a limit of 200 credits, where 1 credit equals 0.5Mb of output data. You can also sign up for free trial. The detailed pricing can be checked here on the pricing page of PDFCrowd.

IronPDF, on the other hand, is a C# PDF library. It is free for development and can always be licensed for commercial deployment. Licenses are available for single-project use, single developers, agencies and global corporations, as well as SaaS and OEM redistribution. All licenses include: a 30-day money-back guarantee, one year of product support & updates, validity for dev/staging/production, and also a permanent license (one-time purchase). The Lite package starts from $749. IrondPDF packages are permanent and there are no ongoing costs, while in comparison, PDFCrowd does have ongoing costs.

10. Summary and Conclusion

Summary

IronPDF does not render HTML to PDF from a remote server. It actually spins up an instance of a real standard compliant web browser behind the scenes (without any additional software needing to be installed). The HTML is rendered with complete accuracy - and in a vector format suitable for the highest standards of commercial printing. The output is a clean and high-quality PDF. It is openly commercial, with licensing and pricing details all published on the website.

PDFCrowd also converts the HTML in any given format to PDF with the highest accuracy and absolutely no downtime, as it runs on cloud servers at multiple locations. PDFCrowd is a web-based API that offers an online service to convert to PDF. Server-side API client libraries make it easy for you to use the Pdfcrowd HTML to PDF API. These libraries are available in a variety of popular server-side programming languages. Pricing details are listed on the website.

Conclusion

IronPDF has a slight advantage over PDFCrowd as it can work offline once installed. IronPDF is highly recommended for pragmatic coders seeking to work effectively and efficiently. Most importantly, it is time-saving. PDFCrowd can be useful when dealing with PDFs in different server-side languages. Moreover, IronPDF packages provide a lifetime license, and there are no ongoing costs, while PDFCrowd does have ongoing costs.

< PREVIOUS
Accusoft Prizmdoc PDF Viewer Tutorial and Comparison
NEXT >
IronPDF and Docraptor - A Comprehensive Comparison

Ready to get started? Version: 2024.10 just released

Free NuGet Download Total downloads: 11,308,499 View Licenses >