API Reference

Cmdlet

ConvertFrom-OfficePdfHtml

Aliases: ConvertFrom-PdfHtml
Namespace 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.

Remarks

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

Examples

Authored help example

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: Html

Parameters

BasePath String optionalposition: namedpipeline: False
Base path used to resolve relative file resources.
Html String requiredposition: 0pipeline: True (ByValue)
HTML markup to convert.
Open SwitchParameter optionalposition: namedpipeline: False
Open the PDF after saving.
Options HtmlPdfSaveOptions optionalposition: namedpipeline: False
Optional OfficeIMO HTML to PDF save options.
OutputPath String optionalposition: namedpipeline: Falsealiases: OutPath
Optional output path for the PDF file. When omitted, PDF bytes are written to the pipeline.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit a FileInfo when saving to disk.
Profile HtmlConversionProfile optionalposition: namedpipeline: Falsevalues: 4
HTML conversion profile applied before PDF rendering.
Possible values: Semantic, Document, HighFidelityPrint, PositionedReview
StylesheetContent String[] optionalposition: namedpipeline: False
Inline CSS stylesheets to apply when using the document profile.
StylesheetPath String[] optionalposition: namedpipeline: False
Paths to CSS stylesheets to apply when using the document profile.
TrustedDocumentProfile SwitchParameter optionalposition: namedpipeline: False
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: Path

Parameters

BasePath String optionalposition: namedpipeline: False
Base path used to resolve relative file resources.
InputPath String requiredposition: namedpipeline: Falsealiases: FilePath, Path
Path to an HTML file.
Open SwitchParameter optionalposition: namedpipeline: False
Open the PDF after saving.
Options HtmlPdfSaveOptions optionalposition: namedpipeline: False
Optional OfficeIMO HTML to PDF save options.
OutputPath String optionalposition: namedpipeline: Falsealiases: OutPath
Optional output path for the PDF file. When omitted, PDF bytes are written to the pipeline.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit a FileInfo when saving to disk.
Profile HtmlConversionProfile optionalposition: namedpipeline: Falsevalues: 4
HTML conversion profile applied before PDF rendering.
Possible values: Semantic, Document, HighFidelityPrint, PositionedReview
StylesheetContent String[] optionalposition: namedpipeline: False
Inline CSS stylesheets to apply when using the document profile.
StylesheetPath String[] optionalposition: namedpipeline: False
Paths to CSS stylesheets to apply when using the document profile.
TrustedDocumentProfile SwitchParameter optionalposition: namedpipeline: False
Mark the HTML input as trusted for OfficeIMO conversion policy.

Outputs

System.Byte[] System.IO.FileInfo