| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
GroupDocs.Comparison UI is a rich UI interface that designed to work in conjunction with GroupDocs.Comparison for .NET to compare file and document formats in a browser.
To integrate GroupDocs.Comparison UI in your ASP.NET Core project you just need to add services and middlewares into your Startup class that provided in GroupDocs.Comparison.UI and related packages.
Include packages in your project:
dotnet add package GroupDocs.Comparison.UI
dotnet add package GroupDocs.Comparison.UI.SelfHost.Api
dotnet add package GroupDocs.Comparison.UI.Api.Local.Storage
dotnet add package GroupDocs.Comparison.UI.Api.Local.CacheAdd configuration to your Startup class:
using GroupDocs.Comparison.UI.Core;
using GroupDocs.Comparison.UI.Extensions;
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services
.AddGroupDocsComparisonUI(config =>
{
config.SetFilesDirectory("./Files");
});
services
.AddControllers()
.AddGroupDocsComparisonSelfHostApi(config =>
{
//Trial limitations https://docs.groupdocs.com/comparison/net/licensing-and-evaluation-limitations/
//Temporary license can be requested at https://purchase.groupdocs.com/temp-license/100078
//config.SetLicensePath("c:\\licenses\\GroupDocs.Comparison.lic"); // or set environment variable 'GROUPDOCS_LIC_PATH'
})
.AddLocalStorage("./Temp")
.AddLocalCache("./Cache");
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app
.UseRouting()
.UseEndpoints(endpoints =>
{
endpoints.MapGroupDocsComparisonUI(options =>
{
options.UIPath = "/comparison";
options.APIEndpoint = "/comparison-api";
});
endpoints.MapGroupDocsComparisonApi(options =>
{
options.ApiPath = "/comparison-api";
});
});
}
}Or, if you’re using new program style with top-level statements, global using directives, and implicit using directives the Program.cs will be a bit shorter.
using GroupDocs.Comparison.UI.Core;
using GroupDocs.Comparison.UI.Extensions;
var builder = WebApplication.CreateBuilder(args);
builder.Services
.AddGroupDocsComparisonUI(config =>
{
config.SetFilesDirectory("./Files");
});
builder.Services
.AddControllers()
.AddGroupDocsComparisonSelfHostApi(config =>
{
//Trial limitations https://docs.groupdocs.com/comparison/net/licensing-and-evaluation-limitations/
//Temporary license can be requested at https://purchase.groupdocs.com/temp-license/100078
//config.SetLicensePath("c:\\licenses\\GroupDocs.Comparison.lic"); // or set environment variable 'GROUPDOCS_LIC_PATH'
})
.AddLocalStorage("./Temp")
.AddLocalCache("./Cache");
var app = builder.Build();
app
.UseRouting()
.UseEndpoints(endpoints =>
{
endpoints.MapGroupDocsComparisonUI(options =>
{
options.UIPath = "/comparison";
options.APIEndpoint = "/comparison-api";
});
endpoints.MapGroupDocsComparisonApi(options =>
{
options.ApiPath = "/comparison-api";
});
});
await app.RunAsync();This code registers /comparison middleware that will serve SPA and /comparison-api middleware that will serve content for the UI to display.
Please note that Comparison does not create Files and Temp folders, please make sure to create Files and Temp folders manually before running the application.
The UI is Angular SPA that is build upon @groupdocs.examples.angular/comparison package. You can change the path where the SPA will be available by setting UIPath property e.g.
endpoints.MapGroupDocsComparisonUI(options =>
{
options.UIPath = "/my-comparison-app";
});The API is used to serve content such as information about a document, document pages in HTML/PNG/JPG format and PDF file for printing. The API can be hosted in the same or a separate application. The following API implementations available at the moment:
All the API implementations are extensions of IMvcBuilder:
Self-Host API uses GroupDocs.Comparison for .NET to convert documents to HTML, PNG, JPG, and PDF. All the conversions are performed on the host where the application is running.
services
.AddControllers()
.AddGroupDocsComparisonSelfHostApi();GroupDocs.Comparison for .NET requires license to skip trial limitations. A temporary license can be requested at Get a Temporary License.
Use the following code to set a license:
services
.AddControllers()
.AddGroupDocsComparisonSelfHostApi(config =>
{
config.SetLicensePath("./GroupDocs.Comparison.lic");
})When running Self-Host API on Linux the following packages have to be installed:
As an example the following commands should be executed to install the dependencies on Ubuntu 18.04.5 LTS (Bionic Beaver):
Storage providers are used to read/write file from/to the storage. The storage provider is mandatory.
All the storage providers are extensions of GroupDocsComparisonUIApiBuilder:
To render files from your local drive use local file storage.
services
.AddControllers()
.AddGroupDocsComparisonSelfHostApi()
.AddLocalStorage("./Files");In case you would like to cache the output files produced by GroupDocs.Comparison you can use one of the cache providers:
All the cache providers are extensions of GroupDocsComparisonUIApiBuilder:
services
.AddControllers()
.AddGroupDocsComparisonSelfHostApi()
.AddLocalStorage("./Files")
.AddLocalCache("./Cache");Your contributions are welcome when you want to make the project better by adding new feature, improvement or a bug-fix.
| Back | FazBrowse Home | New Git URL |