Html convert of compared document

Hello Team,
I am doing comparison and then saving that to html and now I don’t need the side bar on that.

document1.Compare(document2, "Comparison", DateTime.Now, compareOptions);

RevisionOptions revisionOptions = document1.LayoutOptions.RevisionOptions;

revisionOptions.InsertedTextColor = RevisionColor.BrightGreen;
revisionOptions.DeletedTextColor = RevisionColor.Red;

document1.TrackRevisions = true;

HtmlFixedSaveOptions opt = new HtmlFixedSaveOptions();
opt.PrettyFormat = true;
opt.ExportEmbeddedCss = true;
opt.ExportEmbeddedFonts = true;
opt.ExportEmbeddedImages = true;
opt.ExportEmbeddedSvg = true;

CheckDoc.docx (149.9 KB)

@Raghul214 You should simply set RevisionOptions.ShowRevisionBars property to false.

1 Like

After doing this I can see and added border and I don’t want that.
How can I avoid in html conversion

@Raghul214 Simply set HtmlFixedSaveOptions.ShowPageBorder property to false.

1 Like

In the html how to highlight the Cell added and removed

No no that revision bar is in left is required but on right side that column is not needed

Basically I need left side revision bar not comments section in right

@Raghul214 You can configure appearance of revisions in HtmlFixed using RevisionOptions class. Please see our documentation for more information.

Yes I saw those and is there a way to highlight the added table cell entire cell how we see in word document

@Keerthana_K_R Could you please attach your input and expected output (can be a screenshot from MS Word)? We will check your requirements and provide you more information.

Yes, I need this kind of highlight which is happening for added cells and rows in WOrd i need same behavior in html also

CheckDoc (1).docx (23.5 KB)

@Raghul214 Could you please attach your actual input and output documents?

Doc1.docx (21.8 KB)

Doc 2.docx (21.9 KB)

And output html looks like
Output html Screenshot.docx (34 KB)

Output needed this way in html.docx (17.6 KB)

@Raghul214 You can use the following code:

Document doc1 = new Document(@"C:\Temp\Doc1.docx");
Document doc2 = new Document(@"C:\Temp\Doc2.docx");
doc1.Compare(doc2, "AW", DateTime.Now);

doc1.LayoutOptions.RevisionOptions.ShowRevisionBars = false;

HtmlFixedSaveOptions opt = new HtmlFixedSaveOptions();
opt.PrettyFormat = true;
opt.ExportEmbeddedCss = true;
opt.ExportEmbeddedFonts = true;
opt.ExportEmbeddedImages = true;
opt.ExportEmbeddedSvg = true;

doc1.Save(@"C:\Temp\out.html", opt);

out.zip (29.9 KB)

Can you try vise versa of document even i am using same code

Means If we add new cells in table if we download as a word document it gets highlighted …
Shall we achieve same in html

@Raghul214

It is not quite clear what you mean. the output produced by the above provided code looks as your expected output.

No make the base document as the one which has new cell added

Output in doc.docx (20.0 KB)

This is the output generated using word after compare

Table cell got highlighted shall we achieve this in html

Output in doc.docx (36.0 KB)

screen shot added