Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

New-OfficeTextPdfOptions

Module
PSWriteOffice
Inputs
None
Outputs
OfficeIMO.Pdf.PdfTextImportOptions

Creates literal text decoding and PDF layout settings for Convert-OfficeDocument -To Pdf.

Syntax

New-OfficeTextPdfOptions
[-Encoding <String>]
[-MaximumCharacters <Int32>]
[-MaximumPages <Int32>]
[-PdfOptions <PdfCreateOptions>]
[-TabSize <Int32>]
[<CommonParameters>]
#
Parameter set: Default

Description

Pass the result to Convert-OfficeDocument -Options when converting plain text files to PDF.

Examples

Read UTF-16 text with four-column tabs.

$options = New-OfficeTextPdfOptions -Encoding utf-16 -TabSize 4
Convert-OfficeDocument -To Pdf -Path .\Report.txt -OutputPath .\Report.pdf -Options $options

Parameters

-Encoding String optional
Explicit encoding; otherwise use a Unicode BOM or strict UTF-8.
-MaximumCharacters Int32 optional
Maximum decoded and expanded characters.
-MaximumPages Int32 optional
Maximum generated pages.
-PdfOptions PdfCreateOptions optional
PDF fonts and page geometry; default is ten-point Courier.
-TabSize Int32 optional
Source columns per tab stop.

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.