Author Topic: More dynamic merge tool  (Read 8041 times)

0 Members and 1 Guest are viewing this topic.

nightslayer23

  • Newbie
  • *
  • Posts: 94
More dynamic merge tool
« on: March 13, 2020, 02:20:55 AM »
I have spoken on here a little bit before about a solution for variable data merging and you pointed me to use the "duplicate" button in the merge window. that helped! but is quite a manual process when you need to duplicate one artwork 40 times and then the next one 20 times etc...

If the merge tool had an extra column whereby you could input a number of copies for that artwork in the merge, it would be huge!


RTT

  • Administrator
  • *****
  • Posts: 907
Re: More dynamic merge tool
« Reply #1 on: March 15, 2020, 03:58:10 PM »
That's a good idea! Keep the current duplicate entry functionality, for when there is the need to specify a different page selector, and add a number of copies for each of the entries, for when we just want to repeat the specific entry multiple times.
Now in the TODO list.

nightslayer23

  • Newbie
  • *
  • Posts: 94
Re: More dynamic merge tool
« Reply #2 on: March 30, 2020, 04:23:38 AM »
 ;D awesome! let me know if you get to this!

no other program out there that can do this.

nightslayer23

  • Newbie
  • *
  • Posts: 94
Re: More dynamic merge tool
« Reply #3 on: May 14, 2020, 01:03:01 AM »
Hi again! will this be in he next update do you think?

RTT

  • Administrator
  • *****
  • Posts: 907
Re: More dynamic merge tool
« Reply #4 on: May 14, 2020, 08:32:35 PM »
Yes. It's already implemented and working around here.

nightslayer23

  • Newbie
  • *
  • Posts: 94
Re: More dynamic merge tool
« Reply #5 on: May 15, 2020, 06:31:57 AM »
Yes. It's already implemented and working around here.

oh awesome! can't wait til its released   ;D

nightslayer23

  • Newbie
  • *
  • Posts: 94
Re: More dynamic merge tool
« Reply #6 on: May 22, 2020, 02:40:54 AM »
do we have a time frame for when the latest version will be released?

RTT

  • Administrator
  • *****
  • Posts: 907
Re: More dynamic merge tool
« Reply #7 on: May 23, 2020, 01:06:02 AM »
I hope it will be soon, but don't know yet.
Meanwhile, a script can be used to provide this "copies" functionality. How exactly will you be using it?

nightslayer23

  • Newbie
  • *
  • Posts: 94
Re: More dynamic merge tool
« Reply #8 on: June 26, 2020, 01:49:26 AM »
Same as explained above, when you go to combine, window pops up that allows you to add number of copies per file. variable data and variable copies for each

RTT

  • Administrator
  • *****
  • Posts: 907
Re: More dynamic merge tool
« Reply #9 on: June 30, 2020, 01:43:22 AM »
Try this script:
Code: [Select]
var options = {
    params: []
};

for (var i = 0; i < pdfe.SelectedFiles.Count; i++) {
    var Filename = pdfe.SelectedFiles(i).Filename;
    var fileOpt = {
        type: 'edit',
        name: i,
        label: 'Copies of ' + Filename,
        def: 1
    };
    options.params.push(fileOpt);
}

try {
    options = JSON.parse(pdfe.DialogBox(JSON.stringify(options)));
    if (options.Canceled) {
        pdfe.echo('canceled');
        pdfe.quit();
    }
} catch (err) {
    pdfe.quit();
}

var Merger = pdfe.CreateDocumentMerger();
var ProgressBar = pdfe.ProgressBar;
ProgressBar.max = pdfe.SelectedFiles.Count;

for (var i = 0; i < pdfe.SelectedFiles.Count; i++) {
    var File = pdfe.SelectedFiles(i);
    var Filename = File.Filename;
    pdfe.echo(Filename);
    ProgressBar.position = i + 1;
    var copies = parseInt(options[i]) || 1;
    for (var n = 0; n < copies; n++)
    Merger.MergeDocument(Filename);
}

var dialog = pdfe.SaveDialog;
dialog.DefaultExt = '.pdf';
dialog.filter = 'PDF documents (*.pdf)|*.pdf';
dialog.Options = '[ofOverwritePrompt]';
dialog.Filename = Filename.substring(0, Filename.lastIndexOf('.')) + '_merged.pdf';
if (dialog.execute) {
    Merger.EndAndSaveTo(dialog.Filename);
    pdfe.echo('Done.');
}

nightslayer23

  • Newbie
  • *
  • Posts: 94
Re: More dynamic merge tool
« Reply #10 on: July 27, 2020, 09:02:53 AM »
this didn't quite work.. :-\

it just combined and prompted for a directory to save to

RTT

  • Administrator
  • *****
  • Posts: 907
Re: More dynamic merge tool
« Reply #11 on: July 28, 2020, 01:22:34 AM »
You probably have set the "Hide output window" option for the script? That will suppress the dialog that is asking for the number of copies.

nightslayer23

  • Newbie
  • *
  • Posts: 94
Re: More dynamic merge tool
« Reply #12 on: August 07, 2020, 07:58:46 AM »
nope, it shows, just doesn't give me an option to enter an amount of copies.

nightslayer23

  • Newbie
  • *
  • Posts: 94
Re: More dynamic merge tool
« Reply #13 on: August 11, 2020, 02:37:56 AM »
note: it works in the debugger! when you go to settings, but it doesn't work from the context menu. cheers

RTT

  • Administrator
  • *****
  • Posts: 907
Re: More dynamic merge tool
« Reply #14 on: August 12, 2020, 01:12:06 AM »
No idea then. It's working fine here in various Windows versions.
You can run the script from the script editor/debugger, when launching from the shell context menu, by pressing the CTRL key when invoking the script.