Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/

API Reference

Class

HtmlToPdfOptions

Namespace OfficeIMO.Html.Pdf
Assembly OfficeIMO.Html.Pdf
Base HtmlRenderOptions
Modifiers sealed

Controls direct HTML layout and PDF generation. Layout, resource, page, and safety settings are inherited from HtmlRenderOptions.

Inheritance

  • HtmlRenderOptions
  • HtmlToPdfOptions

Usage

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Examples


var options = new HtmlToPdfOptions {
    PageSize = OfficePageSizes.A4,
    Margins = HtmlRenderMargins.All(32),
    DefaultFontFamily = "Arial"
};
byte[] pdf = HtmlConversionDocument.Parse(html).ToPdfBytes(options);
        

Constructors

HtmlToPdfOptions 2 overloads
public HtmlToPdfOptions() #

Creates direct paged HTML-to-PDF options using the standard defaults.

public HtmlToPdfOptions(HtmlRenderOptions renderOptions) #

Creates PDF-capable options from shared HTML rendering settings without changing their layout mode. PDF conversion enforces paged layout on its own conversion snapshot.

Parameters

renderOptions OfficeIMO.Html.HtmlRenderOptions requiredposition: 0
Shared settings used by PNG, SVG, and PDF rendering.

Methods

public override HtmlRenderOptions Clone() #
Returns: HtmlRenderOptions

Creates an independent options snapshot.

public HtmlToPdfOptions ClonePdf() #
Returns: HtmlToPdfOptions

Creates an independent options snapshot for one PDF conversion.

public HtmlPdfResourcePolicySummary GetResourcePolicySummary() #
Returns: HtmlPdfResourcePolicySummary

Returns a snapshot of the active HTML resource policy.

Properties

public PdfTextFallbackFeatures TextFallbacks { get; set; } #

OfficeIMO-managed font fallback groups used by generated PDF text.

public PdfTextShapingMode TextShapingMode { get; set; } #

Dependency-free shaping mode used by generated PDF text.

public PdfEmbeddedFontFamily FontFamily { get; set; } #

Optional caller-supplied embedded font family used by generated PDF text.

public Boolean InteractiveFormControls { get; set; } #

Converts supported standard HTML inputs, text areas, and selects into interactive AcroForm fields. Disable this to retain the shared renderer's static control paint in the PDF.

public Int32 MaxOutlinedTextCharactersPerRun { get; set; } #

Maximum UTF-16 characters expanded into vector font outlines for one rendered text run. Raise this only for trusted documents with unusually long unbroken text.

public Int32 MaxOutlinedTextPathCommands { get; set; } #

Maximum path commands generated by text outlines across one PDF conversion.

public PdfOptions PdfOptions { get; set; } #

PDF writer settings used for the generated document, including file version, forward-only serialization, tagging, compliance groundwork, and output intents.

public IOfficeTextShapingProvider TextShapingProvider { get; set; } #

Optional host-provided shaping seam used with caller-supplied or resolved embedded fonts.

public PdfResourcePolicy ResourcePolicy { get; set; } #

Host-resource policy. Defaults to balanced conversion: system fonts and bounded in-source resources are allowed, while local and remote reads are denied.