We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Missing whitespace in paragraph

I seem to have hit a bug in Aspose Slides PPTX:

I have a PPTX document with a paragraph reading

The sky is blue.

where ParagraphEx.getText() returns

The skyis blue.

Unzipping the PPTX document and looking at the slide XML, I can see that the paragraph has three runs like this:

[The sky][ ][is blue.]

However, ParagraphEx.getPortions() only returns two portions, the whitespace-only portion is missing.

Is this a known problem? Is there a workaround?

Best regards,
Harald

Hi Harald,

Thanks for your interest in Aspose.Slides.

It would be great, If you can share your presentation file for investigation purpose.

Here is a test case. I simply formatted the blank character in “Second sentence.” as bold to create a whitespace-only run.

Aspose Slides swallows the whitespace run when extracting text from the document.

Best regards,
Harald

Hi Harald,

Please use the following code snippet to read text from Paragraphs. Please also visit this documentation link.

String prText="";
for(int pgCount=0;pgCount<TxtFrame.getParagraphs().size();pgCount++)
{
ParagraphEx Paragraph=TxtFrame.getParagraphs().get(pgCount);
for(int prCount=0;prCount<Paragraph.getPortions().size();prCount++)
{
prText=Paragraph.getPortions().get(prCount).getText();
System.out.println(prText+"\n");
}//End Portion Loop
}//End Paragraphs Loop