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, April 6, 2017 1:10:39 PM(UTC)

Nick  
Nick

Groups: Registered, Tech Support, Administrators
Posts: 161

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

Multiple input documents can be consolidated into a single PDF by using a LEADTOOLS virtual document. This can be useful when needing to assemble input documents from multiple sources and formats. Once these virtual documents are created, they exist in memory opposed to needing to be generated as a temporary file on disk. This alleviates the overhead of monitoring the temporary file and discarding it when no longer necessary.

Once assembled, the virtual documents can either be written to a file on disk using the Document Writer, displayed in a viewer, or both. This code snippet shows how to create a virtual document and add several pages to it.

Code:

using (LEADDocument document = DocumentFactory.Create(createOptions)) 
{ 
    document.Name = "Virtual"; 
    LoadDocumentOptions loadOptions = new LoadDocumentOptions(); 
    loadOptions.Cache = cache; 
    LEADDocument childDocument = DocumentFactory.LoadFromFile(Path.Combine(ImagesPath.Path, "Leadtools.pdf"), loadOptions); 

    document.Pages.Add(childDocument.Pages[0]); 
    document.Pages.Add(childDocument.Pages[1]);    	
}


For more information on this feature and more in-depth example code, see our documentation page on DocumentFactory.Create()
https://www.leadtools.com/help/sdk/dh/dox/documentfactory-create(createdocumentoptions).html

In addition, we have an online demo which showcases this new functionality.
https://demo.leadtools.com/JavaScript/DocumentComposer

This provides a drag-and-drop UI where images and documents are loaded from multiple sources. The individual pages from each of these can be dragged into the virtual document, rearranged as necessary, then saved to disk as a new file. Here are a few screenshots of the demo in action.

blank.png
File Attachment(s):
pages.png (1,040kb) downloaded 657 time(s).

Edited by moderator Wednesday, December 27, 2023 3:47:33 PM(UTC)  | Reason: Updated links

Nick Crook
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-2024, Yet Another Forum.NET
This page was generated in 0.047 seconds.