#1
Posted
:
Tuesday, August 1, 2017 9:46:42 AM(UTC)
Groups: Registered
Posts: 6
Thanks: 4 times
Hello,
Is there any command which helps me to save my document locally?or better,is it possible to have that saveDialoge which also exists in the example?
regards
#2
Posted
:
Tuesday, August 1, 2017 2:42:18 PM(UTC)
Groups: Registered, Tech Support, Administrators
Posts: 70
Was thanked: 4 time(s) in 4 post(s)
Hello Sepideh,
Thank you for posting your question to the LEADTOOLS Technical Support Forums.
The source code for the LEADTOOLS HTML5 Document Viewer is available in it entirety. If you would like to implement the Save Dialog that is available in the demo, the source for that prompt can be found in the following sub directory of the Document Viewer Project:
\DocumentViewer\Clients\Apps\App1\site\Converter\Dialogs\SaveToDlg.js
This js file will also contain the source for how the demo handles saving to a local file, specifically:
Code:
SaveToDlg.prototype.localSaveBtn_Click = function (e) {
var url = this._convertItem.url;
var win = null;
if (lt.LTHelper.browser === lt.LTBrowser.internetExplorer) {
win = window.open("");
win.navigate(url);
}
else {
win = window.open(url);
}
if (win == null || typeof (win) == 'undefined') {
alert('A Popup Blocker may have blocked opening a new window.\nIf this is the case, disable the Popup Blocker for this page and try again.');
}
};
If you would like to implement the other save features, such as saving to SharePoint, Google Drive, or One Drive, the source for that is also available in the same javascript file.
Duncan Quirk
Developer Support Engineer
LEAD Technologies, Inc.
1 user thanked Duncan Quirk for this useful post.
#3
Posted
:
Wednesday, August 2, 2017 10:01:49 AM(UTC)
Groups: Registered
Posts: 6
Thanks: 4 times
Thank you for your reply...
My problem now is with this line:
var url = this._convertItem.url;
Actually I already have the path of file but the thing is that I save it in App_Data of my project and client can not access it....Therefor I need to know how I can use this 'this._convertItem.url'.....because I can not implement all the convertdialog and savedialog just because I want to get this url...What is the easiest way to have it..because I noticed that this url is a combination of documentId and the name of file..How I can make it without using convertdialog...
regards
#4
Posted
:
Thursday, August 3, 2017 1:14:35 PM(UTC)
Groups: Registered, Tech Support, Administrators
Posts: 70
Was thanked: 4 time(s) in 4 post(s)
The save mechanism that is in the Document Viewer demo requires the Document Conversion service in order to export the file. The Conversion Service is necessary due to how the the documents are cached. The Conversion Service will convert the cached document, and then automatically generate the URL to download the document.
However, if the document you are wanting the user to download is already located server-side, and you already know the path of the file, then you can just prompt the user to download the file directly. This would just be an AJAX call to some C# function that would initiate the download.
Duncan Quirk
Developer Support Engineer
LEAD Technologies, Inc.
1 user thanked Duncan Quirk for this useful post.
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.