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:
Converttakes the.pptxas abyte[]and returns the PDF as abyte[], one page per slide. - No
PageSetup: each page is the slide's own size. A 16:9 deck made byPresentationEditorrenders as 960 × 540 pt. - A legacy
.pptis 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.