#341·OfficeCLI

[PPTX] view html does not preserve several drawing, text, and equation properties

Author: ueno-kokiCreated Aug 22, 2026Updated Sep 14, 2026

Environment

  • OfficeCLI: 1.0.144
  • Command: officecli view sample.pptx html

Summary

Several PPTX properties are rendered incorrectly in the raw HTML generated directly by OfficeCLI.

1. A bent connector is partially missing

A bentConnector4 connector is only partially visible.

The generated SVG uses:

xml
viewBox="0 0 100 100"

However, its polyline contains an X coordinate as large as 2136.27, so part of the connector falls outside the SVG view box.

Example source object:

  • Path: /slide[5]/connector[@id=16]
  • Size: approximately 2.42pt × 103.82pt
  • Rotation: 180

Expected: the complete connector is visible.

Actual: part of the connector is clipped or missing.

2. Alignment inherited from a slide layout is ignored

A slide-number placeholder is right-aligned in ppt/slideLayouts/slideLayout1.xml using:

xml
<a:lvl1pPr algn="r">

The generated HTML paragraph does not contain:

css
text-align: right;

As a result, the slide number appears on the left side of its placeholder.

Direct right alignment works correctly. A normal text box containing:

xml
<a:pPr algn="r"/>

is rendered with:

css
text-align: right;

Expected: the effective alignment inherited from the slide layout is applied.

Actual: the inherited right alignment is omitted.

3. noFill text outlines are rendered as black strokes

Some text runs contain:

xml
<a:ln>
  <a:noFill/>
</a:ln>

OfficeCLI converts this to:

css
-webkit-text-stroke: 1px #000000;
paint-order: stroke fill;

Expected: no visible text stroke.

Actual: a 1px black stroke is added, making the text appear blurred or darker.

4. Equation font size and inline/display layout are not preserved

The font size associated with an OfficeMath equation is not applied to the generated KaTeX element.

For example, an equation associated with:

xml
<a:rPr sz="1200"/>

should be rendered at 12pt, but the generated HTML uses:

xml
<div class="para" style="font-size:18pt;line-height:1.2">
  <span class="katex-formula" data-formula="..."></span>
</div>

The equation span has no font size of its own and therefore uses the default paragraph size instead of the equation's run size.

The generated script also unconditionally calls:

javascript
katex.render(el.dataset.formula, el, {
  throwOnError: false,
  displayMode: true
});

This treats inline <m:oMath> equations as display equations, changing their vertical spacing and placement relative to surrounding text.

Expected:

  • Preserve the effective font size of each equation.
  • Render <m:oMath> as inline math.
  • Render <m:oMathPara> as display math.

Actual:

  • The equation uses a default or inherited font size.
  • Every equation is rendered in display mode.

Related issue: #228

That issue fixed missing equations and extraction of multiple equations, but the proposed equation- size and inline/display-mode changes were not included in the accepted fix.

5. Simplified Chinese fonts are preferred for Japanese fallback

When the source font is unavailable, the generated font family resembles:

css
font-family:
  '<source font>',
  'PingFang SC',
  'Microsoft YaHei',
  'Noto Sans CJK SC',
  'Hiragino Sans GB',
  sans-serif;

For Japanese text, this may select Simplified Chinese glyphs before an appropriate Japanese font.

Expected: for Japanese content, Japanese fallback fonts such as the following should be preferred before Simplified Chinese fonts:

Noto Sans JP
Noto Sans CJK JP
Yu Gothic
Meiryo
Hiragino Sans

All of these problems are present in the unmodified HTML produced directly by OfficeCLI.