Viewer rendering optimization


Are there any tricks to help the viewer render large files (EG: PDFs, Xls, etc) to reduce the amount of lag time needed to display on the web? EG: have it render only 3 page at a time, etc.

Thanks,

Dave

Hi Dave,


By default, when you open a web-page with GroupDocs.Viewer widget, and the target document is invoked (for displaying), on the server-side GroupDocs.Viewer converts the document to the images and text (for the image-based rendering) or to the HTML, images, fonts, and CSS (for the HTML-based rendering). Only when this conversion process is finished, GroupDocs.Viewer begins to transmit data to the client-side and end-user can see content of the document in the browser. That’s why it takes so much time - GroupDocs.Viewer needs to convert all document, and they are really big. The conversion speed depends on the performance of the server - CPU, memory, storage.

However, there is a “PreloadPagesCount” method. When using it, for example, “.PreloadPagesCount(1)”, GroupDocs.Viewer begins to transmit data to the client-side when only first page of the document is converted. After applying this method to the 1st document (17 MiB), GroupDocs.Viewer shows its first page almost instantly. All other pages are shown on demand, when you try to open them.

There are some other methods to increase performance:
1. Try to use HTML-based rendering mode (“UseHtmlBasedEngine(true)” method) if it is suitable for you and there are no document distortions.
2. Use “PreloadPagesCount(1)” method. When using this method GroupDocs.Viewer will begin to load document to the client-side when first page of the document will be converted. When this method is not used, GroupDocs.Viewer converts all pages of a document and only then sends it to the client-side.
3. Use “MinimumImageWidth(value)” method. MinimumImageWidth: if set, the Viewer will load page images with the specified width from the server when starting. It will not load page images from the server again after zooming if the current page image size is smaller than the value specified and if the original (not scaled) page image size is smaller than the value specified. It means that in most cases the GroupDocs.Viewer will load page images only once and will not reload them after zooming in/out.
4. If this is possible for your business-logic, disable thumbnails (“ShowThumbnails(false)”).
5. If this is possible for your business-logic, disable ability to select text by using “SupportTextSelection(false)” method.
6. Use “ShowViewerStyleControl(false)” method - it will disable “double page flip” option and will increase performance.

Best regards.

Is there a way to turn off text searching completely? So that it doesn’t bother OCRing the document for text searching?


I do see the ability to turn off the Search controls (ShowSearch).

Also, in cases of documents that are large PDF’s of drawings (CAD Drawings), the viewer takes about 20 seconds to render. Is this normal? I would think rendering 1 page would take a few seconds.

Hi,


Thank you for the question. Yes, you are right, to disable the search you should set ShowSearch to false.

As for the performance opening large pdf’s - yes is normal behavior and depends from the size of the each page content and the server hardware.

Best regards.