# New-OfficeHtmlPdfOptions

Creates HTML-to-PDF options for Convert-OfficeDocument -To Pdf.

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`OfficeIMO.Html.Pdf.HtmlPdfExportOptions`

**Outputs**

`OfficeIMO.Html.Pdf.HtmlPdfExportOptions`

**Source**

[NewOfficeHtmlPdfOptionsCommand.cs:16](https://github.com/EvotecIT/OfficeIMO/blob/12511d2fa560784a40564a2dc62102d2005ed547/PowerShell/PSWriteOffice/Sources/PSWriteOffice/Cmdlets/Pdf/NewOfficeHtmlPdfOptionsCommand.cs#L16) 

Creates HTML-to-PDF options for Convert-OfficeDocument -To Pdf.

## Syntax

```
New-OfficeHtmlPdfOptions
[-BaseOptions <HtmlPdfExportOptions>]
[-Font <String>]
[-IncludeLocalResources]
[-Margin <OfficeLength>]
[-NoInteractiveFormControls]
[-PdfOptions <PdfCreateOptions>]
[<CommonParameters>]
```

[#](#method-new-officehtmlpdfoptions-htmlpdfexportoptions-string-switchparameter-officelength-switchparameter-pdfcreateoptions)

Parameter set: `Default`

## Guides & Samples

Authored walkthroughs and practical samples linked to this command.

- [Convert HTML to PDF](/docs/html/html-to-pdf/) Guide
  
  Convert HTML pages and reports to PDF in .NET without a browser, with page size, margins, extra CSS, headers and footers, and local images and fonts.

## Examples

### Use the native OfficeHtmlPdfOptions command.

```powershell
Convert-OfficeDocument -Path .\Report.html -To Pdf -OutputPath .\Report.pdf -Options (New-OfficeHtmlPdfOptions -Margin 2cm)
```

## Parameters

**-BaseOptions HtmlPdfExportOptions optionalpipeline: True (ByValue)**

BaseOptions for this operation.

**-Font String optional**

Font for this operation.

**-IncludeLocalResources SwitchParameter optional**

IncludeLocalResources for this operation.

**-Margin OfficeLength optional**

Margin for this operation.

**-NoInteractiveFormControls SwitchParameter optional**

NoInteractiveFormControls for this operation.

**-PdfOptions PdfCreateOptions optional**

PdfOptions for this operation.

## 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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

<!-- PowerForge markdown artifact sha256:2A914903D27441C833C4B1094307A6ED2073FF3F21BF0E44D17253B7C502EA8C -->
