Loading images to an specific instance.

Discussions about DocuVieware integration in GdPicture.NET.
Post Reply
Alex
Posts: 4
Joined: Mon Apr 16, 2018 6:39 pm

Loading images to an specific instance.

Post by Alex » Fri Apr 20, 2018 7:46 pm

Hi, I'm trying to load documents from a database, I have a table in angular that displays the data on my table, so when I click on an specific record I want to load the image attached to that record on the docuvieware I've got. So how I'm I supposed to do this? The way I'm doing it right now is creating a new docuvieware each time I click. But is there any way I only have one instance, and send the desired file to that specific vieware?

Thanks.

Alex
Posts: 4
Joined: Mon Apr 16, 2018 6:39 pm

Re: Loading images to an specific instance.

Post by Alex » Mon Apr 23, 2018 9:06 pm

No answer yet, so, what I'm trying to do, is to load a file from an array of bytes to an specific vieware. So far what I've accomplished is to create more, and more viewares but no to load it to the original one. Here's a bit of code of what I've been doing.

Code: Select all

public DocuViewareRESTOutputResponse PostShow(DisplayDocuvieware displayConfig)
        {
            if (!DocuViewareManager.IsSessionAlive(displayConfig.SessionId))
            {
                Console.WriteLine("La session is inactive");
            }
            GdPicture14.WEB.DocuVieware docuviewareInstance = new GdPicture14.WEB.DocuVieware(displayConfig.SessionId);

            using (StringWriter controlOutput = new StringWriter())
            {
                if (displayConfig.File != null)
                {
                    Stream str = new MemoryStream(displayConfig.File);
                    docuviewareInstance.ID = displayConfig.ControlId;
                    docuviewareInstance.LoadFromStream(str, true);
                }
                docuviewareInstance.RenderControl(controlOutput);
                DocuViewareRESTOutputResponse output = new DocuViewareRESTOutputResponse
                {
                    HtmlContent = controlOutput.ToString()
                };
                return output;
            }
        }
The DisplayDocuveware only has the sessionID, the ControlID and the array of bytes I'm trying to load. I'm using the sample rest api for the Angular project.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests