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:
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:
The generated HTML paragraph does not contain:
As a result, the slide number appears on the left side of its placeholder.
Direct right alignment works correctly. A normal text box containing:
is rendered with:
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:
<a:ln>
<a:noFill/>
</a:ln>
OfficeCLI converts this to:
-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:
should be rendered at 12pt, but the generated HTML uses:
<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:
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:
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.
Environment
officecli view sample.pptx htmlSummary
Several PPTX properties are rendered incorrectly in the raw HTML generated directly by OfficeCLI.
1. A bent connector is partially missing
A
bentConnector4connector is only partially visible.The generated SVG uses:
However, its polyline contains an X coordinate as large as
2136.27, so part of the connector fallsoutside the SVG view box.
Example source object:
/slide[5]/connector[@id=16]2.42pt × 103.82pt180Expected: 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.xmlusing:The generated HTML paragraph does not contain:
As a result, the slide number appears on the left side of its placeholder.
Direct right alignment works correctly. A normal text box containing:
is rendered with:
Expected: the effective alignment inherited from the slide layout is applied.
Actual: the inherited right alignment is omitted.
3.
noFilltext outlines are rendered as black strokesSome text runs contain:
OfficeCLI converts this to:
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:
should be rendered at 12pt, but the generated HTML uses:
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:
This treats inline
<m:oMath>equations as display equations, changing their vertical spacing andplacement relative to surrounding text.
Expected:
<m:oMath>as inline math.<m:oMathPara>as display math.Actual:
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:
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:
All of these problems are present in the unmodified HTML produced directly by OfficeCLI.