# IWorkKeynoteDocument

Creates native Keynote presentations containing positioned text, PNG/JPEG images and scalar tables.

Class 

`OfficeIMO.IWork`

**Namespace**

`OfficeIMO.IWork`

**Assembly**

`OfficeIMO.IWork`

**Source revision**

`5e5a2dda74b3` with working tree changes

**Source**

[IWorkKeynoteDocument.cs:25](https://github.com/EvotecIT/OfficeIMO/blob/5e5a2dda74b33242f1f075718ee568bb355c03ba/OfficeIMO.IWork/Creation/IWorkKeynoteDocument.cs#L25)

**Implements**

`IDisposable`

**Modifiers**

sealed

Creates native Keynote presentations containing positioned text, PNG/JPEG images and scalar tables.

## Inheritance

- object
- IWorkKeynoteDocument

## Remarks

This creation model does not modify loaded iWork packages. Instances are not thread safe.

## Usage

Explore 1 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 1

- Method [IWorkKeynoteDocument.Create](/api/iwork/officeimo-iwork-iworkkeynotedocument/#method-create-single-single)

Filter members 

Show inherited

## Methods

`public IWorkKeynoteSlideBuilder AddSlide(string backgroundColor = "FFFFFF")` [#](#method-addslide-string)

[IWorkKeynoteDocument.cs:29](https://github.com/EvotecIT/OfficeIMO/blob/5e5a2dda74b33242f1f075718ee568bb355c03ba/OfficeIMO.IWork/Creation/IWorkKeynoteDocument.cs#L29)

Adds a blank slide with an opaque six-digit sRGB background color.

Parameters

**backgroundColor string = "FFFFFF" optional**

Returns

`IWorkKeynoteSlideBuilder`

Create 2 overloads

`public static IWorkKeynoteDocument Create(float widthPoints = 960, float heightPoints = 540)` [#](#method-create-single-single)

[IWorkKeynoteDocument.cs:25](https://github.com/EvotecIT/OfficeIMO/blob/5e5a2dda74b33242f1f075718ee568bb355c03ba/OfficeIMO.IWork/Creation/IWorkKeynoteDocument.cs#L25)

Creates an empty presentation with a 960 by 540 point canvas by default.

Parameters

**widthPoints float = 960 optional**

**heightPoints float = 540 optional**

Returns

`IWorkKeynoteDocument`

`public static IWorkKeynoteDocument Create(string path)` [#](#method-create-string)

[IWorkKeynoteDocument.Lifecycle.cs:9](https://github.com/EvotecIT/OfficeIMO/blob/5e5a2dda74b33242f1f075718ee568bb355c03ba/OfficeIMO.IWork/Creation/IWorkKeynoteDocument.Lifecycle.cs#L9)

Creates a native authoring model associated with a path, without writing a file.

Parameters

**path string required**

Returns

`IWorkKeynoteDocument`

`public void Dispose()` [#](#method-dispose)

[IWorkKeynoteDocument.Lifecycle.cs:18](https://github.com/EvotecIT/OfficeIMO/blob/5e5a2dda74b33242f1f075718ee568bb355c03ba/OfficeIMO.IWork/Creation/IWorkKeynoteDocument.Lifecycle.cs#L18)

Completes this managed authoring model's lifetime. No native application, file or caller stream is retained.

Save 3 overloads

`public void Save(Stream destination, IWorkKeynoteSaveOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-save-io-stream-officeimo-iwork-iworkkeynotesaveoptions-threading-cancellationtoken)

[IWorkKeynoteDocument.cs:42](https://github.com/EvotecIT/OfficeIMO/blob/5e5a2dda74b33242f1f075718ee568bb355c03ba/OfficeIMO.IWork/Creation/IWorkKeynoteDocument.cs#L42)

Writes a completed package at the stream's current position and leaves the stream open.

Parameters

**destination System.IO.Stream required**

**options OfficeIMO.IWork.IWorkKeynoteSaveOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

`public void Save(string path, bool overwrite = false, IWorkKeynoteSaveOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-save-string-boolean-officeimo-iwork-iworkkeynotesaveoptions-threading-cancellationtoken)

[IWorkKeynoteDocument.cs:52](https://github.com/EvotecIT/OfficeIMO/blob/5e5a2dda74b33242f1f075718ee568bb355c03ba/OfficeIMO.IWork/Creation/IWorkKeynoteDocument.cs#L52)

Atomically saves a native Keynote package, rejecting an existing path unless overwrite is enabled.

Parameters

**path string required**

**overwrite bool = false optional**

**options OfficeIMO.IWork.IWorkKeynoteSaveOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

`public void Save(bool overwrite = false, IWorkKeynoteSaveOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-save-boolean-officeimo-iwork-iworkkeynotesaveoptions-threading-cancellationtoken)

[IWorkKeynoteDocument.Lifecycle.cs:15](https://github.com/EvotecIT/OfficeIMO/blob/5e5a2dda74b33242f1f075718ee568bb355c03ba/OfficeIMO.IWork/Creation/IWorkKeynoteDocument.Lifecycle.cs#L15)

Saves to the associated path; replacing an existing file still requires explicit overwrite.

Parameters

**overwrite bool = false optional**

**options OfficeIMO.IWork.IWorkKeynoteSaveOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

`public byte[] ToBytes(IWorkKeynoteSaveOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-tobytes-officeimo-iwork-iworkkeynotesaveoptions-threading-cancellationtoken)

[IWorkKeynoteDocument.cs:37](https://github.com/EvotecIT/OfficeIMO/blob/5e5a2dda74b33242f1f075718ee568bb355c03ba/OfficeIMO.IWork/Creation/IWorkKeynoteDocument.cs#L37)

Encodes a deterministic native single-file Keynote package without a template or native application.

Parameters

**options OfficeIMO.IWork.IWorkKeynoteSaveOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`byte[]`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public IWorkCanvasSize SlideSize { get; }` [#](#property-slidesize)

[IWorkKeynoteDocument.cs:19](https://github.com/EvotecIT/OfficeIMO/blob/5e5a2dda74b33242f1f075718ee568bb355c03ba/OfficeIMO.IWork/Creation/IWorkKeynoteDocument.cs#L19)

Gets the presentation canvas size in points.

`public IReadOnlyList<IWorkKeynoteSlideBuilder> Slides { get; }` [#](#property-slides)

[IWorkKeynoteDocument.cs:21](https://github.com/EvotecIT/OfficeIMO/blob/5e5a2dda74b33242f1f075718ee568bb355c03ba/OfficeIMO.IWork/Creation/IWorkKeynoteDocument.cs#L21)

Gets the slides in presentation order.

`public string? FilePath { get; private set; }` [#](#property-filepath)

[IWorkKeynoteDocument.Lifecycle.cs:5](https://github.com/EvotecIT/OfficeIMO/blob/5e5a2dda74b33242f1f075718ee568bb355c03ba/OfficeIMO.IWork/Creation/IWorkKeynoteDocument.Lifecycle.cs#L5)

Gets the associated output path; stream saves do not change it.

<!-- PowerForge markdown artifact sha256:DE4B54B5C5D4C012CC6DAD50BFCCF1706EA57ECF794D282680E7F82B1797EF4B -->
