Project

PSWriteOffice

PowerShell document automation across Word, Excel, PowerPoint, PDF, Reader, Confluence, Visio, and open text formats.

Stars 165
Forks 15
PowerShell Gallery downloads 158,661
Release v3.0.8
Language: C# Updated: 2026-10-12

API Reference

Cmdlet

New-OfficeHtmlPdfOptions

Namespace PSWriteOffice
Inputs
OfficeIMO.Html.Pdf.HtmlToPdfOptions
Outputs
OfficeIMO.Html.Pdf.HtmlToPdfOptions

Creates typed HTML rendering options for Export-OfficeDocumentPdf.

Remarks

Creates typed HTML rendering options for Export-OfficeDocumentPdf.

Examples

Authored help example

Export HTML with local resources and a chosen font.

PS>


$options = New-OfficeHtmlPdfOptions -FontFamily Arial -IncludeLocalResources
            Export-OfficeDocumentPdf -InputPath .\Report.html -Path .\Report.pdf -HtmlOptions $options
        

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

New-OfficeHtmlPdfOptions [-FontFamily <String>] [-IncludeLocalResources] [-InteractiveFormControls <Boolean>] [-Margin <Double>] [-Options <HtmlToPdfOptions>] [-PdfOptions <PdfOptions>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

FontFamily String optionalposition: namedpipeline: False
Default HTML font family.
IncludeLocalResources SwitchParameter optionalposition: namedpipeline: False
Allow bounded local images, stylesheets and fonts. Workflow batches constrain them to the source directory.
InteractiveFormControls Boolean optionalposition: namedpipeline: False
Render supported HTML form controls as interactive PDF fields.
Margin Double optionalposition: namedpipeline: False
Uniform page margins in CSS pixels.
Options HtmlToPdfOptions optionalposition: namedpipeline: True (ByValue)
Existing options to clone before applying explicitly supplied values.
PdfOptions PdfOptions optionalposition: namedpipeline: False
Underlying PDF writer settings, cloned before use.

Outputs

OfficeIMO.Html.Pdf.HtmlToPdfOptions