Cmdlet
ConvertFrom-OfficePdfHtml
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:
HtmlConvertFrom-OfficePdfHtml [-BasePath <String>] [-Open] [-Options <HtmlToPdfOptions>] [-OutputPath <String>] [-PassThru] -Path <String> [-Profile <Semantic|Document|HighFidelityPrint|PositionedReview>] [-StylesheetContent <String[]>] [-StylesheetPath <String[]>] [-TrustedDocumentProfile] [<CommonParameters>]#Parameter set:
PathExamples
Create a PDF from an HTML fragment.
$html = '<h1>Report</h1><p>Ready</p>'
ConvertFrom-OfficePdfHtml -Html $html -OutputPath .\report.pdf -PassThruWrites a PDF generated by OfficeIMO.Html.Pdf.
Parameters
- -BasePath String
- Base path used to resolve relative file resources.
- -Html String
- HTML markup to convert.
- -Open SwitchParameter
- Open the PDF after saving.
- -Options HtmlToPdfOptions
- Optional OfficeIMO HTML to PDF save options.
- -OutputPath String
- Optional output path for the PDF file. When omitted, PDF bytes are written to the pipeline.
- -PassThru SwitchParameter
- Emit a FileInfo when saving to disk.
- -Profile HtmlConversionProfile
- HTML conversion profile applied before PDF rendering.
- Possible values:
Semantic,Document,HighFidelityPrint,PositionedReview - -StylesheetContent String[]
- Inline CSS stylesheets to apply when using the document profile.
- -StylesheetPath String[]
- Paths to CSS stylesheets to apply when using the document profile.
- -TrustedDocumentProfile SwitchParameter
- Mark the HTML input as trusted for OfficeIMO conversion policy.
- -Path String
- 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.