Author Topic: Flatten PDF stamps  (Read 39879 times)

0 Members and 1 Guest are viewing this topic.

RTT

  • Administrator
  • *****
  • Posts: 918
Re: Flatten PDF stamps
« Reply #15 on: September 08, 2008, 11:52:19 PM »
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.

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: [Select]
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%

LukeV

  • Newbie
  • *
  • Posts: 30
Re: Flatten PDF stamps
« Reply #16 on: September 10, 2008, 02:09:10 AM »
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

  • Administrator
  • *****
  • Posts: 918
Re: Flatten PDF stamps
« Reply #17 on: September 10, 2008, 03:22:31 AM »
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: [Select]
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%

LukeV

  • Newbie
  • *
  • Posts: 30
Re: Flatten PDF stamps
« Reply #18 on: September 10, 2008, 07:34:27 AM »
Nice work  ;)
Works great now :)