Post reply

Message icon:


shortcuts: hit alt+s to submit/post or alt+p to preview

Topic Summary

Posted by: RTT
« on: August 18, 2016, 04:38:02 PM »

Great! I'm glad you find it useful, and thank you.
Posted by: Amazed
« on: August 18, 2016, 05:42:00 AM »

All going pretty good thanks. Sent you some money and was happy to pay. Really good value and great support.
Posted by: Amazed
« on: August 18, 2016, 01:22:01 AM »

Stupid question. Under my nose, should have read harder. Yup worked out the stamp switch, thanks.

I think this is going to work great.

Posted by: RTT
« on: August 17, 2016, 11:37:30 PM »

The stamp tool GUI will be hidden by passing the -s switch in the shell.Run... script line, as in the above script, but, as explained in the user's guide, this switch doesn't work in the trial version.
The script output window visibility is defined by script, from the manager. Check the attached screenshot.
Posted by: Amazed
« on: August 17, 2016, 11:09:11 AM »

How does one hide script output window when script is running please?
Posted by: Amazed
« on: August 17, 2016, 08:42:31 AM »

Any way to get the current date into the script somehow so i can stuff it in the custom field?


Ignore. Got it, thanks.

Posted by: Amazed
« on: August 17, 2016, 12:51:00 AM »

^^ Looks like the idea. Thanks. Let me work through that.
Posted by: RTT
« on: August 16, 2016, 11:48:10 PM »

Without more details, I suppose a My Script is the right way to execute this workflow.
Use the stamp tool to create and save the stamp template you want to apply on these files. The script will apply the stamp and populate the custom field, using also a custom field to check if the PDFs are already stamped or not. This custom field may be the same (if the field exists them it was already stamped) you will use to store that specific data you talk about.

Here is a generic sample script around this idea:
Code: [Select]
var StampTemplate = "C:\\PDFStampTemplates\\Template1.stp";

var shell = pdfe.CreateObject("WScript.Shell");
var ProgressBar = pdfe.ProgressBar;

ProgressBar.max = pdfe.SelectedFiles.Count;
for (var i = 0; i < pdfe.SelectedFiles.count; i++) {
    ProgressBar.position = i + 1;
    var doc = pdfe.SelectedFiles(i);
    var filename = doc.filename;
    if (!doc.metadata['StampData']) {
        pdfe.echo('Processing ' + filename);
        shell.Run('"' + shell.ExpandEnvironmentStrings("%PROGRAMFILES%") + '\\PDF-ShellTools\\PDFShellTools.exe" stamp -s Template="' + StampTemplate + '" "' + filename + '""', 0, true);
        doc.metadata['StampData'] = 'Your specific data';
        pdfe.echo(' : done', 0, true);
    } else {
        pdfe.echo(filename + ' : already stamped');
pdfe.echo('all done');
This script expects a stamp template at C:\PDFStampTemplates\Template1.stp, and a custom field named "StampData" defined in the list of custom fields.
In this example the stamp is using static data. If your intention is to stamp dynamic data, check this other example.

If you need further help, please give me more details.
Posted by: Amazed
« on: August 16, 2016, 08:36:17 AM »

What great software. This is gonna get the job done. I can feel it. Last part.
When I stamp a document, I want to also create a custom field in that document(if it doesn't already exist) and populate that field with specific data that I determine at the time I apply the stamp.

Also, I want to able to prevent duplicate attempts to apply the same stamp on documents.

If that all makes sense? Could somebody please point me in the right direction?