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

Free Support Forum - aspose.com

Non space characters adding

I am converting an RTF Document into HTML and after some modification converting it back to RTF document.The New document contains nonbreakingspace () characters which are not in original document. Please see the below screen shot.

we are using Aspose.Words.14.1.jdk16.jar and java 1.7.
How can i prevent this situation. please update me.


Hi there,

Thanks for your inquiry. You can overcome this issue using following code example.

Document doc = new Document(MyDir + "input.rtf");
doc.getRange().replace(ControlChar.NON_BREAKING_SPACE, " ", false, false);

Could you please attach your input RTF
document here for testing? I will investigate the issue on my side and
provide you more information.

Hi Tahir,

Thanks for your response. The given solution replaces
the non Breaking spaces from the document but i want to prevent this Non
Breaking chars into RTF document at the time of conversion from HTML. I don’t
want to write Extra code for replace.

I am attaching the input, output files and Bellow is the generated HTML code after converting input file to html.

This is an example.

This is an example

Is there any properties want to set at the time of converting RTF to HTML and vice versa. Please update.


Hi Kapil,

Thanks for sharing the detail. I have tested the scenario using latest version of Aspose.Words v15.8.0 and have noticed that there is no non breaking space in output RTF. However, in output RTF, the double spaces between first two paragraphs are changed to one space. I have attached the output RTF with this post for your kind reference.

For the sake of correction, I have logged this problem in our issue tracking system as WORDSNET-12488. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-12488) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.