Free Support Forum - groupdocs.com

Preview takes more Loading time


#1

Hii ,

Please go through attachment files.

#2

Hello,


Thank you for the request. Could you please provide more info about the issue. Please share with us next:

1. Version of the GroupDocs library.
2. Rendering mode
3. Browser and it’s version
4. Example of the widget code

Thank you.

#3
Hii,

File preview works fine for all files but takes more time to preview for particular file which is attached in previous post i think there are some issue in file .Please go through following data :

Version : -1.8.0
Browser:firefox



@(Html.Groupdocs()
.Annotation()
.Stream((Stream)ViewBag._Stream, ViewBag._File)
.ElementId("annotation-widget")
.FilePath("Quick_Start_Guide_To_Using_GroupDocs.pdf")
.AccessRights(Groupdocs.Common.AnnotationReviewerRights.CanAnnotate)
.ShowZoom(true)
.ShowPaging(true)
.ShowPrint(true)
.ShowThumbnails(true)
.OpenThumbnails(false)
.PreloadPageCount(1)
.EnableRightClickMenu(false)
.ShowFileExplorer(true)
.Tools(Groupdocs.Web.Annotation.AnnotationTools.All)
.ShowHeader(true)
.EnableTextSelection(true)
.StrikeoutMode(Groupdocs.Common.StrikeoutToolMode.Remove)
.ScrollOnFocus(true)
.ClickableAnnotations(true)
.ConnectorPos(Groupdocs.Web.Annotation.ConnectorPosition.Bottom)
.AreaToolOptions(new Groupdocs.Web.Annotation.DrawingOptions { PenWidth = 1, DashStyle = Groupdocs.Common.DashStyle.Solid, PenColor = 0xFF0000,BrushColor=16776960 })
.PolylineToolOptions(new Groupdocs.Web.Annotation.DrawingOptions { PenWidth = 1, DashStyle = Groupdocs.Common.DashStyle.Dash, PenColor = 0xFF0000 })
.ArrowToolOptions(new Groupdocs.Web.Annotation.DrawingOptions { PenWidth = 1, DashStyle = Groupdocs.Common.DashStyle.Solid, PenColor = 0xFF0000 })
.DisconnectUncommented(true)
.ShowToolbar(true)
.HighlightColor(0xFFFF00)
.TextFieldBackgroundColor(0xf0f0f0)
.MinimumImageWidth(100))


#4

Hello,


Thank you for the example. First of all please update your library with the latest version. Then please remove .Stream or .FilePath property because you can’t use both of them in the same time.

To speed up first loading of the document you can do next: generate document cache before it will be requested by the Annotation library. For how to do that please check this code example:
string url = string.Empty;
HttpRequest request = HttpContext.Current.Request;
url = “http://” + request[“HTTP_HOST”] + “/”;
Groupdocs.Web.UI.DocumentCache cacheDocument = new Groupdocs.Web.UI.DocumentCache(null, Server.MapPath("~/App_Data"),
Server.MapPath("~/App_Data/temp"));
cacheDocument.GenerateImages(_filePath, null, null, 100);

The idea is next: lets say you (or user) uploads the document which will be annotated. Just after it was uploaded (in the same method) you will generate it’s cache with the code that I shared. And then when user will open it for annotating - Annotation will not take a time for the cache generating. As a result loading time should be reduced.

Thank you.

#5

Hii,

please go through screen shot

#6

Hi again,


Thank you for the screenshot. To resolve the issue simply update the code line with the error with such one: HttpRequest request = System.Web.HttpContext.Current.Request;

Best regards.