Issue with rendering PPTX Notes in HTML

Note: This thread is different from our another thread in notes - Free Support Forum - aspose.com

Here we create a new PPTX and created a notes initially, and never edited the notes again (which is problematic as we described in another mail). This thread specifically for rendering issues I found.

Please find attached ZIP file containing PPTX and converted HTMLs.

Please use code -
for (int i = 0; i < pres.getSlides().size(); i++) {


ITextFrame tf = pres.getSlides().get_Item(i).getNotesSlide().getNotesTextFrame();
// System.out.println(tf.getParagraphs().exportToHtml(0, tf.getParagraphs().getCount(), null));
//
try {
//Creating output html file
OutputStream os = new FileOutputStream(“Hell_” + i + “.html”);
Writer writer = new OutputStreamWriter(os, “UTF16”);

// Extracting first paragraph as HTML
//Writing Paragraphs data to HTML by providing paragraph starting index, total paragraphs to be copied
writer.write(tf.getParagraphs().exportToHtml(0, tf.getParagraphs().getCount(), null));
writer.close();
} catch (Exception fo) {
throw new RuntimeException(fo);

}
}


You may see problem in HTML -

Hellooo
first
𝐴=𝜋𝑟^2
note.
55.
Hello

Hello
World

Hello
first
𝐴=𝜋𝑟^2
note.
55

We want this -

Any help would be appreciated.

Thanks.

- Prakhar

Hi Prakhar,


Thank you for considering Aspose.Slides.

I have observed your requirements and worked with the presentation file shared by you. I have been able to reproduce the issue, while loading and saving the ppt file. A ticket with ID SLIDESJAVA-34854 has been logged in our issue tracking system to further investigate and resolve the issue.This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.

We are sorry for your inconvenience,

Hi,

Has there been any progress in this?
We need this to be fixed as soon as possible.



Thanks
-Manisha

Hi Manisha,


Thank you for getting back to us.

I have observed your comments and like to share that the issue SLIDESJAVA-34854 has been scheduled for investigation for the upcoming week. We will share the good news with you as soon as the issue will be fixed. We appreciate your patience in this regard.

Best Regards,

Hi Manisha,


I like to share with you that we have investigated the issue as shared by you. I request you to please try using following sample code on your end to serve the purpose, and then share the feedback with us.

Presentation pres = new Presentation(“D:\More+Hell\PowerPoint Notes.pptx”);
for (int i = 0; i < pres.getSlides().size(); i++) {
ITextFrame tf = pres.getSlides().get_Item(i).getNotesSlide().getNotesTextFrame();

try {
//Creating output html file
OutputStream os = new FileOutputStream(“D:\More+Hell\Hell_” + i + “.html”);
Writer writer = new OutputStreamWriter(os, “UTF16”);
// Initializing conversion options
TextToHtmlConversionOptions options = new TextToHtmlConversionOptions();
options.setTextInheritanceLimit(TextInheritanceLimit.TextBox); //Inherit only from TextFrame’s style.

writer.write(tf.getParagraphs().exportToHtml(0, tf.getParagraphs().getCount(), options));
writer.close();
}
catch (Exception fo) {
throw new RuntimeException(fo);
}
}

Please let us know if the issue persists. We will be happy to assist you further.

Best Regards,

Hi,

Thanks for providing the solution for the above issue. This solution works fine for the sample powerpoint presentation provided in above posts.

We are still facing some issues in rendering notes in html for some powerpoint presentation.
The powerpoint and notes html file (zip file) is attached with this post. You can see in html file that spacing between lines is not correct and hence we are seeing some lines getting overlapped.


The code used is given below:


public void generateHtmlNotesFromAllSlides(byte[] inputPpt) {

InputStream inputStream = new ByteArrayInputStream(inputPpt);
Presentation presentation= new Presentation(inputStream);

for (int i = 0; i < presentation.getSlides().size(); i++) {
String notes = null;
INotesSlide noteSlide = presentation.getSlides().get_Item(i).getNotesSlide();
if (noteSlide != null) {
ITextFrame tf = noteSlide.getNotesTextFrame();
TextToHtmlConversionOptions options = new TextToHtmlConversionOptions();
options.setTextInheritanceLimit(TextInheritanceLimit.TextBox);
options.setEncodingName(“UTF16”);
notes = tf.getParagraphs().exportToHtml(0, tf.getParagraphs().getCount(), options);
OutputStream os = new FileOutputStream(“note_”+(i+1)+".html");
Writer writer = new OutputStreamWriter(os, “UTF16”);
writer.write(notes);
writer.close();
}

}
}

Thanks
Manisha

Hi Manisha,


Thank you for considering Aspose.Slides.

I have observed your requirements and worked with the presentation file shared by you. I have been able to reproduce the issue. A ticket with ID SLIDESJAVA-34913 has been logged in our issue tracking system to further investigate and resolve the issue.This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.

We are sorry for your inconvenience,

The issues you have found earlier (filed as SLIDESJAVA-34854) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Hi,


We are still seeing this issue in ASPOSE SLIDES JAVA 15.5.0.
We are using same code and sample presentation.



Thanks
Manisha

Hi Manisha,


Thank you for getting back to us.

I have observed your comments and like to share with you that the notification we have shared with you is about the issue SLIDESJAVA-34854 which was marked as resolved upon your feedback when the code snippet was provided to you. The issue you are facing now by using that code with another presentation file is a separate issue logged as SLIDESJAVA-34913, which is not yet resolved. We will share the good news with you as soon as the issue will be resolved. We appreciate your patience in this regard.

Best Regards,

The issues you have found earlier (filed as SLIDESJAVA-34913) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.