Open a server side document

Discussions about DocuVieware integration in GdPicture.NET.
Post Reply
WMY
Posts: 10
Joined: Mon Feb 10, 2020 10:25 am

Open a server side document

Post by WMY » Thu Apr 30, 2020 12:11 pm

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

WMY
Posts: 10
Joined: Mon Feb 10, 2020 10:25 am

Re: Open a server side document

Post by WMY » Tue May 12, 2020 9:22 am

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;
                }
            }

Hugo
Posts: 227
Joined: Tue Dec 18, 2018 10:09 am

Re: Open a server side document

Post by Hugo » Thu May 14, 2020 4:22 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests