@vladimir.litvinchik Great, Thank you!
There are two updates in the latest version of GroupDocs.Viewer.UI 8.0.2
The feature where images are printed instead of PDF in image mode was moved from version 6.0.x to 8.0.x.
File name
This feature was fixed and now hides file name from top bar and thumbnails pane.
Also, you can set the file name using your implementation of IFileNameResover
interface and registering a service:
builder.Services.AddTransient<IFileNameResolver, MyFileNameResolver>();
public class MyFileNameResolver : IFileNameResolver
{
public Task<string> ResolveFileNameAsync(string file)
{
return Task.FromResult($"Custom file name for {file}");
}
}
To get the changes update you GroupDocs.Viewer.UI
and GroupDocs.Viewer.UI.*
packages to the latest 8.0.2
version.
The complete list of changes can be found in the release notes
Please let us know if you have any questions.
Hi @vladimir.litvinchik Thanks for updating. I am noticing following problems with the upgrade.
We have PreloadPageCount set to 300
Viewing document of 98 pages ( < 300)
Issues observed -
-
When loaded pdf in the viewer, it renders all pages, sometimes few are missing either in thumbnail or itâs actual page. (need to scroll or click on print button to load them, and sometimes it doesnât load altogether.)
Here is the screenshot for âsample_pdf_printing_problem_1.pdfâ that was shared with this ticket.
image.png (44.1 KB) -
Simple scroll operation sometimes shows scrolling 5-6 pages at a time as that appears in page number field. (may be double check the page no fix is correctly applied)
-
Clicking print button - following loading pages popup always loads clicking on print button, even though pages are already rendered, and it takes a while to finish. (may be making calls to backend again)
image.png (6.0 KB)
Thank you for reporting this issues, weâll analyze them and update you. The issue ID for reference is VIEWERNET-5240.
Iâm sorry for the delayed response. The issues you have listed are planned to be fixed in March as soon as I have any updates Iâll let you know.
In the latest version of GroupDocs.Viewer.UI, weâve resolved the issue related to printing documents in image mode.
Previously, we used direct links to the document pages. Now, weâre using the URL.createObjectURL()
method, which caches the pages and prevents them from being reloaded when the Print button is clicked. The printing process now works in three stages:
- Generates any pages that havenât been created yet
- Loads any pages that are not already cached
- Sends the document to print
Unfortunately, I wasnât able to reproduce the issue where some pages appear to be missing. Iâd appreciate your help in verifying whether the issue still exists on your side.
Additionally, I couldnât reproduce the Simple scroll issue either. Could you please share an animation or video demonstrating the problem so we can analyze it further?
See also v25.3 release notes for all the changes in this release.
Hi @vladimir.litvinchik
Thanks, I have updated to following version now,
image.png (16.2 KB)
Issue - some pages missing or blank/white.
Just investigated this appears to be when custom viewer paths has been set as follows, which was working in previous release (6.*).
Many 404s in debug console for various page urls. (get-thumb, get-page). looks like it still uses âviewer-apiâ instead âdocument-viewer-apiâ
https://localhost:5176/viewer-api/get-thumb?file=sample_pdf_printing_problem_1.pdf&page=28
https://localhost:5176/viewer-api/get-page?file=sample_pdf_printing_problem_1.pdf&page=234
endpoints.MapGroupDocsViewerUI(options =>
{
options.UIPath = "/document-viewer";
options.ApiEndpoint = "/document-viewer-api";
});
endpoints.MapGroupDocsViewerApi(options =>
{
options.ApiPath = "/document-viewer-api";
});
When I set this to it works and pages now loads without whitespace.
endpoints.MapGroupDocsViewerUI(options =>
{
options.UIPath = "/viewer";
options.ApiEndpoint = "/viewer-api";
});
endpoints.MapGroupDocsViewerApi(options =>
{
options.ApiPath = "/viewer-api";
});
Further observations to this new release. (after using /viewer)
- Print button doesnât work, nothing happens. no console logs or network calls/errors in browser console. (both on edge and chrome)
I have following settings in my viewer.
var builder = WebApplication.CreateBuilder(args);
builder
.Services
.AddGroupDocsViewerUI(options =>
{
options.EnableFileName = false;
options.EnablePresentation = false;
options.EnableHeader = false;
options.EnableFileBrowser = true;
options.EnableDownloadPdf = false;
options.EnableSearch = false;
options.EnableLanguageSelector = false;
options.EnableFileUpload = false;
options.PreloadPages = 300;
options.StaticContentMode = false;
options.EnablePrint = true;
options.RenderingMode = RenderingMode.Image;
});
builder.Services.AddControllersWithViews()
.AddRazorRuntimeCompilation()
.AddGroupDocsViewerSelfHostApi(options =>
{
options.SetViewerType(GroupDocs.Viewer.UI.Core.ViewerType.Jpg);
})
.AddLocalStorage("./Files")
.AddLocalCache("./Cache");
please try with above settings, if doesnât work, will try to create video. (although there might be some upload size restriction, i think on this forum)
Thank you for the feedback, Iâll look into this issues ASAP. Will update you when I have any information.
Iâm sorry for the delayed response. The issue with the Print button was fixed. Having code that you provided I have managed to reproduce it. Please try installing the latest version of the package 8.0.4.
In case you still experience the issue with missing pages, can you please update this sample application:
VIEWERNET-5240.ZIP (2.8 MB) so I could reproduce the issue on my side?
@vladimir.litvinchik Thanks for fixing the problem of print button doesnât work.
Still noticed some issues now. please find below.
-
Missing pages problem, this is still reproducible when path is set to âdocument-viewerâ, please find screenshot below for changes to be done in the sample application code.
1_viewer_missing_pages.png (154.9 KB) -
Similar print problem is noticed, when preload page count is set to 2. Popup indicating print pages loading stuck at âLoaded 28 of 30 pagesâ. I used pdf âJavaScript-30P.pdfâ in the sample application given.
Attached video to repro steps.
2_viewer_print_problem.7z (647.7 KB)
Thank you for providing the details. I have reproduced both issues and they are fixed in the latest package version 8.0.5.
Please let me know if you experience any other issues.
@vladimir.litvinchik Thanks for fixing both the issues, done quick tests - those both looks ok now.
However noticed issue mainly around performance of rendering, there are additional âp1_t.jpegâ files are created per page after all the page specific files e.g. âp1.jpegâ is rendered. Creation of these files wasnât before in (6.x releases), and appears to add now additional wait times for actual page to be shown in UI.
I have set preload page count as 300, and doc with 250 pages took around 2:30 mins to show document in viewer. so user waits for that much time in website to load entire doc. I think something can be improved around these âtâ files consuming additional time. may be doing this client side or parallelly at server side. or speed up the overall jpeg image export process, this in turn would solve both.
It would be really great if this performance issue can be addressed, as viewer appears bit slower due to the image export time taken.
Thanks for the feedback. Yes t
files are thumbnails. Actually thumbnails seems to be not necessary and can be replaced with actual page image. Iâll test this during next iteration and update you.
At the moment you can disable thumbnails with the following code but it will also hide thumbnails panel
builder.Services
.AddGroupDocsViewerUI(config =>
{
config.EnableThumbnails = false; // Hide thumbnails
});
The issue ID for reference is VIEWERNET-5324.
The change you proposed was integrated in version 8.0.6. Now, in image mode actual page images are used for thumbnails. The thumbnails are not generated.
The packages are already available at NuGet. Please let us know if you have any issues.