Page 1 of 1

Open a server side document

Posted: Thu Apr 30, 2020 12:11 pm
by WMY
Hi guys,

I'm using as backend asp.net core WEB application and as frontend Angular 9. With version GdPicture14.WEB it works in general, based on the example RESTful API!
How I an open a server side document.
Within the controller there is a function

[HttpPost("loadfromfile")]
public string LoadFromFile([FromBody]object jsonString)
{
return DocuViewareControllerActionsHandler.loadfromfile(jsonString);
}
I try to us this for that purpose, but I found no documenation about the object/jsonString. Is there some documentation about it?
Thanks!

cu

Re: Open a server side document

Posted: Tue May 12, 2020 9:22 am
by WMY
Hi,
I figured it out.
Within the rest-controller I have to initiate a instance of DocuViewareControl using the SessionId. From the frontend I got the controlConfiguration via POST.
Now I can load a file and have to return as HTTP result the new HTMLContent.
...

Code: Select all

            using (DocuViewareControl docuVieware = new DocuViewareControl(controlConfiguration.SessionId))
            {
            ...
                    docuVieware.LoadFromFile(DateiPfadName);


                using (StringWriter controlOutput = new StringWriter())
                {
                    docuVieware.RenderControl(controlOutput);
                    DocuViewareRESTOutputResponse output = new DocuViewareRESTOutputResponse
                    {
                        HtmlContent = controlOutput.ToString()
                    };
                    return output;
                }
            }

Re: Open a server side document

Posted: Thu May 14, 2020 4:22 pm
by Hugo
Hi WMY,

I'm glad you managed to solve your issue.

Feel free to let us know if you experience any other issues we could help you with.

I suggest in future you ask here: https://orpalis.zendesk.com/hc/en-us/requests/new
We respond faster there.

Regards