LEADTOOLS Support
Document
Document SDK Examples
HOW TO: Combine Documents in JavaScript Using a Virtual Document
#1
Posted
:
Tuesday, October 16, 2018 8:14:08 AM(UTC)
Groups: Registered, Tech Support, Administrators
Posts: 199
Was thanked: 28 time(s) in 28 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:
Similar Post for Other Languages:Anthony Northrup
Developer Support Engineer
LEAD Technologies, Inc.
1 user thanked Anthony Northrup for this useful post.
LEADTOOLS Support
Document
Document SDK Examples
HOW TO: Combine Documents in JavaScript Using a Virtual Document
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.