Recent Posts

Pages: 1 2 [3] 4 5 ... 10
21
Ideas/Suggestions / Re: replace filename
« Last post by RTT on January 18, 2023, 04:28:20 PM »
In your screenshot the [ReplaceStr] part of the expression is not showing in blue, so your custom scripts don't have a script named ReplaceStr. Probably you forgot to rename the newly added script or mistyped the name.
22
Ideas/Suggestions / Re: replace filename
« Last post by Nick Riviera on January 18, 2023, 08:20:00 AM »
thank you for reply and  for the explanations
but,
I do not know if the function ReplaceStr does not work or I did not proceed correctly...

01_replace this_document.pdf
the result should be:
01_210x297mm_document.pdf
23
Ideas/Suggestions / Re: replace filename
« Last post by RTT on January 18, 2023, 02:29:20 AM »
Not possible while using the builtin ReplaceS function (the parameters are fixed, not parsed for dynamic content), but doable with a custom script.

With a custom script, named ReplaceStr, with this code:
Code: [Select]
function ReplaceStr() {
    var params = CurrentField.value.split(',', 3);
    if (params.length == 3) {
        return params[0].replace(params[1], params[2]);
    }
}
you can then use this syntax: [ReplaceStr](source,searchValue,newValue)
With your example: [ReplaceStr]([F],replace this,[myScript])
24
Ideas/Suggestions / replace filename
« Last post by Nick Riviera on January 17, 2023, 08:43:20 AM »
Hello,
...can I replace a string from a filename with a custom script...?

something like this:

[ReplaceS:replace this|[myScript]]([f])
25
Ideas/Suggestions / Re: Script For Shuffle (Random)
« Last post by nightslayer23 on October 13, 2022, 02:59:12 AM »
worked perfectly   ;D ;D thankyou again!
26
Ideas/Suggestions / Re: Script For Shuffle (Random)
« Last post by RTT on October 13, 2022, 01:54:28 AM »
Check if this works.
Code: [Select]
var Merger = pdfe.CreateDocumentMerger();
var ProgressBar = pdfe.ProgressBar;
ProgressBar.max = pdfe.SelectedFiles.Count;
var MainPageIndex = 0;
for (var i = 0; i < pdfe.SelectedFiles.Count; i++) {
    var File = pdfe.SelectedFiles(i);
    var Filename = File.Filename;
    pdfe.echo('Shuffling ' + Filename);
    ProgressBar.position = i + 1;
    var Pages = File.Pages;
    ShuffledIndexesArray = createShuffledIndexesArray(Pages.Count);

    for (var p = 0; p < ShuffledIndexesArray.length; p++) {
        var Page = Pages(ShuffledIndexesArray[p]);
        Merger.MergePage(Page);
    }
    var newFilename = Filename.substring(0, Filename.lastIndexOf('.')) + '_Shuffled.pdf';
    Merger.EndAndSaveTo(newFilename);
    pdfe.echo(' [OK]', 0, 1);
}
pdfe.echo('Done.');

/*https://stackoverflow.com/questions/2450954/how-to-randomize-shuffle-a-javascript-array
Randomize array in-place using Durstenfeld shuffle algorithm */
function shuffleArray(array) {
    for (var i = array.length - 1; i > 0; i--) {
        var j = Math.floor(Math.random() * (i + 1));
        var temp = array[i];
        array[i] = array[j];
        array[j] = temp;
    }
}

function createShuffledIndexesArray(N) {
    var Indexes = [];
    for (var i = 0; i < N; i++) {
        Indexes.push(i);
    }
    shuffleArray(Indexes);
    return Indexes
}
27
Ideas/Suggestions / Script For Shuffle (Random)
« Last post by nightslayer23 on October 12, 2022, 06:48:32 AM »
Hi again, would you be able to write a custom script for shuffling the PDF page order from a multipage pdf?
28
Ideas/Suggestions / Re: Stamps: Filename (without file extension)
« Last post by RTT on October 08, 2022, 01:42:36 AM »
That's not possible with the current version. Only the standard PDF fonts can be used.
29
Ideas/Suggestions / Re: Stamps: Filename (without file extension)
« Last post by nightslayer23 on October 07, 2022, 07:53:21 AM »
How can we add more font choices to the list?
30
Ideas/Suggestions / Re: Script to count how many colour pages in PDF?
« Last post by Nick Riviera on August 22, 2022, 08:36:52 AM »
Thank you.

works with this version ImageMagick-7.1.0-8-Q16-HDRI-x86-dll.exe


It seems the ActiveX ImageMagickObject is not included anymore in the installer (Windows Installer option ImageMagickObject is missing).
Get the old version installer, that includes it, from the Wayback Machine website. Don't forget to select the "Install ImageMagickObject OLE Control for VBScript,..." when installing it.
Pages: 1 2 [3] 4 5 ... 10