HTML to PDF, Office documents 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.
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.
Pass HTML, a page size, margins and header/footer fragments to headless Chromium — in-process with Playwright or PuppeteerSharp, or on a Gotenberg server. Returns a file object you can save, stream or attach.
Convert .docx, .xlsx and .pptx files to PDF in-process with MiniPdf, behind IDocumentToPdfService — no Office installation, server or browser.
Combine any number of PDFs into one, cut a document into page ranges, or extract plain text for search indexing. PdfPig does all of it, fully managed.
Render pages to images for thumbnails, build a PDF from a set of images, or send a document to a printer through a separate IPdfPrinter contract.
Install the one that fits your runtime and licensing, and name it once at registration. Every package here is published on nuget.org.
The provider appears where the concrete class is constructed, and nowhere else. Always-current samples live in the package documentation.
// HTML in, PDF out. Swap Playwright for PuppeteerSharp, Gotenberg or SelectPdf
// and this method does not change.
IHtmlToPdfService pdf = new Regira.Office.PDF.MsPlaywright.PdfManager();
IMemoryFile invoice = await pdf.Create(new HtmlInput
{
HtmlContent = html,
Format = PageSize.A4,
// 96 units per inch: 20 mm top and bottom, 15 mm left and right
Margins = new Margins { Top = 76, Bottom = 76, Left = 57, Right = 57 }
});
// Word, Excel and PowerPoint files convert in-process through a contract of their own.
IDocumentToPdfService documents = new Regira.Office.PDF.MiniPdf.PdfService();
IMemoryFile terms = await documents.Create(new DocumentInput { Document = termsDocx });
// Merging and text extraction are their own contracts, on the same file objects.
IPdfMerger merger = new Regira.Office.PDF.PdfPig.PdfService(imageService);
IMemoryFile archive = (await merger.Merge([invoice, terms]))!;
IPdfTextExtractor extractor = new Regira.Office.PDF.PdfPig.PdfService(imageService);
string text = await extractor.GetText(archive);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.
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.
Fill a .docx template with values, loops, repeating tables and conditional blocks, merge documents and convert to PDF — over Spire, Syncfusion, Aspose, MiniWord or Gotenberg.