Recent Posts

Pages: 1 2 [3] 4 5 ... 10
21
General / Re: Displaying PDF Page Size in Windows Explorer
« Last post by chrisrace on March 16, 2023, 09:51:10 AM »
Hi - great scripts! We use a lot of PDF's (we're architects) would it be possible for this script to run automatically or create a ribbon button to run this automatically? Just wanting to make the process as simple as possible for the guys. Thanks Chris
22
Ideas/Suggestions / Re: replace filename
« Last post by Nick Riviera on January 19, 2023, 10:04:34 AM »
you're right,my mistake.. it's works..solved!Thanks!
23
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.
24
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
25
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])
26
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])
27
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!
28
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
}
29
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?
30
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.
Pages: 1 2 [3] 4 5 ... 10