PDF Explorer > General

Using Custom Scripts with PDFe Tools

(1/1)

Padanges:
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

RTT:
You can do it with the IDocumentMerger object.
Some practical examples in the forum.

Padanges:
Thanks, that will help. But how do I extract pages? Is there some sort of IDocumentExtractor object?

RTT:
You don't need to extract the page in order to merge it into a new document.

--- Code: ---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');

--- End code ---

Navigation

[0] Message Index

Reply

Go to full version