API Reference
Cmdlet
Save-OfficePdf
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
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 SetsParameters
- Document PdfDocument
- PDF document to save.
- OwnerPassword String
- Optional owner password for the generated encrypted PDF.
- PassThru SwitchParameter
- Emit the document instead of the saved file.
- Password String
- Password required to open the generated PDF.
- Path String
- Destination PDF path.
- Permission Nullable`1
- Raw PDF Standard security permission bit mask. Defaults to allowing all standard operations.
- Show SwitchParameter
- Open the PDF after saving.
Outputs
OfficeIMO.Pdf.PdfDocument System.IO.FileInfo