Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/GroupDocs.Viewer.UI.API/Controllers/ViewerController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ private async Task<List<PageData>> CreateViewDataPagesAndThumbs(FileCredentials
{
await _viewer.GetPagesAsync(file, pagesToCreate);

if (_config.EnableThumbnails)
if (_config.EnableThumbnails && _config.RenderingMode == RenderingMode.Html)
{
await _viewer.GetThumbsAsync(file, pagesToCreate);
}
Expand All @@ -346,7 +346,7 @@ private async Task<List<PageData>> CreateViewDataPagesAndThumbs(FileCredentials
var pageUrl = _apiUrlBuilder.BuildPageUrl(file.FilePath, page.Number, _viewer.PageExtension);
var thumbUrl = _apiUrlBuilder.BuildThumbUrl(file.FilePath, page.Number, _viewer.PageExtension);

var pageData = _config.EnableThumbnails
var pageData = _config.EnableThumbnails && _config.RenderingMode == RenderingMode.Html
? new PageData(page.Number, page.Width, page.Height, pageUrl, thumbUrl)
: new PageData(page.Number, page.Width, page.Height, pageUrl);

Expand All @@ -366,7 +366,6 @@ private async Task<List<PageData>> CreateViewDataPages(FileCredentials file, Doc
{
await _viewer.GetPagesAsync(file, pagesToCreate);


var pages = new List<PageData>();
foreach (PageInfo page in docInfo.Pages)
{
Expand All @@ -392,7 +391,7 @@ private async Task<List<PageData>> CreatePagesAndThumbs(FileCredentials file, Do
{
await _viewer.GetPagesAsync(file, pagesToCreate);

if (_config.EnableThumbnails)
if (_config.EnableThumbnails && _config.RenderingMode == RenderingMode.Html)
{
await _viewer.GetThumbsAsync(file, pagesToCreate);
}
Expand All @@ -404,7 +403,7 @@ private async Task<List<PageData>> CreatePagesAndThumbs(FileCredentials file, Do
var pageUrl = _apiUrlBuilder.BuildPageUrl(file.FilePath, page.Number, _viewer.PageExtension);
var thumbUrl = _apiUrlBuilder.BuildThumbUrl(file.FilePath, page.Number, _viewer.ThumbExtension);

var pageData = _config.EnableThumbnails
var pageData = _config.EnableThumbnails && _config.RenderingMode == RenderingMode.Html
? new PageData(page.Number, page.Width, page.Height, pageUrl, thumbUrl)
: new PageData(page.Number, page.Width, page.Height, pageUrl);

Expand Down
24 changes: 24 additions & 0 deletions src/GroupDocs.Viewer.UI.API/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,27 @@ builder.Services.AddSingleton<ISearchTermResolver, MySearchTermResolver>();
![GroupDocs.Viewer.UI - Custom search term](https://raw.githubusercontent.com/groupdocs-viewer/groupdocs-viewer.github.io/master/resources/image/ui/custom-search-term.png)

**NOTE:** This feature works only when rendering to HTML and when `PreloadPages` is set to `0` which means all the pages are preloaded. The service should be registered before you register the self-hosted or cloud API for it to take effect. By default, [SearchTermResolver.cs](./SearchTermResolution/Implementation/SearchTermResolver.cs) is registered. This class provides a default implementation that returns an empty string.

### Controll Thumbnails Creation

Thumbnails are only required when rendering to HTML with embedded or external resources.
When rendering to JPG or PNG, the actual page image is used as a thumbnail for better performance.

To control thumbnail creation when rendering to HTML, set the `EnableThumbnails` property to `false`.
This hides the thumbnail panel and disables thumbnail generation by the API.

The following code demonstrates how to use this option without a UI:

```cs
builder.Services
.AddOptions<Config>()
.Configure<IConfiguration>((config, configuration) =>
{
config.EnableThumbnails = false;
});

builder.Services
.AddControllers()
.AddGroupDocsViewerSelfHostApi(config =>
//...
```
6 changes: 6 additions & 0 deletions src/GroupDocs.Viewer.UI.Core/Configuration/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ public class Config
/// </summary>
public bool EnableHyperlinks { get; set; } = true;

/// <summary>
/// Enables or disables scroll animation when navigating to a page using page seclector control.
/// Default value: <c>true</c> and the scroll animation is enabled.
/// </summary>
public bool EnableScrollAnimation { get; set; } = true;

/* Control Visibility Settings */

/// <summary>
Expand Down
14 changes: 7 additions & 7 deletions src/GroupDocs.Viewer.UI/App/3rdpartylicenses.txt
Original file line number Diff line number Diff line change
Expand Up @@ -871,12 +871,7 @@ https://github.com/cartant/rxjs-etc by Nicholas Jamieson, MIT licensed. See the
file header for details.

--------------------------------------------------------------------------------
Package: @ngx-translate/core
License: "MIT"


--------------------------------------------------------------------------------
Package: @ngrx/operators
Package: @ngrx/effects
License: "MIT"

The MIT License (MIT)
Expand Down Expand Up @@ -906,7 +901,12 @@ https://github.com/cartant/rxjs-etc by Nicholas Jamieson, MIT licensed. See the
file header for details.

--------------------------------------------------------------------------------
Package: @ngrx/effects
Package: @ngx-translate/core
License: "MIT"


--------------------------------------------------------------------------------
Package: @ngrx/operators
License: "MIT"

The MIT License (MIT)
Expand Down

Large diffs are not rendered by default.

446 changes: 0 additions & 446 deletions src/GroupDocs.Viewer.UI/App/chunk-3SMDAA4S.js

This file was deleted.

Large diffs are not rendered by default.

Loading
Loading