How document viewer API works in .NET

Hello Team,

How this document viewer works (in case of on premises)? Will document first upload to your server and will get converted there and send back to our server?

Or all the things will happen on our server and no call will be made to your server?

Thanks

1 Like

Using GroupDocs.Viewer for .NET on-premises (back-end) API all the processing will happen on your server.

API takes a source file as input and renders it to PDF, HTML or Image format (depending on your business needs). Later, converted file could be displayed or opened in the browser or any other application (e.g. Windows form).
You may find following resources helpful:

Please let us know if you need any further assistance.

Thanks for the reply.

So this means every document view, conversion related calls or any call which is related to this work will be within our server right?

Thanks again.

One more question, i tried example demo but i am getting below error for cad files.

GroupDocs.Viewer.Exceptions.GroupDocsViewerException: 'CAD document rendering failed.Please check that CadOptions sizing options do not have too low or too high values.

– code–
string outputDirectory = Utils.GetOutputDirectoryPath();
string pageFilePathFormat = Path.Combine(outputDirectory, “page_{0}.html”);

        using (Viewer viewer = new Viewer(TestFiles.SAMPLE_DWG_WITH_LAYOUTS_AND_LAYERS))
        {
            HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);
            options.CadOptions.RenderLayouts = true;

            viewer.View(options);
        }

Thanks

@vinaybhatt

Yes. API works without internet as well.

Can you please share the problematic CAD file and we’ll look into this issue?

Thanks again for sorting my query. I am using same example cad file which comes within sample. Name of the file is with_layers_and_layouts.dwg

It can not be added to reply as you have restricted it (authorized extensions: jpg, jpeg, png, gif, zip, pdf).

Thanks

@vinaybhatt

This issue appears when API license is not applied (we’re investigating it with ticket ID VIEWERNET-2854). The good thing is you could request a temporary license here. A temporary license is basically a time restricted full license. Using it, you could evaluate all the API features.

However, we couldn’t reproduce this issue at our end using API version 20.8 and with a license. Please have a look at these output.zip (6.1 KB) HTML files.

Thank you… I will check with temporary license.

One more thing can we check time spend on document? Like time spend per page and total time spend on document?

And is there is any feature to add notation on document?

1 Like

@vinaybhatt

To track time spent on each page you can use a custom page stream factory that implements IPageStreamFactory interface. Get more insights in this time_tracking_on_each_page.zip (21.2 KB) application.

  • LocalPageStreamFactory is responsible for storing output pages at the local disk
  • TimeSpentPageStreamFactory is responsible for tracking and printing time spent on each page

Using this sample application that is shared above, we got following output:

$ dotnet run
Page 1 rendering took 370.5262 milliseconds.
Page 2 rendering took 5.4839 milliseconds.
Press any key...

Let us know if it helps.

Thanks again Tahir, but actually, We want to track reading time on document by user, like how much time end user spends on a page before he scroll to other page and at last total time spent on reading document before it closes. Are there any events on this like document loading, document loaded, next page, previous page, document closing, document closed or so?

@vinaybhatt

This scenario could be implemented at client/UI level. GroupDocs.Viewer doesn’t provide any such feature/support. Please take a look at Google Analytics Event Tracking article.

Ok, and what about events of documents (document loading, document loaded, next page, previous page, document closing, document closed)?

Thanks

@vinaybhatt

In that case, you still have to handle such activities at UI level. UI is the proper place to track events like document loading, document loaded, next page, previous page, document closing, document closed, time spent by the user on a rendered page. GroupDocs.Viewer doesn’t provide such features in back-end API.

Ok thanks tahir

1 Like

@vinaybhatt

You’re welcome.

Hello Atir, Can you send us any front end example to view document, like document having more then 2-3 pages, and user can scroll down and up to see next and previous page ?

As we can get different files in .html format which get created for documents from viewer code in output folder.

1 Like

@vinaybhatt

We have some UI projects:

As you are rendering the source files to HTML. All you have to do is to open those HTML files in the browser using your web application.
In the first UI project, we are rendering source files to PDF and then displaying them in the browser. However, in second project, we are converting source file to HTML and then displaying it in browser.

Hello Tahir.

Good evening, We were on pause for development, now we are open again. Right now we are facing two serious issue

  1. Groupdoc Viewer library takes so much time for large files (files having 50 to 300 pages).
  2. Fonts gets changed after conversion.

Please suggest or help us out here.

Thanks a lot

Vinay Bhatt

@vinaybhatt

Please share sample files if possible.

Typically, when there are no required fonts installed in the system, another font is used. Please share sample file and details about your OS where you’re running the app.

Hello vladimir

Thanks for your quick response.

Fonts - I got your point.
Large file to check time (takes 4+ minutes) - How can i send a .ppt file to you?

One more thing image quality of document also gets fade.

Thanks