I am trying to preload the viewer for performance reasons and then load a file in the viewer with javascript. We have to stream the files to the viewer. We are using 2.19 (.NET), not planning on going to 3.0 just yet. The viewer is loaded in an iFrame.
On the iFrame we have the following code to preload the viewer when the iFrame is loaded.
In the iFrame page with the viewer I have a javascript function that I am trying to use to load the file in the viewer dynamically. The function calls the url @Url.Action(“GetDocument”, “DV”) which returns a filestream.
function LoadDocument(DocumentId) {
$.ajax({
type: “GET”,
url: ‘@Url.Action(“GetDocument”, “DV”)’,
data: “Id=” + DocumentId,
success: function (encFilePath) {
console.log(encFilePath);
var localizedStrings = null,
thumbsImageBase64Encoded = null;
$(’#DV’).groupdocsViewer({
filePath: encFilePath,
quality: 100,
showThumbnails: true,
openThumbnails: true,
initialZoom: 100,
zoomToFitWidth: true,
zoomToFitHeight: false,
width: 1000,
height: 650,
backgroundColor: ‘’,
showFolderBrowser: false,
showPrint: true,
showDownload: true,
showZoom: true,
showPaging: true,
showViewerStyleControl: true,
showSearch: true,
preloadPagesCount: 0,
viewerStyle: 1,
supportTextSelection: true,
usePdfPrinting: false,
localizedStrings: localizedStrings,
thumbsImageBase64Encoded: thumbsImageBase64Encoded,
toolbarButtonsBoxShadowStyle: ‘’,
toolbarButtonsBoxShadowHoverStyle: ‘’,
thumbnailsContainerBackgroundColor: ‘’,
thumbnailsContainerBorderRightColor: ‘’,
toolbarBorderBottomColor: ‘’,
toolbarInputFieldBorderColor: ‘’,
toolbarButtonBorderColor: ‘’,
toolbarButtonBorderHoverColor: ‘’,
thumbnailsContainerWidth: 0,
jqueryFileDownloadCookieName: ‘jqueryFileDownloadJSForGD’,
showDownloadErrorsInPopup: false,
showImageWidth: false,
showHeader: true,
minimumImageWidth: 0,
enableStandardErrorHandling: true,
useHtmlBasedEngine: false,
useImageBasedPrinting: true,
fileDisplayName: ‘’,
downloadPdfFile: false,
searchForSeparateWords: false,
preventTouchEventsBubbling: false,
useInnerThumbnails: true,
watermarkText: ‘’,
watermarkColor: ‘’,
supportPageReordering: false,
onlyShrinkLargePages: true,
searchHighlightColor: ‘’,
currentSearchHighlightColor: ‘’,
treatPhrasesInDoubleQuotesAsExactPhrases: false,
usePngImagesForHtmlBasedEngine: false,
showOnePageInRow: false,
loadAllPagesOnSearch: false,
useEmScaling: false
});
}
});
}
This javascript call seems to use a filepath and not a stream. Is there anyway to accomplish this with a stream? Thanks.