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

New-OfficeWordPdfOptions

Module
PSWriteOffice
Inputs
None
Outputs
OfficeIMO.Word.Pdf.WordToPdfOptions

Creates discoverable Word-to-PDF conversion options for Export-OfficeDocumentPdf.

Syntax

New-OfficeWordPdfOptions
[-AllowDocumentFontEmbedding]
[-AllowSystemFontEmbedding]
[-Author <String>]
[-DefaultOrientation <Portrait|Landscape>]
[-DefaultPageSize <WordPageSize>]
[-DefaultTableBorders]
[-FontFamily <String>]
[-IncludePageNumbers]
[-Keywords <String>]
[-MarginBottom <Double>]
[-MarginLeft <Double>]
[-MarginRight <Double>]
[-MarginTop <Double>]
[-Orientation <Portrait|Landscape>]
[-PageNumberFormat <String>]
[-PageSize <PageSize>]
[-PdfOptions <PdfOptions>]
[-Subject <String>]
[-Title <String>]
[<CommonParameters>]
#
Parameter set: All Parameter Sets

Examples

Configure metadata, page numbers, and font embedding.

$options = New-OfficeWordPdfOptions -Title 'Service report' -Author 'Evotec' -IncludePageNumbers -AllowSystemFontEmbedding
Export-OfficeDocumentPdf -InputPath .\Report.docx -Path .\Report.pdf -WordOptions $options

Parameters

-AllowDocumentFontEmbedding SwitchParameter optional
Allow embedding installed fonts selected by a trusted Word document. System-font embedding must also be enabled.
-AllowSystemFontEmbedding SwitchParameter optional
Allow embedding fonts discovered on the current system.
-Author String optional
PDF author metadata.
-DefaultOrientation OfficePageOrientation optional
Fallback page orientation for sections without page settings.
Possible values: Portrait, Landscape
-DefaultPageSize WordPageSize optional
Fallback Word page size for sections without page settings.
Possible values: Unknown, Letter, Legal, Statement, Executive, A3, A4, A5, A6, B5, Tabloid, B4Jis, Envelope9, Envelope10, CSheet, EnvelopeDl, EnvelopeC5, EnvelopeC4, EnvelopeB5, EnvelopeMonarch
-DefaultTableBorders SwitchParameter optional
Draw default borders for tables that do not specify borders.
-FontFamily String optional
Default font family used when the document does not specify one.
-IncludePageNumbers SwitchParameter optional
Include page numbers in the generated PDF.
-Keywords String optional
PDF keywords metadata.
-MarginBottom Double optional
Bottom page margin in PDF points.
-MarginLeft Double optional
Left page margin in PDF points.
-MarginRight Double optional
Right page margin in PDF points.
-MarginTop Double optional
Top page margin in PDF points.
-Orientation OfficePageOrientation optional
PDF page orientation.
Possible values: Portrait, Landscape
-PageNumberFormat String optional
Page number text format.
-PageSize PageSize optional
PDF page size.
-PdfOptions PdfOptions optional
Underlying low-level OfficeIMO PDF options.
-Subject String optional
PDF subject metadata.
-Title String optional
PDF title metadata.

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.