Goodmorning Aspose,
I have a document with a review comment in it, and I want to save the document as a pdf and as a html file without showing that comment.
Is there an options to remove the comment before I save the document as a pdf ?
I tried using the code below, on the document in the attachment, but it didn’t work. In the pdf I still see the comment.
PS testen in 16.12 and 17.2
Thank you,
Jeroen
<pre style=“background-color: rgb(255, 255, 255); font-family: “Courier New”;”>Document lDocument = new Document(lFileName);
//Remove review comments ONLY FOR PREVIEWS
RevisionOptions lRevisionOptions = lDocument.getLayoutOptions().getRevisionOptions();
lRevisionOptions.setShowRevisionMarks( false );
lRevisionOptions.setShowRevisionBars( false );
lRevisionOptions.setShowOriginalRevision( false );
lRevisionOptions.setRevisionBarsWidth( 0f );
lDocument.acceptAllRevisions();
lDocument.setTrackRevisions( false );
lDocument.updateFields();
lDocument.updatePageLayout();
lDocument.save(lSaveName);
//Remove review comments ONLY FOR PREVIEWS
RevisionOptions lRevisionOptions = lDocument.getLayoutOptions().getRevisionOptions();
lRevisionOptions.setShowRevisionMarks( false );
lRevisionOptions.setShowRevisionBars( false );
lRevisionOptions.setShowOriginalRevision( false );
lRevisionOptions.setRevisionBarsWidth( 0f );
lDocument.acceptAllRevisions();
lDocument.setTrackRevisions( false );
lDocument.updateFields();
lDocument.updatePageLayout();
lDocument.save(lSaveName);