How to get track changes in aspose word using Java

Hii,

my code is

private void updateContentControl(Document document, DocumentBuilder documentBuilder, Map<String, TrackChange> contentControlIdToText, StructuredDocumentTag std) throws Exception {
  

    std.removeAllChildren();
    Paragraph para = new Paragraph(document);
    std.appendChild(para);
    documentBuilder.moveTo(std.getFirstChild());
    document.startTrackRevisions(performedBy,performedDate);        
    documentBuilder.insertHtml(contentControlIdToText.get(std.getTag()).getModifiedText());

    Node lastChild = std.getLastChild();
    if (("\r").equals(lastChild.getText())) {
        std.removeChild(lastChild);
    }
    document.stopTrackRevisions();
}

I want to get track changes only on the latest updated text into the document by the specific User. but In my above Code, I Don’t have the latest specific changed text which is inserted. so I am inserting all the Text with the newly inserted text in documentBuilder

@hrom405

Could you please ZIP and attach your input document along with expected output? We will then provide you more information about your query.

Hii,
@tahir.manzoor thanks for your reply,

I am uploading a zip file with three documents files, “original file.docx”, “expected output.docx” and “output.docx” I got.

I only need track changes on the changed text which I provide in the “expected output.docx” file but I got all the track changes in all the paragraph which is shown in the “output.docx” fileaspose data.zip (58.2 KB)

@hrom405

Thanks for sharing the documents. To investigate this issue, we need some more detail. Please attach the following resources here for testing:

  • Please share the steps that you used to create expected output document.
  • Please create a standalone console application ( source code without compilation errors ) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.