You are viewing limited content. For full access, please sign in.

Question

Question

any sample code on using sdk to retrieve image

SDK
asked on June 4, 2014

 Have a custom built mobile web app that they want to retrieve the image and just display it.

 

Security is handle already so they can only access their docs.

 

0 0

Replies

replied on June 4, 2014

Do you have WebLink? We have a heavily modified instance of WebLink that we embed inside other applications to provide that functionality. It has large portions of the UI stripped away and pretty much only displays lists of documents or individual documents depending on what we pass in the URL.

0 0
replied on June 4, 2014 Show version history

found a easy way to-do it. make an page called lfimage.ashx.

 

pass in the documentid

 

public void ProcessRequest(HttpContext context)

{

int32 documented = request.querysrting("documented");

 

RepositoryRegistration LFREG = new RepositoryRegistration("lfserver", "Repositoryname");

Session MySession = new Session();

MySession.LogIn("LFWorkflow", "**********", LFREG);

DocumentInfo docInfo = Document.GetDocumentInfo(documented , MySession);

docInfo.Lock(LockType.Exclusive);

docInfo.GetPageInfo(1);

System.IO.Stream stream = new System.IO.MemoryStream();

DocumentExporter DocOut = new DocumentExporter();

DocOut.ExportPage(docInfo, 1, stream);

System.Drawing.Image image = null;

image = System.Drawing.Image.FromStream(stream);

docInfo.Dispose();

MySession.LogOut();

 

 

using (MemoryStream ms = new MemoryStream())

{

image.Save(ms, System.Drawing.Imaging.ImageFormat.Tiff);

context.Response.ContentType = "image/tiff";

ms.WriteTo(context.Response.OutputStream);

}

}

 

call it like this from any page

<img src='LFImage.ashx?documentid=1111111' width="550" height="800" />

 

and image shows perfectly. I am only get the first page here put you can easily show array of images

 

SDK rocks/

0 0
replied on July 24, 2014

Hi there, 

 

How can i iterate one document to know all the pages so that it can export all pages as PDF ? 

You are not allowed to follow up in this post.

Sign in to reply to this post.