API Reference

Cmdlet

Save-OfficePdf

Namespace PSWriteOffice
Inputs
OfficeIMO.Pdf.PdfDocument
Outputs
OfficeIMO.Pdf.PdfDocument System.IO.FileInfo

Saves an OfficeIMO.Pdf document.

Remarks

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.

PS>


$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.

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.

Syntax

Save-OfficePdf -Document <PdfDocument> [-OwnerPassword <String>] [-PassThru] [-Password <String>] -Path <String> [-Permission <Nullable`1>] [-Show] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

Document PdfDocument requiredposition: 0pipeline: True (ByValue)
PDF document to save.
OwnerPassword String optionalposition: namedpipeline: False
Optional owner password for the generated encrypted PDF.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the document instead of the saved file.
Password String optionalposition: namedpipeline: Falsealiases: UserPassword
Password required to open the generated PDF.
Path String requiredposition: 1pipeline: Falsealiases: FilePath
Destination PDF path.
Permission Nullable`1 optionalposition: namedpipeline: Falsealiases: Permissions
Raw PDF Standard security permission bit mask. Defaults to allowing all standard operations.
Show SwitchParameter optionalposition: namedpipeline: False
Open the PDF after saving.

Outputs

OfficeIMO.Pdf.PdfDocument System.IO.FileInfo