Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, August 1, 2017 9:46:42 AM(UTC)

sepideh  
sepideh

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
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, August 1, 2017 2:42:18 PM(UTC)
Duncan Quirk

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.

LEAD Logo
thanks 1 user thanked Duncan Quirk for this useful post.
sepideh on 8/2/2017(UTC)
 
#3 Posted : Wednesday, August 2, 2017 10:01:49 AM(UTC)

sepideh  
sepideh

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)
Duncan Quirk

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.

LEAD Logo
thanks 1 user thanked Duncan Quirk for this useful post.
sepideh on 8/4/2017(UTC)
 
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.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.071 seconds.