Issues Observed During Conversion of Microsoft Office Documents to PDF in Java

Doc_Ppt.zip (515.5 KB)

Hi Team,

We are converting Word documents to PDF and are seeing a number of differences between the PDF output and how the same document looks in Microsoft Word. We would like your help understanding which of these can be handled from our side and which need a product fix.

Please Note : We can’t use microsoft font’s as we don’t hold as such any license to use so mostly we will be using opensource fonts only. Please give us fixes, workarounds appropriately.

Environment

  • Aspose.Words for Java 26.2
  • JDK 17
  • Linux (also reproduced on macOS)

Attachment: Doc_Ppt.zip — contains the source Word documents and the PDFs we generated from them, so every issue below can be reproduced.


Issues, in priority order

  1. Equation content is lost completely — highest severity for us

Nothing is rendered in place of the equation. The area is simply empty in the PDF.

This is notably worse than what we see in Word to PDF conversion, where the majority of equation content does render, even if with alignment problems. In slides the behaviour changes completely and the content disappears.

So we can’t use Cambria Math at all as that is microsoft font and we don’t have legal permission. We wanted to know what open source font we can use here to get content in pdf. Please help us with this as this is something major blocker for us.

  1. Charts are compacted

Charts come out compressed in the PDF, and the X and Y axis scales shrink compared to PowerPoint.

  1. Bullets are wrong or missing

Bullet characters are replaced with incorrect characters, and in some cases nothing is rendered at all — just blank space where the bullet should be.

  1. Character reflow and alignment changes, especially in table cells

We see a lot of character reflow and alignment shifts in the converted PDF. Within normal text blocks this is acceptable, but it looks wrong inside table columns — particularly narrow columns like serial number and date.

For example, in a serial number column, a two-digit number wraps so that the second digit moves to the next line within the same cell.

  1. Comments are not rendered at all

Comments present in the source presentation do not appear anywhere in the PDF output.


What we are asking for

  • Where an existing option or API can work around an issue, please point us to it.
  • Where a product fix is needed, please share a ticket number and an ETA.

Two general questions

Q1. Is rendering charts as images before saving a supported and recommended way to avoid the chart compaction in issue 1? If so, any guidance on the right resolution to use so we don’t lose quality?

Q2. Our requirement is fixed-format PDF output, but content crosses page boundaries differently from Word — content from the next page starts on the previous one, or content on the current page flows
onward. The result is that page N of the PDF does not match page N of the Word document. Is there anything we can set to improve page-boundary parity with Word? If exact parity is not achievable, knowing
that definitively would also help us plan.

@hritiik,
Thank you for contacting free support. I’ve moved this thread to Aspose.Total forum. My colleagues from Aspose.Words team will assist you shortly.
@alexey.noskov, FYI

Regarding Aspose.Slides, I need some time to investigate the cases involving the files in the “Doc_Ppt.zip/Doc_Ppt/pptx” folder. I will get back to you as soon as possible.

Hi, any update on this?

@hritiik,
I reviewed the PowerPoint-related cases and can comment on them as follows.

1. Equations disappear during PDF conversion

The equations in the sample presentation use Cambria Math. Aspose.Slides has a specific limitation for Office Math equations created with this font: standard font substitution cannot replace Cambria Math with another math font, such as STIX Two Math, for equation layout and rendering.

Therefore, if Cambria Math is not available in the runtime environment, there is currently no supported open-source font substitution that guarantees correct rendering of these equations.

Please make Cambria Math available to Aspose.Slides either as a system font or as an external font. External fonts can be loaded with FontsLoader.loadExternalFonts.

Relevant documentation:

If using Cambria Math is not possible in the target environment, a practical workaround is to replace the equations in the source presentation with vector or raster images before conversion.

2. Chart axis scale and category label layout differ from PowerPoint

The chart axes in the sample presentation use automatic scaling. When axis properties are left automatic, PowerPoint and Aspose.Slides may calculate the effective scale and intervals differently.

If a specific result is required—for example, a value axis from 0 to 1 with a 0.1 interval—we recommend setting the axis properties explicitly instead of relying on automatic values.

For example:

IAxis valueAxis = chart.getAxes().getVerticalAxis();

valueAxis.setAutomaticMinValue(false);
valueAxis.setMinValue(0);

valueAxis.setAutomaticMaxValue(false);
valueAxis.setMaxValue(1);

valueAxis.setAutomaticMajorUnit(false);
valueAxis.setMajorUnit(0.1);

Relevant API Reference:

3. Bullet symbols are incorrect or missing

The affected bullets use characters from the Symbol and Wingdings fonts, including private-use Unicode code points such as U+F0A7, U+F071, and U+F0DE.

These code points belong to the Unicode Private Use Area, so their appearance is font-specific. An arbitrary open-source replacement font is not guaranteed to contain the same glyph at the same code point.

If Symbol and Wingdings cannot be installed or supplied as external fonts, the most reliable workaround is to replace these bullets in the source presentation with standard Unicode characters and use an open-source font that contains the required glyphs.

Aspose.Slides also supports loading external fonts and configuring font substitution/fallback:

4. Two-digit values wrap into two lines in narrow table cells

This behavior is very likely related to font substitution and different font metrics in the Linux environment.

When the original font is unavailable, the replacement font may have different character widths. Even a small difference can cause text in a narrow table cell to wrap differently.

Please first check which substitutions Aspose.Slides actually performs during rendering:

Presentation presentation = new Presentation("Issues.pptx");
try {
    for (FontSubstitutionInfo substitution :
            presentation.getFontsManager().getSubstitutions()) {
        System.out.println(
                substitution.getOriginalFontName()
                        + " -> "
                        + substitution.getSubstitutedFontName());
    }
} finally {
    presentation.dispose();
}

The following resources describe this behavior and the available APIs:

If the source presentation uses Calibri, a metrically compatible open-source font such as Carlito may help reduce layout differences. It can be loaded through FontsLoader.loadExternalFonts.

5. PowerPoint comments are missing from the generated PDF

Comments are not rendered in PDF output by default. Their output must be enabled through NotesCommentsLayoutingOptions.

For example:

Presentation presentation = new Presentation("Issues.pptx");
try {
    NotesCommentsLayoutingOptions layoutOptions = 
        new NotesCommentsLayoutingOptions();
    layoutOptions.setCommentsPosition(CommentsPositions.Right);
    layoutOptions.setCommentsAreaWidth(300);

    PdfOptions pdfOptions = new PdfOptions();
    pdfOptions.setSlidesLayoutOptions(layoutOptions);

    presentation.save("output.pdf", SaveFormat.Pdf, pdfOptions);
} finally {
    presentation.dispose();
}

Relevant API Reference:

The default value of CommentsPosition is CommentsPositions.None, so the absence of comments in the PDF does not by itself indicate a rendering defect.

@hritiik I already answered Aspose.Words related questions in another your thread.

Hi is there any api’s from aspose to rasterize math equations or charts as image or vector or any code recommendations.

@hritiik,
Yes. Aspose.Slides provides APIs for rendering individual shapes, including charts, as raster images or SVG.

For example, a chart can be rendered to a PNG image:

Presentation presentation = new Presentation("input.pptx");
try {
    IChart chart = (IChart) presentation.getSlides().get_Item(0)
            .getShapes().get_Item(0);

    IImage chartImage = chart.getImage();
    try {
        chartImage.save("chart.png", ImageFormat.Png);
    } finally {
        chartImage.dispose();
    }
} finally {
    presentation.dispose();
}

You can also export an individual shape as SVG:

Presentation presentation = new Presentation("input.pptx");
try {
    IShape shape = presentation.getSlides().get_Item(0)
            .getShapes().get_Item(0);

    try (FileOutputStream outputStream =
            new FileOutputStream("shape.svg")) {
        shape.writeAsSvg(outputStream);
    }
} finally {
    presentation.dispose();
}

Aspose.Slides supports rendering individual shapes as raster images and exporting shapes as SVG:

However, rasterizing the math equations with Aspose.Slides would not solve the Cambria Math issue described above. Aspose.Slides still has to render the equation before it can create a PNG or SVG representation. If the required math font is unavailable and the equation cannot be rendered correctly, calling the image/SVG rendering APIs will be subject to the same limitation.

Therefore, for the equations, the options are:

  1. Make Cambria Math available to Aspose.Slides during the initial conversion.
  2. Rasterize or vectorize the equations beforehand in an environment where they render correctly, and replace them with images in the presentation.

Hi,

We can’t ship the Microsoft fonts (Symbol, Wingdings), so symbol bullets don’t render correctly — the stored character is a
font-specific byte or a PUA codepoint that only has meaning inside those fonts. So we want to rewrite those bullet characters to
standard Unicode equivalents before saving, e.g. a Wingdings ‘l’ bullet becomes U+25CF.

Is there an API that returns the bullet formats in a presentation directly, so I can check the bullet font and update the character
without walking the shape tree myself?

Currently I do this:

for (IBaseSlide slide : presentation.getSlides()) {   // and getLayoutSlides(), getMasters()
      for (IShape shape : slide.getShapes()) {
          if (shape instanceof IGroupShape) {           // recurse
          } else if (shape instanceof ITable) {         // every cell's text frame
          } else if (shape instanceof IAutoShape) {     // its text frame
          } else if (shape instanceof ISmartArt) {      // every node's text frame
          }
      }
  }

// then per paragraph:

IBulletFormat bullet = paragraph.getParagraphFormat().getBullet();
  if (bullet.getType() == BulletType.Symbol) {
      IFontData font = bullet.getFont() != null
              ? bullet.getFont()
              : bullet.getEffective().getFont();
      if (isSymbolFont(font.getFontName())) {
          bullet.setChar(mapToUnicode(bullet.getChar()));
          bullet.setFont(new FontData("OurShippedFont"));
      }
  }

A few things I ran into:

  1. ForEach.paragraph(Presentation, callback) doesn’t reach every paragraph — it skipped paragraphs inside a group shape, a table cell
    and a SmartArt node, returning only the plain autoshape. SlideUtil.getAllTextBoxes(IBaseSlide) returned all of them. Is that
    difference intended, and which do you recommend for exhaustive traversal?
  2. For inherited bullets, getFont() is null and getType() is NotDefined instead of Symbol, so my type check skips them — and inherited
    is the majority case for us. getEffective().getFont() gives me the resolved font, but is there an equivalent for the bullet type,
    so I can tell an inherited bullet is effectively a symbol bullet?
  3. After rewriting the character, the bullet still points at the original font and the fallback rules set via
    FontsManager.setFontFallBackRulesCollection don’t seem to apply to bullet characters — it renders as an unrelated glyph unless I
    also call setFont(…). Is that expected?

Thanks. I am looking for best practices here!

@hritiik,
Thank you for your questions. I need some time to investigate the case. I will get back to you as soon as possible.

@hritiik,
Aspose.Slides does not provide a dedicated API for retrieving all bullet formats directly from a presentation. Bullet formatting is associated with individual paragraphs, so the paragraphs need to be inspected.

1. Traversing all paragraphs

For your scenario, I recommend using SlideUtil.getAllTextBoxes() to collect text frames from each slide, layout slide, and master slide, then iterate through their paragraphs.

The difference you observed between ForEach.paragraph() and SlideUtil.getAllTextBoxes() needs further investigation. Could you share a minimal presentation demonstrating the missing paragraphs? We can then determine whether this behavior is expected or requires a fix.

2. Detecting inherited bullet formatting

You can use IBulletFormat.getEffective() to retrieve bullet properties with inheritance applied, including the bullet type, character, and font.

For example:

IBulletFormat bullet = paragraph.getParagraphFormat().getBullet();
IBulletFormatEffectiveData effectiveBullet = bullet.getEffective();

if (effectiveBullet.getType() == BulletType.Symbol) {
    char bulletChar = effectiveBullet.getChar();
    IFontData bulletFont = effectiveBullet.getFont();

    // Use bulletChar and bulletFont to identify
    // bullet characters that need to be replaced.
}

If you need to replace a bullet character, you can use bullet.setChar() and bullet.setFont() to assign the replacement character and font explicitly.

3. Font fallback for bullet characters

Font fallback rules are intended to resolve missing glyphs during rendering. They do not translate font-specific Symbol or Wingdings character mappings into standard Unicode equivalents.

For your use case, explicitly assigning a font after replacing the bullet character is the recommended approach. This ensures that the new Unicode character is rendered using the intended font.

In summary, I recommend using SlideUtil.getAllTextBoxes() for text traversal, getEffective() for identifying inherited bullet properties, and explicitly setting the bullet character and font when normalizing the presentation.

Relevant API references:

Hey, So we observed few more issues.

  1. Source document → contains coloured emoji’s
    We are using google’s noto colour emoji font. But the pdf is actually getting rendered with tofu boxes.
    Works fine with google noto emoji font which is monochorme.

    Is there any aspose limitation to render coloured emoji’s from fonts like noto colour emoji.
    W21_special_characters.docx (36.6 KB)

@hritiik Unfortunately rendering of colored Emoji glyphs is not supported by Aspose.Words. This feature request is logged as WORDSNET-22379 . We will keep you updated and let you know once the feature is supported.