Convert PPTX to PDF in C#

PptxToPdfConverter renders a PowerPoint deck to PDF, one page per slide, with no PowerPoint and no LibreOffice. It also takes a legacy .ppt file directly.

using DocToolkit;

byte[] pptx = File.ReadAllBytes("input.pptx");
byte[] pdf = PptxToPdfConverter.Convert(pptx);
File.WriteAllBytes("output.pdf", pdf);

What it needs

  • No browser, headless or otherwise.
  • No Office install, and no LibreOffice.
  • No native files: managed code only.
  • No network at runtime, unless you ask for it.

Good to know

  • Synchronous: Convert takes the .pptx as a byte[] and returns the PDF as a byte[], one page per slide.
  • No PageSetup: each page is the slide's own size. A 16:9 deck made by PresentationEditor renders as 960 × 540 pt.
  • A legacy .ppt is accepted too, to PDF only.
  • Without PdfFontOptions, a slide with non-Latin text the host's fonts cannot encode is refused, naming the first such character.

Install

dotnet add package Ank.DocToolkit

NuGetDocumentationGitHub