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 : Monday, January 13, 2020 4:05:37 AM(UTC)
selvakumar

Groups: Registered
Posts: 9


I am using leadtools V20. I would like to know how to lazy load a multi-page document in .net core web application (HTML 5 viewer) ,to avoid performance issues.It would be helpful if I get a sample solution or please assist on the necessary steps.


Thanks in Advance.
 

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, January 13, 2020 3:11:47 PM(UTC)
Matthew Bresson

Groups: Registered, Tech Support, Administrators
Posts: 105

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

Hello Selvakumar,

For more information on the lazyLoad property in TypeScript and JavaScript, please visit the link below:
https://www.leadtools.co...thumbnails-lazyload.html

The property is a prototype in JavaScript:
Object.defineProperty(DocumentViewerThumbnails.prototype, 'lazyLoad',
get: function(),
set: function(value)
)
Typescript:
lazyLoad: boolean;

Do note that lazyLoad defaults to false, but is always on if the document is not read-only.

If you have any further questions please feel free to reach back out to us.

Thanks,
Matt Bresson
Developer Support Engineer
LEAD Technologies, Inc.
LEADTOOLS
 
#3 Posted : Tuesday, January 14, 2020 12:51:35 AM(UTC)
selvakumar

Groups: Registered
Posts: 9


Hi Mathew,
I guess the lazyLoad property which you mentioned is to lazy load the images on the document. I have a requirement to load the document by pages. Suppose if an document contains about 10 pages, do we have an option to specify first load 4 pages of the document and then go on loading the remaining pages on user interaction. Correct me if am going in wrong direction.

Thanks,
Selvakumar A
 
#4 Posted : Tuesday, January 14, 2020 3:05:34 PM(UTC)
Matthew Bresson

Groups: Registered, Tech Support, Administrators
Posts: 105

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

Hello Selvakumar,

Yes you should be able to specify which pages to load. For your use-case since the user may want to load more pages of the same document after the initial load range you are going to want to use the DocumentFactory Object.
https://www.leadtools.co...dox/documentfactory.html
This object provides support for loading LEADDocument objects into a virtual LEADDocument that you can add and remove pages. The Document Viewer has complete support for virtual documents.
https://www.leadtools.co...ls-document-library.html

Essentially you create a new empty virtual document using the create Method.
https://www.leadtools.co...umentfactory-create.html
You can then load in the document that you wish to view using the LoadFromFile, LoadFromUri, etc. Then you can add pages to the virtual document using the add or addRange methods inside the DocumentPages object.
https://www.leadtools.co...t/dox/documentpages.html
The DocumentPages object derives from the LeadCollection class, in which the add and addRange methods are inside of.
https://www.leadtools.co...collection--members.html
add Method:
https://www.leadtools.co.../leadcollection-add.html
addRange Method:
https://www.leadtools.co...collection-addrange.html

If you have any issues getting this functionality working for your use-case, please do not hesitate to let me know.

Thanks,

Edited by moderator Tuesday, September 19, 2023 1:09:53 PM(UTC)  | Reason: Updating to v22

Matt Bresson
Developer Support Engineer
LEAD Technologies, Inc.
LEADTOOLS
 
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.076 seconds.