# Save-OfficeEpub

Saves a native EPUB publication, rejecting loss unless explicitly allowed.

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`OfficeIMO.Epub.EpubPublication`

**Outputs**

`OfficeIMO.Epub.EpubWriteReport`

**Source**

[SaveOfficeEpubCommand.cs:15](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/PowerShell/PSWriteOffice/Sources/PSWriteOffice/Cmdlets/Epub/SaveOfficeEpubCommand.cs#L15) 

Saves a native EPUB publication, rejecting loss unless explicitly allowed.

## Syntax

```
Save-OfficeEpub
[-AllowLoss]
-Document <EpubPublication>
[-GrayscaleImages]
[-MaxOutputBytes <Int64>]
[-PassThru]
[[-Path] <String>]
[-ReaderProfile <Standard|Kobo|SendToKindle|EInkCompact|EInkLarge>]
[-RemoveInvalidatedSignatures]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#method-save-officeepub-switchparameter-epubpublication-switchparameter-int64-switchparameter-string-epubreaderprofile-switchparameter-switchparameter-switchparameter)

Parameter set: `Document`

## Description

Save replaces its destination after validation. PassThru returns the native write report.

Use -WhatIf to preview writing the EPUB or -Confirm to prompt before writing.

## Guides & Samples

Authored walkthroughs and practical samples linked to this command.

- [Project, Access, and EPUB Files](/docs/pswriteoffice/project-access-epub/) Guide
  
  Create and read Microsoft Project schedules, Access databases and EPUB books from PowerShell, without Project or Access installed.
- [Create and Edit EPUB Files](/docs/epub/create/) Guide
  
  Create EPUB 3 or EPUB 2 e-books in .NET with chapters, styles, images and a table of contents, import an HTML manuscript, and run a preflight check.

## Examples

### Save a live publication to its associated path and inspect the report.

```powershell
$report = $book | Save-OfficeEpub -PassThru
```

## Parameters

**-AllowLoss SwitchParameter optional**

Permit reductions reported by the package writer.

**-Document EpubPublication requiredpipeline: True (ByValue)**

Live editable publication.

**-GrayscaleImages SwitchParameter optional**

Convert supported raster pixels to grayscale with an e-ink EPUB profile.

**-MaxOutputBytes Int64 optional**

Maximum compressed output size.

**-PassThru SwitchParameter optional**

Return the native write report.

**-Path String optionalposition: 0**

Destination path; omission uses the native publication's associated path.

**-ReaderProfile EpubReaderProfile optional**

Reader profile for EPUB output. Kobo requires a .kepub.epub path.

Possible values: `Standard`, `Kobo`, `SendToKindle`, `EInkCompact`, `EInkLarge`

**-RemoveInvalidatedSignatures SwitchParameter optional**

Explicitly remove signatures invalidated by edits. Reported loss still requires AllowLoss.

**-WhatIf SwitchParameter optional**

Shows what would happen if the command runs.

**-Confirm SwitchParameter optional**

Prompts for confirmation before running the command.

## Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see [about_CommonParameters](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

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