Closed vladimir-litvinchik closed 2 years ago
@vladimir-litvinchik Hi Vladimir, what is the status of multiple loading the files in viewer?
@ManuelHaas
This and two more open issues are planned for the next week.
@ManuelHaas
This issue has been partially fixed. The file type is cached at the client now so the method ResolveFileTypeAsync
is called only once. Please update the following packages
<PackageReference Include="GroupDocs.Viewer.UI" Version="3.1.8" />
<PackageReference Include="GroupDocs.Viewer.UI.SelfHost.Api" Version="3.1.17" />
The second issue with ReadFileAsync
is under investigation.
@ManuelHaas
I'm sorry for the delayed response. This issue has been fixed and it will require updating the packages to the latest version. Please note that you can adjust the number of pages to be rendered in a single call by setting a number of pages to preload.
services
.AddGroupDocsViewerUI(config => {
config.SetPreloadPageCount(3);
});
If you specify 0
all the pages will be loaded in at once, so the method ReadFileAsync
will be called only one time.
@vladimir-litvinchik It works now as expected. Thank you!
@ManuelHaas
Thank you for the feedback!
@vladimir-litvinchik Thank you very much for providing this quick solution! The documents will be shown now.
But one more question comes up: The methods
ReadFileAsync
andResolveFileTypeAsync
are called several times for one file that should be displayed. For example: 3 times for a singe page visx 5 times for a 8 pages docx 9 times for a 27 pages docxThis is rather inefficient. Especially since for
ReadFileAsync
the entire file has to be loaded from the database each time. Have I overlooked something or am I doing something wrong?Originally posted by @ManuelHaas in https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-.NET-UI/issues/17#issuecomment-1139491314