Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

Stars 654
Forks 82
Open issues 1
Total downloads 4,320,051
Release OfficeIMO-v3.5.3
Language: C# Updated: 2026-11-03
Cmdlet

Save-OfficePdf

Module
PSWriteOffice
Inputs
OfficeIMO.Pdf.PdfDocument
Outputs
OfficeIMO.Pdf.PdfDocument

Saves an OfficeIMO.Pdf document.

Syntax

Save-OfficePdf
[-Document] <PdfDocument>
[-Open]
[-OwnerPassword <String>]
[-PassThru]
[-Password <String>]
[-Path] <String>
[-Permission <Int32>]
[<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

Use this command when a PDF is built in memory and saved later, or when a pipeline should continue with the saved file. The document is saved through the normal OfficeIMO.Pdf save path.

Examples

Build a PDF in memory and save it later.

$pdf = New-OfficePdf { PdfHeading 'Queued report'; PdfParagraph 'Generated in memory.' }
$pdf | Save-OfficePdf -Path .\QueuedReport.pdf

Creates a PDF document object first, then saves it to disk.

Parameters

-Document PdfDocument requiredposition: 0pipeline: True (ByValue)
PDF document to save.
-Open SwitchParameter optionalaliases: Show
Open the PDF after saving.
-OwnerPassword String optional
Optional owner password for the generated encrypted PDF.
-PassThru SwitchParameter optional
Emit the document for further processing.
-Password String optionalaliases: UserPassword
Password required to open the generated PDF.
-Path String requiredposition: 1aliases: FilePath
Destination PDF path.
-Permission Int32 optionalaliases: Permissions
Raw PDF Standard security permission bit mask. Defaults to allowing all standard operations.

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.