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, October 16, 2018 8:19:08 AM(UTC)
Anthony Northrup

Groups: Registered, Tech Support, Administrators
Posts: 199

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

Combining documents is very straight forward using the LEADTOOLS Documents SDK. Below I've highlighted the key steps necessary for the combining process.

Since loading documents is asynchronous in JavaScript, I've opted to load all the child documents first before merging. This can be done using any of the DocumentFactory's load methods:

Once you have all the child documents loaded, you'll need to create a new virtual document using the DocumentFactory.create(CreateDocumentOptions) method:
Code:
var createOptions = new lt.Document.CreateDocumentOptions();
var mergedDocument = lt.Document.DocumentFactory.create(createOptions);

Now add the pages for each child document:
Code:
for (var i = 0; i < childDocument.pages.count; i++)
    mergedDocument.pages.add(childDocument.pages.item(i));

That's it. You can now display this merged document using our DocumentViewer, or convert it using the documents service.

Here is a sample project that includes the code above. Simply refer to the loadFromUris method within app.js:
File Attachment(s):
JS Merge.zip (356kb) downloaded 109 time(s).

Similar Post for Other Languages:
Anthony Northrup
Developer Support Engineer
LEAD Technologies, Inc.

LEAD Logo
 

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.

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-2019, Yet Another Forum.NET
This page was generated in 0.093 seconds.