Hi Xiaoyuwan,
Thanks for providing the source code. We will investigate the issue and will respond you back. I have marked this post as “Private” therefore, only you and GroupDocs staff members will have access to the information or data shared in this forum thread.
Secondly, let me give you a brief introduction on how the API works. GroupDocs.Viewer for .NET, starting from version 3.0.0, is a back-end document processing API that renders the supported documents into HTML pages or images. These HTML pages and images can be viewed using some front end application. It depends on your requirements that whether do you want to render the document into image form or in HTML form. The notable thing is that GroupDocs.Viewer for .NET is independent of any front end UI. You can develop your own front end application (as per your requirements) to view the HTML pages or images that are rendered using the back-end API.
<span style=“color: rgb(76, 82, 89); font-family: “PT Sans”, Helvetica, Arial, sans-serif; font-size: 14px; background-color: rgb(221, 221, 221);”>
<span style=“color: rgb(76, 82, 89); font-family: “PT Sans”, Helvetica, Arial, sans-serif; font-size: 14px; background-color: rgb(221, 221, 221);”>And also, what’s the difference between ViewDocumentAsHtml and ViewDocumentAsImage if i want to show a pdf/word file on the page?
When you choose to View Document as HTML then each page of the source/input document is rendered into an HTML page and you can view these pages in a browser. On the other hand, when you select View Document as Image then each page of the document is rendered into an image. You can view these rendered images in order to view the content of the document. For more details, we’ll recommend you to please have a look at
API Documentation.
<span style=“color: rgb(76, 82, 89); font-family: “PT Sans”, Helvetica, Arial, sans-serif; font-size: 14px; background-color: rgb(221, 221, 221);”>I am still very puzzled about it. For example ,after the init function, how does the js in front-end page cooperate with the back-end functions ,and when the webmethod “ViewDocument” is called?
In our open source document viewer applications, the back-end API interacts with the front end application using jQuery and AJAX calls. The front end jQuery functions create AJAX call to the back-end method ViewDocument. This method renders the document into image or HTML pages and returns the pages as a response of that call. After that, the front end application processes the response and displays the document in the browser.
If you would have any confusion, please let us know.
Warm Regards