HTML Content Is Ignoring Indentation, Line Spacing when Saving from Presentation

Hi,

a. We added below content in rich text box in slide of Presentation.
image.png (1.2 KB)
b. We converted into html using below code and saved to Database.

 String content = shape.getTextFrame().getParagraphs().exportToHtml(0, shape.getTextFrame().getParagraphs().getCount(), null);

c. Attached the aspose generated html code .Aspose_generated_code.docx (11.9 KB)
d. When generating the report, we retrieved above saved html content from DB and report is generated.
We used below code for this.

IShape iShape = slide.getShapes().addAutoShape(ShapeType.Rectangle, x, y, width, height, false);
shape.getTextFrame().getParagraphs().addFromHtml(StringEscapeUtils.unescapeHtml(content != null ? content : "")); 

e. Report generated like this.
image.png (742 Bytes)
Could you please let us know why below formatting issues are there.
a. Why spacing between Test1 and Test2 is small which is not same as uploaded one.
b. why bullet color blue is not there for Text - Sub bullet
c. Why space is removed between bullet and Text - Sub bullet.

Could you please help us in resolving above issues.

@sandhyavutukuru,
Thank you for contacting support.

Please check your results using the latest version of Aspose.Slides if it is possible. If the issue persists, please share the following data and information:

  • presentation file
  • Aspose.Slides version you used
  • OS version where the code examples were executed
  • JDK version in your app

Unfortunately, I don’t see a workaround to resolve the issues you described right now. Please share the data and information listed above and we will do our best to resolve the issues as soon as possible.

  • presentation file - Not able to share this. This is the screen shot of text box.
    image.png (676 Bytes)

  • Aspose.Slides version you used - 18.11

  • OS version where the code examples were execute -
    (Cloud Foundry Linux-based filesystem - Ubuntu Bionic 18.04 LTS)

  • JDK version in your app - 1.8

@sandhyavutukuru,
Thank you for the additional information.

Unfortunately, I don’t see this issue on your screenshots. Could you please clarify what you meant?

Highlighted the space in yellow color in the attached image.image.png (2.1 KB)

@sandhyavutukuru,
I compared the images and I don’t see that the space has been removed between the bullet and the text. comparing.jpg (20.3 KB). Also, the space can be done differently (whitespaces, first line indentation, tabs, etc.). The remaining text with the same appearance can also be done in different ways. Unfortunately, we need the presentation source file to investigate the cases.

Yes correct, Space is not removed between the bullet and the test.
Could you please look into the case for first 2 issues based on the uploaded the html code.

@sandhyavutukuru,
I was unable to get completely the same result as yours but found other issues when importing the HTML content to PPTX file. I’ve added a ticket with ID SLIDESJAVA-38862 to our issue tracking system. We apologize for any inconvenience. Our development team will investigate the case. You will be notified when the issue is resolved.

Customers are waiting for this fix. Can you give the date when it will be fixed.

@sandhyavutukuru,
Our developers are working on the issue. A fix is planned for Aspose.Slides 22.9. This release will be published in the second half of September. Thank you for your patience.

The issues you have found earlier (filed as SLIDESJAVA-38862) have been fixed in Aspose.Slides for Java 22.9 (ZIP).
You can check all fixes on the Release Notes page.
You can also find the latest version of our library on the Product Download page.

@sandhyavutukuru,
Please note that on Linux, all fonts used in the input HTML must be installed on the OS or provided by FontsLoader because the presence of fonts affects layout calculation.