How to render a document on the screen after it is converted to a .jpg image?

Hello, Good morning! We are evaluating your product: GroupDocs.viewer.

I downloaded the latest package and its examples, built the example project after I added Groupdocs.Viewer.dll as its reference.

In the test, It is nice to see how easy it is to render or convert a document as HTML, Image, or PDF file.

However, nothing is displayed on the screen! Is this just a UI-less backend API? Am I doing something wrong?

You did not say anything about this in your document or the example files.

Since we have not got a trial license, Is this a trial limit?

What should I do after I got a .jpg Image file?

Do you have a complete example I can follow so that

I can see a thumb nail image on the left and a full document on the right?

We like what we see when running your groupdocs.viewer in the

http://apps.groupdocs.com/document-viewer.

That is exactly what we want. If we can do so, I am sure we are going to buy your viewer.

Thank you !

Hi Yuan,


Thanks for taking interest in GroupDocs.Viewer for .NET.

I am writing inline answers of each of your questions.

<span style=“color: rgb(76, 82, 89); font-family: “PT Sans”, Helvetica, Arial, sans-serif; font-size: 14px; background-color: rgb(221, 221, 221);”>However, nothing is displayed on the screen! Is this just a UI-less backend API? Am I doing something wrong?

Yes, GroupDocs.Viewer for .NET is a back-end document processing API that renders the supported document formats into HTML pages or images. These HTML pages or images can be viewed using some front end application such as a web application.


<span style=“color: rgb(76, 82, 89); font-family: “PT Sans”, Helvetica, Arial, sans-serif; font-size: 14px; background-color: rgb(221, 221, 221);”>Since we have not got a trial license, Is this a trial limit?

Yes, trial limitations will be applied if you use the API in trial mode. However, you can get a free temporary license (valid for 30 days) to evaluate all the features of GroupDocs.Viewer without any limitations.


<span style=“color: rgb(76, 82, 89); font-family: “PT Sans”, Helvetica, Arial, sans-serif; font-size: 14px; background-color: rgb(221, 221, 221);”>What should I do after I got a .jpg Image file?

If you are using image based rendering then each page of the source document will be rendered into an image. You can use your front end application to view these rendered .jpg images.


<p class=“MsoNormal” style=“margin: 0in 0in 0.0001pt; font-stretch: normal; font-size: 14px; line-height: 18px; font-family: “PT Sans”, Helvetica, Arial, sans-serif; color: rgb(76, 82, 89);”>Do you have a complete example I can follow so that <o:p></o:p>

<p class=“MsoNormal” style=“margin: 0in 0in 0.0001pt; font-stretch: normal; font-size: 14px; line-height: 18px; font-family: “PT Sans”, Helvetica, Arial, sans-serif; color: rgb(76, 82, 89);”>I can see a thumb nail image on the left and a full document on the right?<o:p></o:p>

<p class=“MsoNormal” style=“margin: 0in 0in 0.0001pt; font-stretch: normal; font-size: 14px; line-height: 18px; font-family: “PT Sans”, Helvetica, Arial, sans-serif; color: rgb(76, 82, 89);”><o:p style=“background-color: rgb(211, 211, 211);”>We like what we see when running your groupdocs.viewer in the </o:p>

<p class=“MsoNormal” style=“margin: 0in 0in 0.0001pt; font-stretch: normal; font-size: 14px; line-height: 18px; font-family: “PT Sans”, Helvetica, Arial, sans-serif; color: rgb(76, 82, 89);”><o:p style=“background-color: rgb(211, 211, 211);”>http://apps.groupdocs.com/document-viewer.</o:p>

<p class=“MsoNormal” style=“margin: 0in 0in 0.0001pt; font-stretch: normal; font-size: 14px; line-height: 18px; font-family: “PT Sans”, Helvetica, Arial, sans-serif; color: rgb(76, 82, 89);”><o:p style=“background-color: rgb(211, 211, 211);”>That is exactly what we want. If we can do so, I am sure we are going to buy your viewer.</o:p>


Yes. We have also developed some open source front end document viewer applications using GroupDocs.Viewer for .NET. You can download these applications and modify them as per your requirements. Listed below are the applications along with their download links.


If you will have any issues or questions, please feel free to write us back.

Warm Regards

Thank you!

I will try MVC front end first v 16.11.

Hi Yuan,

You are always welcome.

Warm Regards

Since I am not familiar with web application, I took a couple of days to check Microsoft's MVC sample code before I jumped into your sample code of ASP.net_MVC_front_end for document viewer.
I successfully built the sample code. I have to say what I see is not what we want! Your back-end API is not bad. But front-end is not what we see in your web site: http://apps.groupdocs.com/document-viewer. This demo has everything we want!!!
We like the list of files found in our system or added from our system or added by web url. Also after a file is opened, we like the thumbnail image for each page on the left and the full image on the right. We can scroll the pages. We can add files from our system and url file from web.
I have not tried other features. I assume they are OK.

Do you have the sample code behind the demo
http://apps.groupdocs.com/document-viewer? You must have it!
If yes, I think we are in business! Please send reply back to us ASAP.



Hi Yuan,


Thanks for coming back to us.

Most of the features of http://apps.groupdocs.com/document-viewer are implemented in sample ASP.NET_MVC_front_end. Thumbnails are also implemented in the same way as you mentioned above (see attachment: MVC Viewer.png). For this, you will have to add following JavaScript parameters in index.cshtml page (see attachment: params.png).

showThumbnails: true,
openThumbnails: true,


In ASP.NET_MVC_front_end, files are listed from the App_Data folder which is set as storage directory in viewer configuration. However, you can change the functionality to browse files from any directory located anywhere on the disk or from a URL. To see how to render files from URL, please visit Render Files from URL. You can also mention the other features that you are unable to find in ASP.NET_MVC_front_end.

Furthermore, the source code of http://apps.groupdocs.com/document-viewer is not available. However, if you want to integrate the same document viewer in your application then you can use GroupDocs.Viewer for Cloud services. To see documentation of GroupDocs.Viewer for Cloud, please visit this link.

In case of any further questions, please feel free to let us know.

Warm Regards

Thank you for your quick reply.

1. How to set configuration so that I can browse files from any directory in the disk?
2. I will try to integrate your document viewer with our application.
3. Is setting thumbnail to true only good for image type output?

Hi Yuan,


I am writing inline answers of your questions.

1. How to set configuration so that I can browse files from any directory in the disk?

You can change the storage directory path in ViewerController.cs by changing the value of _storagePath variable. However, if you want to browse files from anywhere on the disk then you will have to add a choose file button using open file dialog control and a small piece of code in ViewerController.cs. This feature is not implemented in the sample ASP.NET MVC front end but it is available in New Front End and you can get help from it.

3. Is setting thumbnail to true only good for image type output?

Setting thumbnail options to true work for both, HTML based rendering and image based rendering.

If you will have any other questions, please let us know.

Have a nice day.
Warm Regards


Good morning!

1. _storagePath in NewFrontEnd is:

GroupDocs.Viewer.Model.Utilities.Storage_Path = Server.MapPath("~/Uploads/");

This is the directory for uploads. It must be defined in the server.

Where and how is this configured? Is it possible for me to change it?

2. _storagePath in ASP.NET_MVC_Front_End is

private readonly string _storagePath = AppDomain.CurrentDomain.GetData("DataDirectory").ToString();

This must be from local and defined in a configuration file. I could not find it.

Not in web.config, not in global.asax.cs, not in app-data directory.

Since it is configurable, it has to be in a file. Where is it?

Hi Yuan,


Good Morning.

<p class=“MsoNormal” style=“margin: 0in 0in 0.0001pt; font-stretch: normal; font-size: 14px; line-height: 18px; font-family: “PT Sans”, Helvetica, Arial, sans-serif; color: rgb(76, 82, 89);”>1. _storagePath in NewFrontEnd is:

<p class=“MsoNormal” style=“margin: 0in 0in 0.0001pt; font-stretch: normal; font-size: 14px; line-height: 18px; font-family: “PT Sans”, Helvetica, Arial, sans-serif; color: rgb(76, 82, 89);”>GroupDocs.Viewer.Model.Utilities.Storage_Path = Server.MapPath(“~/Uploads/”);

<p class=“MsoNormal” style=“margin: 0in 0in 0.0001pt; font-stretch: normal; font-size: 14px; line-height: 18px; font-family: “PT Sans”, Helvetica, Arial, sans-serif; color: rgb(76, 82, 89);”>This is the directory for uploads. It must be defined in the server.

<p class=“MsoNormal” style=“margin: 0in 0in 0.0001pt; font-stretch: normal; font-size: 14px; line-height: 18px; font-family: “PT Sans”, Helvetica, Arial, sans-serif; color: rgb(76, 82, 89);”>Where and how is this configured? Is it possible for me to change it?


In New Front End, when you browse a file from the choose file button, the selected file is first uploaded in Uploads directory (which is set as storage directory in viewer configuration) and then the application renders the uploaded file and displays it on the screen. The storage path is configured in line# 35 of GroupDocs.Viewer.Model/Utilties.cs (see this).

<p class=“MsoNormal” style=“margin: 0in 0in 0.0001pt; font-stretch: normal; font-size: 14px; line-height: 18px; font-family: “PT Sans”, Helvetica, Arial, sans-serif; color: rgb(76, 82, 89);”>

<p class=“MsoNormal” style=“margin: 0in 0in 0.0001pt; font-stretch: normal; font-size: 14px; line-height: 18px; font-family: “PT Sans”, Helvetica, Arial, sans-serif; color: rgb(76, 82, 89);”>2. _storagePath in ASP.NET_MVC_Front_End is

<p class=“MsoNormal” style=“margin: 0in 0in 0.0001pt; font-stretch: normal; font-size: 14px; line-height: 18px; font-family: “PT Sans”, Helvetica, Arial, sans-serif; color: rgb(76, 82, 89);”>private readonly string _storagePath = AppDomain.CurrentDomain.GetData(“DataDirectory”).ToString();

<p class=“MsoNormal” style=“margin: 0in 0in 0.0001pt; font-stretch: normal; font-size: 14px; line-height: 18px; font-family: “PT Sans”, Helvetica, Arial, sans-serif; color: rgb(76, 82, 89);”>This must be from local and defined in a configuration file. I could not find it.

<p class=“MsoNormal” style=“margin: 0in 0in 0.0001pt; font-stretch: normal; font-size: 14px; line-height: 18px; font-family: “PT Sans”, Helvetica, Arial, sans-serif; color: rgb(76, 82, 89);”>Not in web.config, not in global.asax.cs, not in app-data directory.

<p class=“MsoNormal” style=“margin: 0in 0in 0.0001pt; font-stretch: normal; font-size: 14px; line-height: 18px; font-family: “PT Sans”, Helvetica, Arial, sans-serif; color: rgb(76, 82, 89);”>Since it is configurable, it has to be in a file. Where is it?


The API provide ViewerConfig class to configure the storage path and other options (for details, see this). In ASP.NET_MVC_Front_End, the storage path is configured in line# 45 of ASP.NET_MVC_Front_End/Controllers/ViewerController.cs (see this).

In case of any confusion, please do let us know.

Warm Regards

I think you did not get what I am looking for.

In viewerController.cs

#33: private readonly string _storagePath = AppDomain.CurrentDomain.GetData("DataDirectory").ToString();

This line is used to get the value for _storagePath.
Where is the configuarion file for DataDirectory? This is what I am looking for.

#45: StoragePath = _storagePath,
This line only assigns the value of _storagePath to StoragePath.
At this moment, the value is already got. This is not what I am talking about.

Hi again,


To avoid any confusions, let me describe how and why we set configuration properties before rendering the documents.

There is no external or separate configuration file to set the storage directory for the documents. Instead, GroupDocs.Viewer for .NET provides ViewerConfig class that is used to set the values i-e StoragePath, useCache etc. The API uses these configuration settings in ViewerHandlers for rendering the document into HTML pages or images. Following code snippet is used for viewer configuration:

ViewerConfig config = new ViewerConfig();

//set the storage path
config.StoragePath = Storage_Path; // you can set any path here

//set temp path
config.TempPath = Storage_Path + “\Temp”;

config.UseCache = true;

//create viewer handler using viewer configuration
ViewerImageHandler _imageHandler = new ViewerImageHandler(config);


In above code snippet, the _imageHandler will be then used to get pages of the source document in the form of images. The line config.StoragePath = Storage_Path; is used to set the storage directory in configuration settings which is set to App_Data folder in ASP.NET MVC Front End application.

Finally, in line# 33, we are assigning the storage path value to _storagePath variable. Whereas, in line# 45 we are setting the storage path in the viewer configuration.

In order to learn how the API works, we recommend you to please download and explore the Source Code Examples and its Documentation.

If you still have any issues, please write back to us.

Warm Regards

I am not familiar with asp.net configurations. Sorry about this. I guess app_data is already set as the storage directory inside the GroupDocs.viewer.dll. Normally I should not touch it.

What if I want to use app_data2 directory as my storage? Of course I can simply set it inside the viewerController.cs, such as this

private readonly string _storagePath = “c:\users\public\Uploads\”;

Or maybe this DataDirectory can be set inside web.config file?

I think I found what I need. I can use this to set its value to whatever I want and then set_storagePath in the program.

AppDomain.SetData(String, Object)

In terms of document viewer, right now we are discussing if we need the local standalone version or the cloud version.

Thanks for your help!

Hi Yuan,


Thanks for writing back to us.

App_Data is not set as default storage directory in GroupDocs.Viewer for .NET. Instead, we are using viewer configurations to set this path (as mentioned in the previous post). And yes, if you you want to set storage directory other than App_Data in ASP.NET MVC Front End then you can assign your path value to private readonly string _storagePath variable such as
private readonly string _storagePath = “c:\users\public\Uploads\”;.

Warm Regards

Are you still working at this moment?

Is your time about 3:48 AM (early morning)?

Hi Yuan,


We are always there to help you out in case of any issue. Please feel free to raise your queries anytime.

Warm Regards