Module · Regira.Office.PDF

PDF in .NET.
Pick the engine, keep the code.

HTML to PDF, merging, splitting, text extraction, page rendering and printing — declared as separate interfaces, so a class asks for the one capability it needs. Several provider packages implement them; the one you register is the only place its name appears.

← All Office modules

§ 01The contract

What every provider gives you.

The interfaces below are the part that does not change when you swap the library underneath. Each provider then adds whatever extras its own library exposes.

01

HTML → PDF

Pass HTML, a page size, margins and header/footer fragments. Returns a file object you can save, stream or attach.

02

Merge & split

Combine any number of PDFs into one, or cut a document into page ranges — monthly archives, per-recipient splits.

03

Text & images

Extract plain text for search indexing, render pages to images for thumbnails, or build a PDF from a set of images.

04

Printing

Send a document to a physical printer through a separate IPdfPrinter contract, with PDFtoPrinter or SimpleFreePdfPrinter behind it.

Interfaces
IHtmlToPdfServiceIPdfMergerIPdfSplitterIPdfTextExtractorIPdfToImageServiceIImagesToPdfServiceIPdfPrinter
§ 02Providers

7 published implementations.

Install the one that fits your runtime and licensing, and name it once at registration. Every package here is published on nuget.org.

DocNETPlaywrightPDFtoPrinterSimpleFreePdfPrinterPuppeteerSharpSelectPdfSpire
§ 03In code

Inject the interface. Name the provider once.

The provider appears where the concrete class is constructed, and nowhere else. Always-current samples live in the package documentation.

HTML to PDF, then merge and extractC#
// HTML in, PDF out. Swap SelectPdf for DocNET, Spire, Playwright or PuppeteerSharp
// and this method does not change.
IHtmlToPdfService pdf = new Regira.Office.PDF.SelectPdf.PdfManager();

IMemoryFile invoice = await pdf.Create(new HtmlInput
{
    HtmlContent = html,
    Format      = PageSize.A4,
    Margins     = new Margins { Top = 20, Bottom = 20, Left = 15, Right = 15 }
});

// Merging and text extraction are their own contracts, on the same file object.
IPdfMerger merger = new Regira.Office.PDF.DocNET.PdfManager(imageService);
IMemoryFile archive = (await merger.Merge([invoice, terms]))!;

IPdfTextExtractor extractor = new Regira.Office.PDF.DocNET.PdfManager(imageService);
string text = await extractor.GetText(archive);
§ 04Without .NET

The same thing, over HTTP.

Generate a PDF from HTML or images, render pages as images, merge documents, extract plain text and split by page range — over plain HTTP, from any language.

Call it from any language.

The free tier needs no key and is rate-limited to 5 requests / 60 s. A trial or commercial key removes the limit — send it in the X-License-Key header.

Also explore

Word

Fill a .docx template with values and repeating tables, merge documents and convert to PDF — over Spire or MiniWord.