Skip to main content

C# (.NET) Client Library


The DynamicPDF API provides a full‑featured client library for C#/.NET that simplifies integration with the REST endpoints.
The C# .NET client library is the official way to integrate the DynamicPDF API into any .NET application. It provides high-level classes for generating PDFs, converting HTML or images to PDF, merging multiple documents, extracting text and metadata, and performing detailed PDF inspection — all without manually constructing raw HTTP requests.

With this library, you can access the full functionality of the DynamicPDF API, including creating new PDF documents, merging or splitting existing PDFs, filling and flattening forms, stamping text and images, extracting XMP or document information, rasterizing pages, and applying encryption or other security settings. The DynamicPDF API exposes a comprehensive set of PDF-focused endpoints that support generation, conversion, processing, analysis, and secure delivery of PDF files.

The DynamicPDF API offers clean, intuitive wrappers around the following REST endpoints:

  • dlex-layout for creating dynamic PDF reports from DLEX templates and JSON data,
  • image-info for extracting detailed metadata from images,
  • pdf for creating and manipulating PDFs, merging documents, and converting HTML, Word, and Excel files to PDF,
  • pdf-info for retrieving document information and metadata from existing PDFs,
  • pdf-security-info for obtaining PDF encryption details and security settings,
  • pdf-text for extracting text content from PDF pages, and
  • pdf-xmp for reading embedded XMP metadata from PDF files.

Installation

Obtain the NuGet package at https://www.nuget.org/packages/DynamicPDF.API

dotnet add package DynamicPDF.API

Source & Repo

Usage Example

public static void Merge(string apiKey)
{
Pdf pdf = new Pdf();
pdf.ApiKey = apiKey;
var inputA = pdf.AddPdf("DocA.pdf");
pdf.AddPdf("DocB.pdf");
pdf.AddPdf("DocC.pdf");
PdfResponse pdfResponse = pdf.Process();
File.WriteAllBytes("output.pdf", pdfResponse.Content);
}
Source: MergePdfs.cs