Free Support Forum - aspose.com

Show Comments in Balloon Revisions and Insertions/Deletions Inline

Hello,

I am trying to match the following Word layout when generating a PDF with Aspose.

In Word, on the Review tab, Tracking section I have the following settings:

All Markup selected
Show Markup -> Comments checked
Show Markup -> Ink unchecked
Show Markup -> Insertions and Deletions checked
Show Markup -> Formatting unchecked
Show Markup - > Balloons -> Show Only Comments and Formatting in Balloons checked

When exporting to PDF, I get a PDF document with balloon comments down the right hand side and all text insertion and deletions showing inline in the document.

How can I get the same layout using Aspose?

These are the only Revision layout settings I can find so far:

doc.LayoutOptions.RevisionOptions.ShowRevisionBalloons = ShowRevisionBalloons; // default false
doc.LayoutOptions.RevisionOptions.ShowOriginalRevision = ShowOriginalRevision; // default false
doc.LayoutOptions.RevisionOptions.ShowRevisionBars = ShowRevisionBars; // default true
doc.LayoutOptions.RevisionOptions.ShowRevisionMarks = ShowRevisionMarks; // default true

This creates a PDF file with all of the insertion and deletion and formatting revision showing. How can I control what revisions are shown where?

@sheri_steeves,

We have logged your requirement in our issue tracking system. The ID of this issue is WORDSNET-17208. We will further look into the details of this problem and will keep you updated on the status of this issue. We apologize for your inconvenience.

@sheri_steeves,

Please also ZIP and upload your sample 1) input Word document, 2) Aspose.Words generated output document and 3) your expected document showing the correct behavior here for testing. You can create expected document by using MS Word. Thanks for your cooperation.

@awais.hafeez,

Here is a zip file (RevisionsTestWithComment.zip (321.8 KB)) of a sample Word document and two PDF files:

  • ExportFromWord - RevisionsTestWithComment.pdf, this one is the layout I am looking for.
  • 000_RevisionsTestWithComment.pdf - this is the layout I get from Aspose.Words version

@awais.hafeez,

I am currently building against Apose.Words 18.6.0.

@sheri_steeves,

Thanks for the additional information. We will keep you informed of further updates.

@sheri_steeves,

Regarding WORDSNET-17208, If we understood you correctly, the Aspose.Words’ output must look like - ExportFromWord - RevisionsTestWithComment.pdf document that you attached in this post.

So, we used the following code:

Document doc = new Document("D:\\Temp\\RevisionsTestWithComment.docx");
doc.Save("D:\\Temp\\18.8.pdf");

And see the correct output.

Can you please also provide screenshot highlighting (encircle) the area(s) that you want us to fix in above 18.8.pdf (as compared to your ExportFromWord - RevisionsTestWithComment.pdf)

This gave me close to the results I wanted for that file, as that file already has the correct revision settings set. A closer look gave me the settings I needed to get the insertions and deletions to show in the text, and only commenting and formatting on the “bubble” comments down the side, so this is good. I took these settings and tested them against my original test document from a client.

What I noticed with the client’s document is that in the PDF created from Word, the inline insertion/deletion text is blue but through Aspose becomes red. I can’t share this particular document as it is confidential document.

A new sample document I created shows the insertions and deletions in red in Word as well as in the PDF created by Aspose. I’m working on creating a new test document that exhibits the behaviour of the inline insertions/deletions changing color.

Thanks,
Sheri

@sheri_steeves,

You can use the following lines of code to adjust the Revision colors in generated PDF:

doc.LayoutOptions.RevisionOptions.DeletedTextColor = RevisionColor.Green;
doc.LayoutOptions.RevisionOptions.InsertedTextColor = RevisionColor.Red;

I did see those options, thanks.

I later realized that the different text colors corresponds to each authors changes.

In my sample document I opened and made some changes as a different user, and now I see my changes in red and the other user in blue. I see this when the document is open in Word, when exported to PDF from Word and when I create a PDF using Aspose.

The client’s sample document, however, has the changes in blue for one author, and teal blue for the other author. These colors are maintained when exporting to PDF. With Aspose and this document, the changes are red for the first author, and blue for the second.

Is there a way to control this without hardcoding the colors? How are the ByAuther colors determined?

@sheri_steeves,

Thanks for the additional information. We have logged this requirement in our issue tracking system. The ID of this issue is WORDSNET-17320. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.

@sheri_steeves,

Regarding WORDSNET-17320, we do not think there is a way to ensure that colors used for different authors are displayed the same by two copies of Word application, let alone Aspose.Words. These settings are specific to an application (MS Word or Aspose.Words) and not stored in the document.

You can read a bit of additional information here:
Change the track changes color

You may please also check ‘How does Word choose which color to allocate to which author’ section in here.

So, this is not an issue with Aspose.Words.

We will also close the other issue WORDSNET-17208. Please see the details here.

@awais.hafeez

Thanks for the followup and the links; this makes sense.