Free Support Forum - groupdocs.com

Comparison Javascript Dependency?


#1

Comparison seems to be dependent on JavaScript. Is there a way to have everything process running pure .Net instead? I didn’t find any examples. I’ve found this to be a bit annoying having to generate a redline document on a different page then redirect to a separate page for viewer. It would be nice to just simply generate the redline without JS and redirect a user to viewer.



Thanks


#2

Hello,

Thank you for your interest in GroupDocs. As we understand, you are talking about GroupDocs.Comparison for .NET library.

In general, GroupDocs.Comparison is focused on usage in the ASP.NET web-applications. When you place a “Groupdocs.Web.UI.Comparison.GroupdocsComparison” widget on a web-page, GroupDocs.Comparison performs a comparison operation and displays its result on a web-page with standard GUI. This GUI requires several JavaScript libraries and CSS code.

But this approach is not the only. If you are using GroupDocs.Comparison in the desktop, console or some other non-web-application, or you do not want to use standard GUI in a web-application at all, you may use “Groupdocs.Web.UI.Comparison.ComparisonService” class. “ComparisonService” is a base class which actually performs a comparison operation, it should be considered as a low-level core class. “GroupdocsComparison”, in a turn, should be considered as a high-level, it is a some sort of advanced wrapper around the “ComparisonService”. “GroupdocsComparison” internally invokes a low-level “ComparisonService”, obtains a result and generates a web-layout/markup, and shows it on a web-page with standard GUI.

You can use “ComparisonService” directly, its methods are very close to the standard methods from the “GroupdocsComparison”.

Here is a very conditional example code which shows a usage of the “ComparisonService” class in the ASP.NET MVC project:

Controller:
public ActionResult Page()
{
Groupdocs.Web.UI.Comparison.ComparisonService service = new ComparisonService();
service.SourceFileName(“Tables.Source.docx”);
service.TargetFileName(“Tables.Target.docx”);
service.ResultFileName(“result.docx”);
Groupdocs.Comparison.Common.ChangeInfo[] changes = service.GetChanges();
return View(changes);
}


View:
@model Groupdocs.Comparison.Common.ChangeInfo[]
@{
ViewBag.Title = “Page”;
}

List of all changes:


@foreach(Groupdocs.Comparison.Common.ChangeInfo one in @Model)
{

ID: @(one.Id); page No: @(one.Page.Id); Text: @(one.Text); Modification type: @(one.TypeStr)


}


“ComparisonService” has a lot of other useful methods which you can explore using the Object Browser.

If you will have more questions please feel free to contact us.


#3

*** Disregard as I found your response on another thread. Thank you ***



Denis,



Thanks for the response. You’ve mentioned “displays its result on a web-page” using the widget. However, I don’t get anything displayed. I get a blank page, but do see the Redline file on disk. Are you saying that comparison does not require Viewer to display the results?