Free Support Forum - aspose.com

Conversion Word to PDF cannot show revision bar

hi,

I want to show the comment bar in pdf, used to display the doc compare result. But various configuration attempts can not achieve the effect I want . (version: Aspose.Words for Java 19.1)

My code is as follows:

    sourceDoc.compare(targetDoc, "user", new Date(), options);
    RevisionOptions revisionOptions = sourceDoc.getLayoutOptions().getRevisionOptions();
    revisionOptions.setShowRevisionMarks(true);
    revisionOptions.setShowReisionBars(true);
    sourceDoc.save("result.pdf");

Attached with the results I want.

compare-doc.zip (237.3 KB)

@matt.wang

Please use RevisionOptions.ShowInBalloons property as shown below to get the desired output.

RevisionOptions revisionOptions = sourceDoc.getLayoutOptions().getRevisionOptions();
revisionOptions.setShowRevisionMarks(true);
revisionOptions.setShowInBalloons(ShowInBalloons.FORMAT_AND_DELETE);
sourceDoc.save("result.pdf");
1 Like

Works for me, thanks for your reply.

@matt.wang

Thanks for your feedback. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.