Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
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

Authored help example

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.