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 : Thursday, October 4, 2018 4:48:04 AM(UTC)
Vicki2018

Groups: Registered
Posts: 29

Thanks: 3 times

After I download a file, I want to save it (blob or filestream) to cache similar to savetocache.
How can I do it without a viewer control?
 

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 : Monday, October 8, 2018 12:52:20 PM(UTC)
Anthony Northrup

Groups: Registered, Tech Support, Administrators
Posts: 199

Was thanked: 28 time(s) in 28 post(s)

Hello,

Apologies for taking so long to get back to you. Could you elaborate on what you mean by "After I download a file"? Is this with regards to our HTML5 Document SDK or our .NET Document SDK? Any/all of the Document SDK (both HTML5 and .NET) functionality can be achieved without the use of the Document Viewer control. Generally this involves using commands from the DocumentFactory, or the LEADDocument its self.

Thanks,
Anthony Northrup
Developer Support Engineer
LEAD Technologies, Inc.

LEAD Logo
 
#3 Posted : Tuesday, October 9, 2018 5:00:27 AM(UTC)
Vicki2018

Groups: Registered
Posts: 29

Thanks: 3 times

HTML5Demos.DriveHelper.LTSharePoint.SharePointService.downloadFile(tempProperties, "file.pdf")
.done(function (base64) {
var data = lt.LTHelper.base64DecodeToByteArray(base64);
var byteArray = new Uint8Array(data);
var file = new HTML5Demos.DriveHelper.DriveFile(fileName[0]);
file.fileBlob = new Blob([byteArray]);
var args = new HTML5Demos.Dialogs.OpenFromDocumentStorageEventArgs();
args.documentFile = file;
args.loadEmbeddedAnnotations = false;
args.annotationsFile = null;
})


After I get the file into OpenFromDocumentStorageEventArgs, is it possible for to savetocache immediately?
Without the following commands?

_this.documentViewer.setDocument(document);
_documentId = document.documentId;

_this.documentViewer.prepareToSave();
var doc = _this.documentViewer.document;

lt.Document.DocumentFactory.saveToCache(doc)
.done(function () {
console.log('Document saved to cache with DocumentID: ' + _documentId);
})
.fail(function (jqXHR, statusText, errorThrown) {
alert("Document Viewer Error - See console for details.");
});
 
#4 Posted : Tuesday, October 9, 2018 8:01:14 AM(UTC)
Anthony Northrup

Groups: Registered, Tech Support, Administrators
Posts: 199

Was thanked: 28 time(s) in 28 post(s)

Hello,

Unfortunately I believe you would have to upload the file, then save that to the cache (though the upload process will theoretically be uploading to the cache already). If you refer to Main.File.ts in our App1 project, you'll find the openFromDocumentStorageMenuItem_Click method (line 188 in the TypeScript file). It shows the data being handled using the following logic:


Once you have the document either by loadFromUri or uploadFile, you can simply call DocumentFactory.saveToCache on that document:
https://www.leadtools.com/help/leadtools/v20/dh/javascript/dox/documentfactory-savetocache.html

Note: None of the commands above require the DocumentViewer, as requested, only the DocumentFactory:
https://www.leadtools.com/help/leadtools/v20/dh/javascript/dox/documentfactory.html

Thanks,
Anthony Northrup
Developer Support Engineer
LEAD Technologies, Inc.

LEAD Logo
 
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.072 seconds.