Free Support Forum - groupdocs.com

How can I CroupDocs.Viewer window to view the document in the browser?


#1

When I click a link or a picture of one ducument,how can I open the CroupDocs.Viewer window to view the document?


#2

Hello,


Thank you for your request. Yes you can create such functionality. To do that you should follow next logic:

1 Transfer document link to the GroupDocs.Viewer widget

2 Use link as data for parameter “file” of the request URL.


For example:

<a id="view" onClick=”show(url)”>Click me to view

<script type="text/javascript">

Function show(url) {

var localizedStrings = null;

var thumbsImageBase64Encoded = null;

$('#test').groupdocsViewer({

filePath: url,

docViewerId: 'doc_viewer1',

quality: 100,

showThumbnails: ${showThumbnails},

openThumbnails: ${openThumbnails},

initialZoom: 100,

zoomToFitWidth: true,

zoomToFitHeight: false,

width: ${width},

height: ${height},

backgroundColor: '',

showFolderBrowser: ${showFolderBrowser},

showPrint: ${showPrint},

showDownload: ${showDownload},

showZoom: ${showZoom},

showPaging: ${showPaging},

showViewerStyleControl: true,

showSearch: ${showSearch},

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: true,

showImageWidth: false,

showHeader: ${showHeader},

minimumImageWidth: 0,

enableStandardErrorHandling: true

});

}

Please note that the url should be a direct URL for the document.

If you will have more questions please feel free to contact us.