Free Support Forum -

GetResourceForHtmlHandler problem



I have a problem that images in documents aren’t showing.

This is setup:
In global.asax:

I have a web api method that is generating DocumentCache:
dc.GenerateHtml(fileName, null, true, false);

And another one for previewing:
string block = Viewer.CreateScriptLoadBlock()

var groupdocsViewerScript = Viewer.ClientCode()
.UseHtmlBasedEngine(true, true)

var sb = new StringBuilder(block);

return sb.ToString();

The document is shown in control, but images inside document aren’t.
So as i can see when previewing that document , i have url:

This url is for image on first page in document.
As you can see part of the url is GetResourceForHtmlHandler and should be GetResourceForHtml. With GetResourceForHtml , it is working.

But, this GetResourceForHtmlHandler generates your control in img tag, i cannot change that.

What should I do?


Hello Novak,

We are sorry to hear that you have such issue. According on the code we can assume that you use MVC project and you have added handlers in the web.config. Please remove the handlers from the web.config, the only thing that you need to set in the web.configs is this:

Please ensure that you have such code in the <system.webServer> section.

Also please delete the “temp” folder from the root storage, clean/rebuild the solution and then try again.

Best regards.


Hi Pavel,

I removed hpptHandlers from web.config and done everything you have said,
but it’s the same.

When i’m previewing document, for example, among others, i have these two urls:

1. http://localhost/DocPreviewService/document-viewer/GetResourceForHtmlHandler?documentPath=6ebb3ac1-dda3-4ff1-85c7-383850f7deb2.pdf&resourcePath=1_0.png&relativeToOriginal=false

2. http://localhost/DocPreviewService/document-viewer/GetDocumentPageImage?path=6ebb3ac1-dda3-4ff1-85c7-383850f7deb2.pdf&width=150&quality=100&usePdf=True&useHtmlBasedEngine=True&rotate=False&locale=en-US&pageIndex=0

The second one is working good, it returns first page thumbnails.
But the first one still not working, as it have GetResourceForHtmlHandler instead of GetResourceForHtml.

Can you please suggest what to do?

Thank you.



We have checked again and we can’t reproduce your issue on our side. We don’t have second request with “GetResourceForHtmlHandler” we have only “GetResourceForHtml”. Since that please investigate our “GroupDocsViewerMVCDemo” and “ViewerConsumer” samples. The “GroupDocsViewerMVCDemo” returns Viewer code and the “ViewerConsumer” request for it and then view it. You can download them here, especially please pay attention to the web.configs and how we get Viewer code in the “ViewerConsumer”.

Best regards.

Hi ,

thank you for the examples.
Can you please show me example where your web service/web api which has two methods:
1. Upload document (and create DocumentCache)
2. Preview document (sending javascript)

I am stating that in this case you have a bug.
Bug is that you have url call to GetResourceForHtmlHandler instead of GetResourceForHtml.


Hello Novak,

I have updated MVC sample with required functional, you can download it here.

Best regards.


Hello, I am assisting Christina with this issue.

We were able to look into this today and the issue appears to be that we had HTTPHandlers for GroupDocs in our web.config. I also updated to the latest DLL. This issue is resolved.

Thanks for all of the assistance.



Thank you for the notification. glad to hear that the issue is resolved.

Best regards.