Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

ConvertFrom-OfficePdfHtml

Aliases: ConvertFrom-PdfHtml
Module PSWriteOffice
Aliases
ConvertFrom-PdfHtml
Inputs
System.String
Outputs
System.Byte[] System.IO.FileInfo

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>]
#
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>]
#
Parameter set: Path

Examples

Authored help example

Create a PDF from an HTML fragment.

$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.