PDF-ShellTools > General

Flatten PDF stamps

<< < (4/4)

RTT:

--- Quote from: LukeV ---P.S I also modified the script to allow me to specify which pages will be stamped, without having to modify the CMD file. I just add "" to the end of the target field to print all the pages, or "1" to print the first page, etc.
--- End quote ---

Nice ;). You can extend your idea and ask for the stamp rule everytime that batch runs. Just press enter to use the default (1-) one.

--- Code: ---Echo@ off
     set s=%1
     SHIFT
     set v=%1
     SHIFT
:NEXT
     IF (%1)==() GOTO STAMPIT
     set v=%v%;%1
     SHIFT
GOTO NEXT
:STAMPIT
    SET /P q=Stamp rule [1-] =
    IF (%q%)==() set q=1-
    call rundll32 "C:\Program Files\PDF-ShellTools\PDFShellTools.dll",Stamp %s% stamprules=%q% %v%

--- End code ---

LukeV:
Ahhh that is even easier.
The only thing is, if you want to stamp several pages you need to put double quotation marks around the pages (I imagine this is due to the comma's interferring with the programming). Eg. to print pages 1,6 and 8 you need to enter into the CMD box "1,6,8". Is there any way to add the " " marks into the programing so you only have to add the page numbers into the command box?
I tried working out how to do this, but to no success.

LukeV

RTT:
Hmmm, good point...
Can be easily fixed in the batch code.
Just double quote the entire stamprules parameter and double quote the input variable in the empty rule check IF line or the wrong IF syntax will stop the batch.


--- Code: ---Echo@ off
     set s=%1
     SHIFT
     set v=%1
     SHIFT
:NEXT
     IF (%1)==() GOTO STAMPIT
     set v=%v%;%1
     SHIFT
GOTO NEXT
:STAMPIT
    SET /P q=Stamp rule [1-] =
    IF "%q%"=="" set q=1-
    call rundll32 "C:\Program Files\PDF-ShellTools\PDFShellTools.dll",Stamp %s% stamprules=%q% %v%

--- End code ---

LukeV:
Nice work  ;)
Works great now :)

Navigation

[0] Message Index

[*] Previous page

Go to full version