Hi, Issue has been noticed where in the print preview window of browser not all pages are seen, just broken page view appears as shown in the screenshot. It was expected that page loading popup to appear but it doesn’t and hence directly the print preview window opens.
When investigated the problem it appears that when
options.PreloadPages >= (no of pages in pdf being loaded).
In this case page loader popup doesn’t appear and hence the print preview window opens directly with broken pages.
Steps to reproduce:
- Set the PreloadPages to greater than or equal to (no of pages in pdf). I have following setting in place for document with 180 page count.
builder.Services.AddGroupDocsViewerUI(options => {
options.EnableFileName = false;
options.EnablePresentation = false;
options.EnableHeader = false;
options.EnableFileBrowser = false;
options.EnableDownloadPdf = false;
options.EnableSearch = false;
options.EnableLanguageSelector = false;
options.EnableFileUpload = false;
options.PreloadPages = 181;
options.StaticContentMode = false;
options.RenderingMode = RenderingMode.Image;
});
- Load the pdf in the viewer, and as soon as the Print button appears click on it. You can also produce delay by using middleware like mentioned in Groupdocs Viewer 8.0.7 - Wrong page no displayed initially during server delays to return pages
app.Use(async (context, next) =>
{
if (context.Request.Path.ToString().Contains("viewer-api/get-page"))
{
await Task.Delay(5000);
}
await next(context);
});
Notice that - Expected Print loader popup doesn’t appear indicating user that pages are still loading, and print preview directly opens, that causes broken pages to appear.
please see attached empty lightweight sample pdf of 180 pages below and screenshots of problem
sample_lightweight_180_pages.pdf (102.3 KB)
Broken Pages In Print Preview.png (22.2 KB)
Expected Print loader window.png (36.0 KB)