Author Topic: Using Custom Scripts with PDFe Tools  (Read 4401 times)

0 Members and 1 Guest are viewing this topic.

Padanges

  • Newbie
  • *
  • Posts: 179
Using Custom Scripts with PDFe Tools
« 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

RTT

  • Administrator
  • *****
  • Posts: 907
Re: Using Custom Scripts with PDFe Tools
« Reply #1 on: September 06, 2016, 01:38:52 AM »
You can do it with the IDocumentMerger object.
Some practical examples in the forum.

Padanges

  • Newbie
  • *
  • Posts: 179
Re: Using Custom Scripts with PDFe Tools
« Reply #2 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?

RTT

  • Administrator
  • *****
  • Posts: 907
Re: Using Custom Scripts with PDFe Tools
« Reply #3 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');