Hi,
I have a problem that images in documents aren’t showing.
This is setup:
In global.asax:
Groupdocs.Web.UI.Viewer.InitRoutes();
Groupdocs.Web.UI.Viewer.SetRootStoragePath(Server.MapPath(ConfigurationManager.AppSettings[“document_root_storage_path”]));
Groupdocs.Web.UI.Viewer.SetLicensePath(Server.MapPath(ConfigurationManager.AppSettings[“document_groupdocs_licence_path”]));
Groupdocs.Web.UI.Viewer.EnableFileListRequestHandling(true);
Groupdocs.Web.UI.Viewer.EnableDownloadRequestHandling(true);
Groupdocs.Web.UI.Viewer.ShowExceptionDetailsOnClient(true);
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()
.LoadJquery(true)
.LoadJqueryUi(true)
.LoadKnockoutJs(true)
.UseHttpHandlers(false)
.ToString();
var groupdocsViewerScript = Viewer.ClientCode()
.TargetElementSelector("
#viewer
") .FilePath(filename)
.UseHtmlBasedEngine(true, true)
.ZoomToFitWidth()
.Height(850)
.ShowHeader()
.ShowSearch()
.SearchForSeparateWords()
.SupportTextSelection()
.DownloadPdfFileIfPossible(false)
.ShowViewerStyleControl(false)
.Layout(ViewerMode.OnePageInRow)
.ShowPaging()
.UseInnerThumbnails()
.ShowThumbnails()
.OpenThumbnails()
.ShowDownload()
.LoadAllPagesOnSearch()
.ShowFolderBrowser(false)
.PreloadPagesCount(1)
.UseVirtualScrolling(false).ToString();
var sb = new StringBuilder(block);
sb.Append(groupdocsViewerScript);
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:
http://server/document-viewer/GetResourceForHtmlHandler?documentPath=cdc172a2-d868-4e14-aa50-7b2fb77fcf02.pdf&resourcePath=1_0.png
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?