API Reference
Cmdlet
ConvertFrom-OfficePdfHtml
Converts HTML content to a PDF through the first-party OfficeIMO HTML/PDF adapter.
Remarks
Converts HTML content to a PDF through the first-party OfficeIMO HTML/PDF adapter.
Examples
Create a PDF from an HTML fragment.
PS>
$html = '<h1>Report</h1><p>Ready</p>'
ConvertFrom-OfficePdfHtml -Html $html -OutputPath .\report.pdf -PassThru
Writes a PDF generated by OfficeIMO.Html.Pdf.
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
ConvertFrom-OfficePdfHtml [-BasePath <String>] -Html <String> [-Open] [-Options <HtmlPdfSaveOptions>] [-OutputPath <String>] [-PassThru] [-Profile <Semantic|Document|HighFidelityPrint|PositionedReview>] [-StylesheetContent <String[]>] [-StylesheetPath <String[]>] [-TrustedDocumentProfile] [<CommonParameters>]#Parameter set:
HtmlParameters
- BasePath String
- Base path used to resolve relative file resources.
- Html String
- HTML markup to convert.
- Open SwitchParameter
- Open the PDF after saving.
- Options HtmlPdfSaveOptions
- 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.
Outputs
System.Byte[] System.IO.FileInfo
ConvertFrom-OfficePdfHtml [-BasePath <String>] -InputPath <String> [-Open] [-Options <HtmlPdfSaveOptions>] [-OutputPath <String>] [-PassThru] [-Profile <Semantic|Document|HighFidelityPrint|PositionedReview>] [-StylesheetContent <String[]>] [-StylesheetPath <String[]>] [-TrustedDocumentProfile] [<CommonParameters>]#Parameter set:
PathParameters
- BasePath String
- Base path used to resolve relative file resources.
- InputPath String
- Path to an HTML file.
- Open SwitchParameter
- Open the PDF after saving.
- Options HtmlPdfSaveOptions
- 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.
Outputs
System.Byte[] System.IO.FileInfo