Free Support Forum -

Removed spases


I have a problem with attached file because when I load the file and get any paragraph from it, they don’t have a spaces between the word and every Run of paragraph don’t have a space, too.

This is the code and I attached the file and you can try:

public void runTest() throws Exception {
Document document = new Document("/path/Script AYEW.docx");
NodeCollection nodeCollection = document.getChildNodes(
NodeType.PARAGRAPH, true);
Paragraph paragraph = (Paragraph) nodeCollection.get(9);
RunCollection runCollection = paragraph.getRuns();
Iterator runIterator = runCollection.iterator();
while (runIterator.hasNext()) {
Run run =;

Can you help me about this?


Hi Bojan,

Thanks for your inquiry. I have tested the scenario and have not found the shared issue with spaces while using latest version of Aspose.Words for Java. Please use the latest version Aspose.Words of Java.

Please let us know if you have any more queries.