# ConvertFrom-OfficePdfHtml

Converts HTML content to a PDF through the first-party OfficeIMO HTML/PDF adapter.

Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

[View on GitHub](https://github.com/EvotecIT/OfficeIMO/tree/master/PowerShell/PSWriteOffice) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteOffice/releases/tag/v3.0.5) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteOffice/0.2.0)

Stars **725**

Forks **84**

Open issues **3**

Total downloads **5,231,343**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-23

Cmdlet 

Aliases: ConvertFrom-PdfHtml

**Module**

`PSWriteOffice`

**Aliases**

`ConvertFrom-PdfHtml`

**Inputs**

`System.String`

**Outputs**

`System.Byte[]` `System.IO.FileInfo`

**Source**

[ConvertFromOfficePdfHtmlCommand.cs:23](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Pdf/ConvertFromOfficePdfHtmlCommand.cs#L23) 

Converts HTML content to a PDF through the first-party OfficeIMO HTML/PDF adapter.

## Syntax

```
ConvertFrom-OfficePdfHtml
[-BasePath <String>]
[-Html] <String>
[-Open]
[-Options <HtmlToPdfOptions>]
[-OutputPath <String>]
[-PassThru]
[-Profile <Semantic|Document|HighFidelityPrint|PositionedReview>]
[-StylesheetContent <String[]>]
[-StylesheetPath <String[]>]
[-TrustedDocumentProfile]
[<CommonParameters>]
```

[#](#method-convertfrom-officepdfhtml-string-string-switchparameter-htmltopdfoptions-string-switchparameter-htmlconversionprofile-string-string-switchparameter)

Parameter set: `Html`

```
ConvertFrom-OfficePdfHtml
[-BasePath <String>]
[-Open]
[-Options <HtmlToPdfOptions>]
[-OutputPath <String>]
[-PassThru]
-Path <String>
[-Profile <Semantic|Document|HighFidelityPrint|PositionedReview>]
[-StylesheetContent <String[]>]
[-StylesheetPath <String[]>]
[-TrustedDocumentProfile]
[<CommonParameters>]
```

[#](#method-convertfrom-officepdfhtml-string-switchparameter-htmltopdfoptions-string-switchparameter-string-htmlconversionprofile-string-string-switchparameter)

Parameter set: `Path`

## Examples

### Create a PDF from an HTML fragment.

```powershell
$html = '<h1>Report</h1><p>Ready</p>'
ConvertFrom-OfficePdfHtml -Html $html -OutputPath .\report.pdf -PassThru
```

Writes a PDF generated by OfficeIMO.Html.Pdf.

## Parameters

**-BasePath String optional**

Base path used to resolve relative file resources.

**-Html String requiredposition: 0pipeline: True (ByValue)sets: Html**

HTML markup to convert.

**-Open SwitchParameter optional**

Open the PDF after saving.

**-Options HtmlToPdfOptions optional**

Optional OfficeIMO HTML to PDF save options.

**-OutputPath String optionalaliases: OutPath**

Optional output path for the PDF file. When omitted, PDF bytes are written to the pipeline.

**-PassThru SwitchParameter optional**

Emit a FileInfo when saving to disk.

**-Profile HtmlConversionProfile optional**

HTML conversion profile applied before PDF rendering.

Possible values: `Semantic`, `Document`, `HighFidelityPrint`, `PositionedReview`

**-StylesheetContent String[] optional**

Inline CSS stylesheets to apply when using the document profile.

**-StylesheetPath String[] optional**

Paths to CSS stylesheets to apply when using the document profile.

**-TrustedDocumentProfile SwitchParameter optional**

Mark the HTML input as trusted for OfficeIMO conversion policy.

**-Path String requiredaliases: FilePath, InputPathsets: Path**

Path to an HTML file.

## 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).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:DBF9DFCD002B8AD8AEE0A7E544D8D59DE5E2AEC3E4DA7DD0743424D8A8BB799E -->
