We are using groupdocs viewer 2.10.0. I get the following message when trying to load a document from an external website Local it works fine
Hello Divand,
this is the code for the webservice. anf then the local code. It works with the local code. I cannot Upload the whole project.
Hello Divand,
| <html xmlns="http://www.w3.org/1999/xhtml"> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <head id="HeadControl"> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <script type='text/javascript' src=`http://localhost/ImageViewer/document-viewer/GetScriptHandler?name=libs/jquery-1.9.1.min.js`><script type='text/javascript' src=`http://localhost/ImageViewer/document-viewer/GetScriptHandler?name=libs/jquery-ui-1.10.3.min.js`><script type='text/javascript' src=`http://localhost/ImageViewer/document-viewer/GetScriptHandler?name=libs/knockout-3.2.0.js`<script type='text/javascript' src=`http://localhost/ImageViewer/document-viewer/GetScriptHandler?name=libs/turn.min.js`<script type='text/javascript' src=`http://localhost/ImageViewer/document-viewer/GetScriptHandler?name=libs/modernizr.2.6.2.Transform2d.min.js`<script type='text/javascript'>if (!window.Modernizr.csstransforms) $.ajax({url: `http://localhost/ImageViewer/document-viewer/GetScriptHandler?name=libs/turn.html4.min.js`, dataType: 'script', type: 'GET', async: false});<script type='text/javascript' src=`http://localhost/ImageViewer/document-viewer/GetScriptHandler?name=installableViewer.min.js`><script type='text/javascript'>$.ui.groupdocsViewer.prototype.applicationPath = 'http://localhost/ImageViewer/';<script type='text/javascript'>$.ui.groupdocsViewer.prototype.useHttpHandlers = true;<script type='text/javascript' src=`http://localhost/ImageViewer/document-viewer/GetScriptHandler?name=GroupdocsViewer.all.min.js`<link rel='stylesheet' type='text/css' href=`http://localhost/ImageViewer/document-viewer/CSS/GetCssHandler?name=bootstrap.css` /><link rel='stylesheet' type='text/css' href=`http://localhost/ImageViewer/document-viewer/CSS/GetCssHandler?name=GroupdocsViewer.all.min.css`<link rel='stylesheet' type='text/css' href=`http://localhost/ImageViewer/document-viewer/CSS/GetCssHandler?name=jquery-ui-1.10.3.dialog.min.css` /> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <body id="BodyControl"> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div id="#test" style="width:600px;height:400px;position:relative"> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <script type="text/javascript"> $(function () { var localizedStrings = null;var thumbsImageBase64Encoded = null;$('#test').groupdocsViewer({ localizedStrings: localizedStrings, thumbsImageBase64Encoded: thumbsImageBase64Encoded, filePath: 'temp\\S\\XMBF3LS22.msg',quality: 100,showThumbnails: true,openThumbnails: false,initialZoom: 100,zoomToFitWidth: false,onlyShrinkLargePages: false,zoomToFitHeight: true,width: 0,height: 0,backgroundColor: 'red',showFolderBrowser: false,showPrint: true,showDownload: true,showZoom: true,showPaging: true,showViewerStyleControl: true,showSearch: true,preloadPagesCount: null,preloadPagesOnBrowserSide: false,convertWordDocumentsCompletely: false,viewerStyle: 1,supportTextSelection: true,usePdfPrinting: false,toolbarButtonsBoxShadowStyle: null,toolbarButtonsBoxShadowHoverStyle: null,thumbnailsContainerBackgroundColor: null,thumbnailsContainerBorderRightColor: null,toolbarBorderBottomColor: null,toolbarInputFieldBorderColor: null,toolbarButtonBorderColor: null,toolbarButtonBorderHoverColor: null,thumbnailsContainerWidth: 0,jqueryFileDownloadCookieName: 'jqueryFileDownloadJSForGD',showDownloadErrorsInPopup: false,showImageWidth: false,showHeader: true,minimumImageWidth: 0,enableStandardErrorHandling: true,useHtmlBasedEngine: false,useHtmlThumbnails: false,useImageBasedPrinting: true,fileDisplayName: 'XMBF3LS22.msg',downloadPdfFile: false,searchForSeparateWords: false,preventTouchEventsBubbling: false,useInnerThumbnails: false,watermarkText: null,watermarkColor: null,watermarkPosition: 'Diagonal',watermarkFontSize: 0,printWithWatermark: false,supportPageReordering: false,searchHighlightColor: null,currentSearchHighlightColor: null,treatPhrasesInDoubleQuotesAsExactPhrases: false,usePngImagesForHtmlBasedEngine: false,showOnePageInRow: false,loadAllPagesOnSearch: false,useEmScaling: false,ignoreDocumentAbsence: false,supportPageRotation: false,useRtl: false,useAccentInsensitiveSearch: false,useVirtualScrolling: false,supportListOfContentControls: false,supportListOfBookmarks: false,embedImagesIntoHtmlForWordFiles: false}); }); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This is the webconfig handlers |
<?xml version="1.0"?> | And this is the global file |
protected void Application_Start(object sender, EventArgs e) | { | Viewer.SetLicensePath(Server.MapPath("~/GroupDocs.Viewer.for.NET.lic")); | Viewer.SetRootStoragePath(@"C:\ViewerStorage"); | Viewer.EnableFileListRequestHandling(true); | } Any help would be appreciated the viwer does not display the stream |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Hello,
Good day
Hello Divan,
I appreciate all your patience with me
Hi again,
Just to clarify few things.
In the project we can see the WebService provider which returns Viewer code on ajax (or some other) request from the another project. Also we see the default web.page with functional which made <a href="http://prntscr.com/7fcbm9">request</a> to one more project to get the document stream and then show the document in the Viewer. Since that we need to know the logic of the project ( your use case) - does <a href="http://prntscr.com/7fca5x">this project</a> is used only to store the documents and return Viewer code to another project which will show the Viewer? If yes we need to know the appointment of a functional from the default.aspx.cs
Thank you.
Yes the Webservice that return Viewer code to an external Page on ajax is the Part that doesnt work… We use the default Page for a local viewer and that does work.
Is there something seriously wrong.?
Hello Divend,
Thank you will it work if I uncomment my code ?
Hi,
Thank you for all the hard work but it still doesnt work if I uncomment the code in the WebServiceProviderViewer and use that it never loads the document just displays the viewer
Thank you fro all your hard work but the webservice is not working
Good day
[ArgumentException: Illegal characters in path.]
Groupdocs.Web.UI.Handlers.BaseHandler.OnException(Exception exception, HttpContext context) +643
Groupdocs.Web.UI.Handlers.ViewDocumentHandler.ProcessRequest(HttpContext context) +3603
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +341
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Kind regards
Divan
Hi,
In the commented code (code line 172) we can see that you use Filepath (screenshot). Remove this code line since you use stream.
Also we can see that you are trying to get the file content – it’s the wrong way; you should simply get a file stream as in:
FileStream fileStream = new FileStream(fullFilename, FileMode.Open);
And your logic should be next:
- Get list of files from the root storage
- Check if there is more than 1 file
- If yes – create a list of streams and use
.Streamsfrom the Viewer widget - If no – get stream of one file and use
.Streamfrom the Viewer widget
- If yes – create a list of streams and use
- Generate appropriate Viewer widget code
For more info about how to work with the stream in the Viewer, please check this documentation.
Thank you.
Thank you I will use your advice and try to get it working