Table of Contents

Interface IPptxToPdfConverter

Namespace
DocToolkit.Extensions.DependencyInjection
Assembly
DocToolkit.Extensions.DependencyInjection.dll

Renders an PowerPoint (.pptx) presentation to PDF. Registered by AddDocToolkit(IServiceCollection, Action<DocToolkitOptions>?).

One page per slide, at the deck's own slide geometry rather than a paper size.

public interface IPptxToPdfConverter

Methods

Convert(byte[])

Renders the .pptx in pptx and returns PDF bytes.

byte[] Convert(byte[] pptx)

Parameters

pptx byte[]

Returns

byte[]

Exceptions

ArgumentNullException

pptx is null.

ArgumentException

pptx is empty.

DocumentConversionException

It could not be rendered.

ConvertAsync(Stream, Stream, CancellationToken)

Reads a .pptx from source and writes the rendered PDF to destination. Neither stream is disposed, closed, sought or read back; the PDF is written straight through as the renderer produces it, so a failure part-way leaves whatever had already been produced on destination.

Task ConvertAsync(Stream source, Stream destination, CancellationToken ct = default)

Parameters

source Stream
destination Stream
ct CancellationToken

Returns

Task

Exceptions

ArgumentNullException

Either stream is null.

ArgumentException

source is not readable or held no bytes, or destination is not writable.

OperationCanceledException

ct was cancelled.

DocumentConversionException

It could not be rendered.