Hi all,
I'm using LF SDK to export a page of a document(tiff). One of the images I am testing has a size of 14400x9696(this will vary). When I export to stream and display in div it sometimes crashes Chrome(Aw Snap error). I've been looking for a property or method to use in LF help and only see Property Attributes which allows to get/set image height & width. PageInfo has ImageHeight & ImageWidth but only allows get. I've tried a workaround that gets the image, then in asp .net gets thumbnail and resize to 3600x2424 just to see what happens and although it did not crash chrome I do not think this is ideal(but less than this the resolution degrades). I need to resize the image via SDK and then zoom in on parts of the image(that are not visible) so that it is visible to the user; like in LF Client Document Viewer, you can zoom in/zoom out(icon on toolbar) on parts of the image. I do not know if only the zoom on the toolbar in LF document viewer can be accessed. Any ideas or suggestions? Thanks in advance!Code:
//srvc: Laserfiche.DocumentServices.DocumentExporter de = new Laserfiche.DocumentServices.DocumentExporter(); DocumentInfo di = Document.GetDocumentInfo(ID, repoSession); de.PageFormat = DocumentPageFormat.Tiff; de.ExportPages(di, new Laserfiche.RepositoryAccess.PageSet("1"), stream); //handler: byte[] byteArray = new byte[0]; myImg = System.Drawing.Image.FromStream(myList[ctr].myDocImg); using (System.Drawing.Image resizedImg = myImg.GetThumbnailImage(3600, 2424, new System.Drawing.Image.GetThumbnailImageAbort(myCallBack), IntPtr.Zero)) //1/4 of original { resizedImg.Save(stream, ImageFormat.Jpeg); stream.WriteTo(context.Response.OutputStream); byteArray = stream.ToArray(); context.Response.OutputStream.Write(byteArray, 0, byteArray.Length); }