# HTML save options

Edition: Commercial

`wolfxl_pro.HtmlSaveOptions` is part of the Commercial edition (authenticated package index, latest published release 2.3.0). Community (MIT, public PyPI) does not include it. See [Install](https://wolfxl.com/docs/getting-started/install/) for the difference between the editions.

`wolfxl_pro.HtmlSaveOptions` is an immutable `ConversionOptions` subclass. Pass one object to `convert`, `convert_to_bytes`, `convert_to_stream`, `export_html`, or the low-code `HtmlConverter.process`. The HTML engine and public converter use exactly the same controls. No option is inferred from raw CSS or HTML.

```
from wolfxl_pro import HtmlSaveOptions, HtmlConverter, export_html

options = HtmlSaveOptions(
    export_data="range", sheet="Data", cell_range="B2:E12",
    html_version="XHTML", hidden_row_display="remove",
    hidden_column_display="hide", text_overflow="cross-hide-right",
    hyperlink_target="_blank", space_mode="css", embedded_font_type="WOFF",
)
report = HtmlConverter.process("source.xlsx", "out.html", options=options)
artifact = export_html(workbook, options=options)  # artifact.data / artifact.report
```

## Controls

| Field | Values | Behavior |
| --- | --- | --- |
| `html_version` | `HTML5`, `XHTML` | HTML5 doctype; XHTML5 adds XML namespace, uppercase XML doctype, and self-closing void elements. XML-forbidden text controls are rejected. |
| `hidden_row_display` | `hide`, `remove` | Retain hidden rows with `display:none`, or remove them. |
| `hidden_column_display` | `hide`, `remove` | Retain hidden cells with `display:none`, or remove them. Grouped column intervals are honored. Removed merged anchors move to the first remaining cell and spans contract. |
| `text_overflow` | `cross`, `cross-hide-right`, `line-break` | Extend text only through consecutive empty visible cells; clip at the right boundary in cross-hide-right; otherwise wrap. Numeric cells do not cross. |
| `hyperlink_target` | `_blank`, `_self`, `_parent` | Applies only to allowlisted HTTP/HTTPS/mailto links. Blank links add `noopener noreferrer`. |
| `layout` | `normal`, `print` | Fixed Excel-like table layout, or print CSS from worksheet paper/orientation/margins/row breaks. Each sheet, including an empty sheet, has a named page so all-sheet paper settings and breaks remain isolated. Print supports Letter, Legal, A3, A4, A5 and explicitly rejects other paper ids. |
| `paragraph_mode` | `normal`, `as-row` | Inline paragraph wrappers, or one table row per newline paragraph (including empty paragraphs). |
| `space_mode` | `character`, `css` | Nonbreaking whitespace entities, or CSS `white-space:pre-wrap`. |
| `embedded_font_type` | `none`, `WOFF`, `TTF` | Offline data-URI fonts using the engine's exact bundled Carlito faces, including bold/italic. Unknown families use the same engine fallback with an explicit diagnostic. Fonts and OFL license ship as package resources; no host-font discovery or network. |
| `office_math_output` | `image`, `MathML` | Export anchored XLSX drawing Office Math as self-contained SVG data images or structural MathML, including math-only sheets without cell data. Unsupported constructs emit feature-dropped diagnostics, never silently flatten equations. |
| `export_data` | `sheet`, `range`, `all-sheets` | First/requested sheet; bounded A1 selection (requires `cell_range`); or every sheet in workbook order in one document. All-sheets rejects `sheet` and `cell_range`. |

HTML5, no embedded fonts, and the first sheet are the defaults. Other fields are unset (`None`) by default to preserve **the historical export bytes**, including visible hidden cells, unspecified hyperlink targets, collapsed browser whitespace, and omitted Office Math. Setting an explicit enum value opts into its behavior. The same immutable options object can be reused safely.

HTML text, attributes, link destinations and font aliases remain escaped and bounded. Embedded resources never reference a remote URL. Output is tested with html5lib; XHTML is additionally parsed as XML. Golden fixtures capture unmodified wave0 output before the implementation and compare both omitted options and `HtmlSaveOptions()` byte for byte.

## Reference transcriptions

The spelling and interpretation of layout, paragraph, and whitespace controls follow these public enum tables (no commercial SDK was downloaded or run):

- [HtmlLayoutMode: Normal / Print](https://reference.aspose.com/cells/net/aspose.cells.rendering/htmllayoutmode/)
- [HtmlParagraphLayoutMode: Normal / AsRow](https://reference.aspose.com/cells/net/aspose.cells.rendering/htmlparagraphlayoutmode/)
- [HtmlSpaceMode: Character / Css](https://reference.aspose.com/cells/net/aspose.cells.rendering/htmlspacemode/)
- [WOFF 1.0, sections 4–6](https://www.w3.org/TR/2012/REC-WOFF-20121213/)
