RTTSoftware Support Forum

PDF Explorer => General => Topic started by: Padanges on September 05, 2016, 08:55:20 AM

Title: Using Custom Scripts with PDFe Tools
Post by: Padanges on September 05, 2016, 08:55:20 AM
Hi,
can we call Extract/Merge Tools in custom scripts with predefined parameters (i.e., requiring no user input dialogs)? For example, I want a custom script which would take selected file entries and extract specific pages from them all, then combine all the pages into one single document. How can I do that using custom scripts?


Thanks in advance
Title: Re: Using Custom Scripts with PDFe Tools
Post by: RTT on September 06, 2016, 01:38:52 AM
You can do it with the IDocumentMerger object (http://www.rttsoftware.com/Manuals/Index.htm?pageURL=PDFE/English/MyScriptsAPI.htm#IDocumentMerger).
Some practical examples (http://www.rttsoftware.com/forum/index.php?action=search2;params=eJwtzL0OwjAMBOB3YWHx0PArZlh5hih1ThSUxsh1i5Dy8CSo291n60JcQmbEsi1d2ZReW9rRnk50oCOd6UKuI-fqbRrk41nGd4KhfjWa-xfYvOT0XUXUalIk_IdX8vGplSMmboKgPNR-VQTDTXgeke0OfUB_zMA2Ig..) in the forum.
Title: Re: Using Custom Scripts with PDFe Tools
Post by: Padanges on September 06, 2016, 10:47:36 PM
Thanks, that will help. But how do I extract pages? Is there some sort of IDocumentExtractor object?
Title: Re: Using Custom Scripts with PDFe Tools
Post by: RTT on September 07, 2016, 12:30:16 AM
You don't need to extract the page in order to merge it into a new document.
Code: [Select]
var Merger = pdfe.CreateDocumentMerger();

Merger.MergeDocument(pdfe.SelectedFiles(0).Filename,'1,5-2');
Merger.MergeDocument(pdfe.SelectedFiles(1).Filename,'5');

var page=pdfe.SelectedFiles(2).pages(5);
Merger.MergePage(page);

Merger.EndAndSaveTo('C:\\PDFs\\MyPagesSelection.pdf');