Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

New-OfficeWordPdfOptions

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

Creates discoverable Word-to-PDF conversion options for Convert-OfficeDocument.

Syntax

New-OfficeWordPdfOptions
[-AllowDocumentFontEmbedding]
[-AllowSystemFontEmbedding]
[-Author <String>]
[-ChartFidelity <Strict|BestEffort>]
[-DefaultTableBorders]
[-FallbackOrientation <Portrait|Landscape>]
[-FallbackPageSize <PdfPageSize>]
[-Font <String>]
[-IncludePageNumbers]
[-Keywords <String>]
[-MarginBottom <OfficeLength>]
[-MarginLeft <OfficeLength>]
[-MarginRight <OfficeLength>]
[-MarginTop <OfficeLength>]
[-Orientation <Portrait|Landscape>]
[-PageNumberFormat <String>]
[-PageSize <PdfPageSize>]
[-PdfOptions <PdfCreateOptions>]
[-Subject <String>]
[-Title <String>]
[<CommonParameters>]
#
Parameter set: Default

Examples

Configure metadata, page numbers, and font embedding.

$options = New-OfficeWordPdfOptions -Title 'Service report' -Author 'Evotec' -IncludePageNumbers -AllowSystemFontEmbedding
Convert-OfficeDocument -Path .\Report.docx -To Pdf -OutputPath .\Report.pdf -Options $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.
-ChartFidelity OfficeChartFidelity optional
Chart handling: Strict (default) skips charts with formatting that cannot be drawn exactly; BestEffort draws the closest approximation and reports chart-approximation warnings.
Possible values: Strict, BestEffort
-DefaultTableBorders SwitchParameter optional
Draw default borders for tables that do not specify borders.
-FallbackOrientation OfficePageOrientation optional
Fallback page orientation for sections without page settings.
Possible values: Portrait, Landscape
-FallbackPageSize PdfPageSize optional
Fallback physical PDF page size for sections without page settings.
-Font 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 OfficeLength optional
Bottom page margin in PDF points.
-MarginLeft OfficeLength optional
Left page margin in PDF points.
-MarginRight OfficeLength optional
Right page margin in PDF points.
-MarginTop OfficeLength 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 PdfPageSize optional
PDF page size.
-PdfOptions PdfCreateOptions 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.