API Reference
Cmdlet
Set-OfficePdfPageSetup
Sets PDF page size, orientation, and margins.
Remarks
Sets PDF page size, orientation, and margins.
Examples
Set page size and margins for a generated report.
PS>
New-OfficePdf -Path .\Examples\Documents\PdfPageSetup.pdf {
Set-OfficePdfPageSetup -PageSize A4 -Margin 42
Add-OfficePdfHeading -Text 'A4 report'
Add-OfficePdfParagraph -Text 'The report uses custom margins.'
}
Applies page setup before adding generated PDF content.
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
Set-OfficePdfPageSetup [-Bottom <Double>] [-Height <Double>] [-Landscape] [-Left <Double>] [-Margin <Double>] [-PageSize <String>] [-PassThru] [-Right <Double>] [-Top <Double>] [-Width <Double>] [<CommonParameters>]#Parameter set:
ContextParameters
- Bottom Double
- Bottom margin in PDF points.
- Height Double
- Custom page height in PDF points when -PageSize Custom is used.
- Landscape SwitchParameter
- Use landscape orientation.
- Left Double
- Left margin in PDF points.
- Margin Double
- Uniform margin in PDF points.
- PageSize String
- Page size name: A4, A5, Letter, Legal, or Custom.
- PassThru SwitchParameter
- Emit the updated document.
- Right Double
- Right margin in PDF points.
- Top Double
- Top margin in PDF points.
- Width Double
- Custom page width in PDF points when -PageSize Custom is used.
Outputs
OfficeIMO.Pdf.PdfDocument
Set-OfficePdfPageSetup [-Bottom <Double>] -Document <PdfDocument> [-Height <Double>] [-Landscape] [-Left <Double>] [-Margin <Double>] [-PageSize <String>] [-PassThru] [-Right <Double>] [-Top <Double>] [-Width <Double>] [<CommonParameters>]#Parameter set:
DocumentParameters
- Bottom Double
- Bottom margin in PDF points.
- Document PdfDocument
- Compatibility parameter. Page composition is supported only inside New-OfficePdf with OfficeIMO 3.2.
- Height Double
- Custom page height in PDF points when -PageSize Custom is used.
- Landscape SwitchParameter
- Use landscape orientation.
- Left Double
- Left margin in PDF points.
- Margin Double
- Uniform margin in PDF points.
- PageSize String
- Page size name: A4, A5, Letter, Legal, or Custom.
- PassThru SwitchParameter
- Emit the updated document.
- Right Double
- Right margin in PDF points.
- Top Double
- Top margin in PDF points.
- Width Double
- Custom page width in PDF points when -PageSize Custom is used.
Outputs
OfficeIMO.Pdf.PdfDocument