PowGrade.FileConverters.PptxToPdf
A high-performance .NET library for converting PPTX (PowerPoint) files to PDF with zero third-party dependencies. Also ships with a ready-to-use command-line tool.
Features
- Zero Dependencies: No external NuGet packages required for core functionality
- Core Integration: Supports
PowGrade.FileConverters.Core via explicit bootstrap plus IFileConverter adapter
- Multi-Target: Supports both .NET 8.0 and .NET Standard 2.1
- Parallel Processing: Optional slide-level parallelization for faster conversion
- Stream-Based: Support for both file path and stream-based conversion
- CJK Support: Proper handling of Chinese, Japanese, and Korean characters
Feature Completeness
Core Pipeline
| Area |
Status |
Notes |
| PPTX parsing |
✅ Complete |
Full OOXML format support |
| Slide rendering |
✅ Complete |
End-to-end conversion chain |
| PDF output |
✅ Complete |
Standard PDF generation |
| PDF bookmarks / outlines |
✅ Complete |
Slide titles emitted as outline entries |
| PDF page labels |
✅ Complete |
Slide, notes, and comments pages emit viewer-visible labels |
| PDF metadata |
✅ Complete |
Core properties mapped to PDF Info + XMP, with custom properties emitted into both XMP and normalized PDF Info custom keys |
| Library API |
✅ Complete |
Simple Convert() method with file path or stream |
| CLI tool |
✅ Complete |
PowGrade.FileConverters.PptxToPdf.Cli with direct-mode --parallel / --strict plus explicit --core bootstrap mode |
PPTX Parsing
| Feature |
Status |
Notes |
| Slide master / layout inheritance |
✅ Complete |
Color maps, text styles, default formatting |
| Theme parsing (colors, fonts, effects, format scheme) |
✅ Complete |
Full scheme color resolution |
| Slide transitions & timing |
✅ Parsed |
Data model captured; not rendered (N/A for PDF) |
| Animations |
✅ Parsed |
Data model captured; not rendered (N/A for PDF) |
| Speaker notes |
✅ Complete |
Optional appended notes pages via direct API / adapter / CLI, plus Core workflow when PptxToPdfCoreConversionOptionsContext is used; overflow continues onto additional pages |
| Comments / comment authors |
✅ Complete |
Optional appended comments pages via direct API / adapter / CLI, plus Core workflow when PptxToPdfCoreConversionOptionsContext or PptxToPdfCoreConverter is used; legacy and modern threaded comments, grouped replies, author/time/location sections, slide-position ordering, overflow continuation, and back-links to the source slide are supported |
| Document properties |
✅ Complete |
Core, extended & custom properties parsed; core fields emitted to PDF Info + XMP and custom properties emitted to XMP plus normalized PDF Info custom keys |
| Hyperlinks |
✅ Complete |
Internal / external link resolution plus PDF link annotations for shape text runs, pictures, tables, chart frames, bar/column chart data points, SmartArt objects, and SmartArt nodes |
Shape Rendering
| Feature |
Status |
Notes |
| Basic shapes (rect, ellipse, triangle, diamond, etc.) |
✅ Complete |
|
| Polygons & stars |
✅ Complete |
|
| Arrows (right, left, up, down) |
✅ Complete |
|
| Decorative shapes (heart, cloud) |
✅ Complete |
|
| Custom geometry / freeform paths |
✅ Complete |
Via PathRenderer with Bézier support |
| Shape rotation & transform |
✅ Complete |
|
| Connectors |
✅ Complete |
Straight, elbow, curved |
| Group shapes (nested) |
✅ Complete |
Recursive child parsing |
Fill & Outline
| Feature |
Status |
Notes |
| Solid fill |
✅ Complete |
|
| Gradient fill (linear, radial, rectangular, path) |
✅ Complete |
Multi-stop stitching supported |
| Pattern fill |
⚠️ Approximate |
Simplified rendering |
| Picture fill |
⚠️ Simplified |
Basic stretch/tile rendering plus common srcRect crop support; advanced tile parameters may differ |
| Shape outline (width, color, dash styles) |
✅ Complete |
|
Text Rendering
| Feature |
Status |
Notes |
| Paragraph alignment & spacing |
✅ Complete |
|
| Word wrap |
✅ Complete |
Estimated glyph metrics |
| Font, size, color, bold, italic, underline, strikethrough |
✅ Complete |
|
| Superscript / subscript |
✅ Complete |
Baseline offset |
| Bullet styles (char, auto-number) |
✅ Complete |
|
| Text body properties (margins, vertical alignment, auto-fit) |
✅ Complete |
|
| CJK (Chinese/Japanese/Korean) detection |
✅ Complete |
Font fallback for CJK text |
Font Handling
| Feature |
Status |
Notes |
| 14 PDF standard fonts |
✅ Complete |
|
| System font embedding (TrueType & Type0/CIDFont) |
✅ Complete |
CMap + ToUnicode for Unicode text |
| Font metrics & width tables |
✅ Complete |
|
Image Support
| Feature |
Status |
Notes |
| JPEG |
✅ Native |
Passed through directly |
| PNG |
⚠️ Simplified |
Decoded to raw pixels & re-encoded |
| BMP |
✅ Complete |
Lossless pixel extraction with alpha-mask support |
| GIF / TIFF |
✅ Complete |
GIF first frame and TIFF first page are embedded through the raster image path |
| SVG |
✅ Windows-only |
Rasterized on net8.0 Windows through a pragmatic subset-based fallback and embedded through the raster image path; practical text rendering, translate / scale / rotate, and basic ellipse / polyline / polygon rendering are included in the supported subset |
| EMF / WMF |
✅ Windows-only |
Rasterized on net8.0 Windows and embedded through the raster image path; unsupported or explicitly disabled runtimes warn and skip metafile content |
| Image effects (shadow, glow, reflection, bevel, soft edges, 3-D rotation) |
⚠️ Approximate |
|
Table Rendering
| Feature |
Status |
Notes |
| Row / column structure |
✅ Complete |
|
| Merged cells (horizontal & vertical) |
✅ Complete |
|
| Cell borders (per-edge style) |
✅ Complete |
|
| Cell text with paragraph formatting |
✅ Complete |
|
| Table hyperlinks |
✅ Complete |
Cell-level and run-level PDF link annotations |
| Table styles (header row, banding) |
⚠️ Approximate |
|
Charts
| Feature |
Status |
Notes |
| Bar / Column / Line / Pie / Area / Doughnut charts |
⚠️ Simplified |
Rendered from parsed data; pie/doughnut firstSliceAng and doughnut holeSize honored; visual approximation |
| Scatter |
⚠️ Simplified |
Basic marker rendering from parsed x/y data; visual approximation |
| Radar |
⚠️ Simplified |
Basic polygon and marker rendering from parsed category/value data; visual approximation |
| Bubble |
⚠️ Simplified |
Basic bubble rendering from parsed x/y/bubbleSize data; visual approximation |
| Stock |
⚠️ Simplified |
Basic OHLC rendering from parsed 4-series stock data; visual approximation |
| Axes, gridlines, legend |
⚠️ Simplified |
Basic rendering; category/value axis metadata plus value-axis baselines and major gridlines are modeled and rendered |
SmartArt
| Feature |
Status |
Notes |
| List (vertical / horizontal) |
⚠️ Simplified |
|
| Process / Cycle / Matrix / Pyramid |
⚠️ Simplified |
|
| Hierarchy / Org chart |
⚠️ Simplified |
|
| Relationship / Target |
⚠️ Simplified |
|
| Hyperlinks |
✅ Complete |
Graphic-frame / object-level plus node-level PDF link annotations |
Background
| Feature |
Status |
Notes |
| Solid color background |
✅ Complete |
|
| Gradient / image background |
⚠️ Partial |
Solid, gradient, and common stretch/tile/cropped image backgrounds render; advanced blipFill options remain unverified |
| Feature |
Status |
Notes |
| Slide-level parallel processing |
✅ Complete |
--parallel flag / API parameter |
| Serial lock on PDF write phase |
⚠️ By design |
Prevents interleaved output |
Installation
NuGet Package
Install-Package PowGrade.FileConverters.PptxToPdf
Build from Source
git clone <repository-url>
cd FileConverters.PptxToPdf
dotnet build src/PowGrade.FileConverters.PptxToPdf/PowGrade.FileConverters.PptxToPdf.csproj
Verification
Run the repository-level Release verification script to build the solution, execute the smoke apps, and pack the library:
./scripts/verify-release.ps1
Verification contract by platform:
- On Windows,
verify-release.ps1 runs the full smoke matrix, including SvgSmoke, MetafileSmoke, SvgTextSmoke, and SvgAdvancedSmoke.
- On non-Windows runtimes,
SvgSmoke and MetafileSmoke remain part of the gate and are expected to validate warning-and-skip behavior for unsupported rasterization paths.
- On non-Windows runtimes,
SvgTextSmoke and SvgAdvancedSmoke are Windows-only fidelity smokes and are skipped intentionally instead of failing the gate.
Usage
Using PowGrade.FileConverters.Core
using PowGrade.FileConverters;
using PowGrade.FileConverters.PptxToPdf;
PptxToPdfCoreRegistration.EnsureRegistered();
using var inputStream = File.OpenRead("input.pptx");
using var convertedStream = Converter.Convert(inputStream, "pptx", "pdf");
using var outputStream = File.Create("output.pdf");
convertedStream.CopyTo(outputStream);
Call PptxToPdfCoreRegistration.EnsureRegistered() after the converter-bearing assemblies you need are loaded. If a host loads additional converter assemblies later, call it again to bootstrap those newly loaded types.
If you want the same Core path without manually handling bootstrap, ambient options, and structured result capture, use the typed facade:
using PowGrade.FileConverters.PptxToPdf;
using var inputStream = File.OpenRead("input.pptx");
var conversion = PptxToPdfCoreConverter.ConvertWithResult(
inputStream,
exportSpeakerNotes: true,
exportComments: true);
using var outputStream = File.Create("output.pdf");
conversion.OutputStream.CopyTo(outputStream);
Console.WriteLine($"Warnings: {conversion.ConversionResult.WarningCount}");
To enable speaker notes or comments when you go through PowGrade.FileConverters.Core, push the converter-specific ambient options before calling Converter.Convert():
using PowGrade.FileConverters;
using PowGrade.FileConverters.PptxToPdf;
PptxToPdfCoreRegistration.EnsureRegistered();
using var inputStream = File.OpenRead("input.pptx");
using (PptxToPdfCoreConversionOptionsContext.Push(new PptxToPdfCoreConversionOptions(
ExportSpeakerNotes: true,
ExportComments: true)))
using var convertedStream = Converter.Convert(inputStream, "pptx", "pdf");
using var outputStream = File.Create("output.pdf");
convertedStream.CopyTo(outputStream);
SVG, EMF, and WMF rasterization are only available on Windows runtimes. To make the metafile boundary explicit during validation or rollout, set POWGRADE_PPTXTOPDF_DISABLE_METAFILE_RASTERIZATION=1 to force warning-and-skip behavior for EMF / WMF content.
Using The Adapter Directly
using PowGrade.FileConverters.PptxToPdf;
using var inputStream = File.OpenRead("input.pptx");
var fileConverter = new PptxToPdfFileConverter();
using var convertedStream = fileConverter.Convert(inputStream);
using var outputStream = File.Create("output.pdf");
convertedStream.CopyTo(outputStream);
As a Library
using PowGrade.FileConverters.PptxToPdf;
var converter = new PptxToPdfConverter();
// Basic conversion
converter.Convert("input.pptx", "output.pdf");
// Parallel mode (faster for large decks)
converter.Convert("input.pptx", "output.pdf", useParallelProcessing: true);
// Append notes pages after slides that contain speaker notes
converter.Convert("input.pptx", "output-with-notes.pdf", exportSpeakerNotes: true);
// Stream-based conversion
using var input = File.OpenRead("input.pptx");
using var output = File.Create("output.pdf");
converter.Convert(input, output);
// Adapter path with structured result
var adapter = new PptxToPdfFileConverter();
using var adapterInput = File.OpenRead("input.pptx");
var conversion = adapter.ConvertWithResult(adapterInput);
using var adapterOutput = conversion.OutputStream;
Console.WriteLine($"Warnings: {conversion.ConversionResult.WarningCount}");
# Basic
PowGrade.FileConverters.PptxToPdf.Cli input.pptx output.pdf
# With parallel processing
PowGrade.FileConverters.PptxToPdf.Cli input.pptx output.pdf --parallel
# Append speaker notes after slides that contain notes
PowGrade.FileConverters.PptxToPdf.Cli input.pptx output.pdf --notes
# Append speaker notes through the Core entry path
PowGrade.FileConverters.PptxToPdf.Cli input.pptx output.pdf --core --notes
# Append comments through the Core entry path
PowGrade.FileConverters.PptxToPdf.Cli input.pptx output.pdf --core --comments
# Inspect PPTX metadata without converting to PDF
PowGrade.FileConverters.PptxToPdf.Cli --inspect-metadata input.pptx
# Using explicit Core bootstrap + Converter entry point
PowGrade.FileConverters.PptxToPdf.Cli input.pptx output.pdf --core
# Invalid: direct-only options cannot be combined with --core
# PowGrade.FileConverters.PptxToPdf.Cli input.pptx output.pdf --core --parallel
# PowGrade.FileConverters.PptxToPdf.Cli input.pptx output.pdf --core --strict
# Help
PowGrade.FileConverters.PptxToPdf.Cli --help
Project Structure
src/
├── PowGrade.FileConverters.PptxToPdf/ # Core library
│ ├── PptxToPdfConverter.cs # Public API entry point
│ ├── PptxToPdfCoreConverter.cs # Typed Core facade with structured result capture
│ ├── PptxToPdfFileConverter.cs # IFileConverter implementation
│ ├── PptxToPdfFileConversionOutput.cs # Adapter output stream + structured result
│ ├── PptxToPdfCoreConversionOptionsContext.cs # Ambient Core-mode export options
│ ├── PptxMetadataInspector.cs # Read-only PPTX metadata inspection API
│ ├── Pptx/ # PPTX / OOXML parsing
│ │ ├── PptxDocument.cs # ZIP archive reader & part loader
│ │ ├── Presentation.cs # Presentation-level properties
│ │ ├── Slide.cs # Slide & connector parsing
│ │ ├── SlideMaster.cs # Master, layout, color map, text styles
│ │ ├── Theme.cs # Theme colors, fonts, effects
│ │ ├── Shape.cs # AutoShape geometry, fill, text
│ │ ├── GroupShape.cs # Group shape tree
│ │ ├── Picture.cs # Embedded image references
│ │ ├── Table.cs # Table, row, cell, borders
│ │ ├── Chart.cs # Chart data & series
│ │ ├── SmartArt.cs # SmartArt diagrams
│ │ ├── Background.cs # Slide background
│ │ ├── Hyperlink.cs # Hyperlink resolution
│ │ ├── Animation.cs # Animation data model
│ │ ├── Notes.cs # Speaker notes & comments
│ │ └── DocumentProperties.cs # Core / extended / custom metadata
│ ├── Pdf/ # PDF generation
│ │ ├── PdfDocument.cs # PDF object tree & serialization
│ │ ├── PdfObjects.cs # Low-level PDF object types
│ │ ├── PdfRenderer.cs # Slide → PDF content stream
│ │ ├── FontManager.cs # Standard font mapping & metrics
│ │ ├── EmbeddedFontManager.cs # System font embedding (Type0)
│ │ ├── FontEmbedder.cs # TrueType font file reader
│ │ ├── GradientRenderer.cs # Gradient shading patterns
│ │ ├── PathRenderer.cs # Custom geometry → PDF paths
│ │ └── ImageEffectsRenderer.cs # Shadow, glow, reflection, etc.
│ ├── Image/ # Image processing
│ │ ├── ImageConverter.cs # Format conversion / PDF image preparation
│ │ ├── ImageDecoder.cs # Raw pixel extraction
│ │ ├── SvgRasterizer.cs # SVG raster fallback on Windows
│ │ └── MetafileRasterizer.cs # EMF / WMF raster fallback on Windows
│ └── Models/ # Shared data models
│ ├── Color.cs # Color representation & conversion
│ ├── Enums.cs # Shared enumerations
│ ├── Fill.cs, Outline.cs # Fill & outline models
│ ├── Paragraph.cs # Paragraph & run models
│ ├── Rect.cs, Geometry.cs # Geometry primitives
│ ├── ShapeTypeMapping.cs # OOXML preset → internal shape type
│ ├── TextProperties.cs # Text body / paragraph properties
│ ├── Transform2D.cs # 2-D transform
│ ├── GradientStop.cs # Gradient stop model
│ └── ShapeEffects.cs # Shadow, glow, reflection effects
└── PowGrade.FileConverters.PptxToPdf.Cli/ # Command-line interface
└── Program.cs
test/
├── CliSmoke/ # CLI direct/core smoke verification
├── ChartPointLinkSmoke/ # Chart data-point hyperlink verification
├── CommentsSmoke/ # Comments export verification
├── ThreadedCommentsSmoke/ # Modern threaded comments verification
├── SmartArtLinkSmoke/ # SmartArt hyperlink verification
├── SmartArtNodeLinkSmoke/ # SmartArt node hyperlink verification
├── ShapeRunLinkSmoke/ # Shape text run hyperlink verification
├── SvgSmoke/ # Cross-platform SVG runtime-boundary verification
├── SvgTextSmoke/ # Windows-only SVG text rendering verification
├── SvgAdvancedSmoke/ # Windows-only SVG transforms and advanced shapes verification
├── OverflowSmoke/ # Supplemental notes/comments overflow verification
├── TableLinkSmoke/ # Table hyperlink verification
├── CoreHostSmoke/ # Core bootstrap/coexistence smoke verification
├── CoreFacadeSmoke/ # Typed Core facade smoke verification
├── MetadataInspectSmoke/ # Read-only metadata inspection verification
└── TestApp/ # End-to-end parser/renderer smoke coverage
scripts/
└── verify-release.ps1 # Unified Release build/smoke/pack verification with platform-aware SVG fidelity gates
Integration with PowGrade.FileConverters.Core
This package integrates with PowGrade.FileConverters.Core through an explicit bootstrap step:
- Explicit Bootstrap: Call
PptxToPdfCoreRegistration.EnsureRegistered() before using PowGrade.FileConverters.Converter.Convert()
- Coexistence-Friendly Registration: The bootstrap registers all currently loaded
[FileConverter] types so pptx -> pdf can coexist with other converters in the same host
- Unified API: Once bootstrapped, use
PowGrade.FileConverters.Converter.Convert() for a shared conversion entry point
- Typed Core Facade: Use
PptxToPdfCoreConverter when you want the Core conversion path with built-in bootstrap, options scoping, and structured result capture
- Core Export Options: Use
PptxToPdfCoreConversionOptionsContext.Push(...) to enable notes/comments when you go through the generic Core entry point
- Structured Adapter Results: If you use
PptxToPdfFileConverter directly, prefer ConvertWithResult() / ConvertWithResultAsync() to receive the output stream together with PptxToPdfConversionResult
- Core Result Context: If you use
PowGrade.FileConverters.Converter.Convert(), read PptxToPdfCoreConversionContext.CurrentConversionResult or LastConversionResult after conversion to inspect warnings / partial failures
- Metadata Inspection: Use
PptxMetadataInspector or PowGrade.FileConverters.PptxToPdf.Cli --inspect-metadata <input.pptx> to read core, extended, and custom properties without converting to PDF
Requirements
- .NET 8.0 or .NET Standard 2.1 compatible runtime
- PowGrade.FileConverters.Core 0.1.0 or later
- No third-party NuGet packages required for core functionality
License
This project is licensed under the MIT License.