PDF-ShellTools > General

Flatten PDF stamps

<< < (3/4) > >>

RTT:

--- Quote from: LukeV ---I've managed to get the first code you posted working with a single file. So I right click, select "send to -stamp" and it pops up the GUI and I can stamp the file.
When I try selecting 2 PDFs, right click and select "send to- stamp" the GUI comes up but when I press stamp, I get the following RunDLL32 error:
"Access violation at address 00BBE3F4 in module "PDFShellTools.dll. Read of address 00000024."
--- End quote ---
Make sure the number of files in the files to stamp list (Files tab) matches the number you have submitted. If not, don't run it or you get that error.
The problem is related to some bad file list passed from the command line, and weak code (now fixed) unable to deal with that.
Why the file list is wrong, I don't know. Check if files submitted don't have comma or semicolon characters on it's names.
You can inspect the file list command line passed inserting next two lines


--- Code: ---Echo %v%
pause

--- End code ---

before the :STAMPIP label line.


--- Quote from: LukeV ---I haven't been able to get the second code working. I've created the cmd file with the code as above, and created a shortcut with the C:\stamps\Test.cmd "C:\stamps\ps.stp" in the target box. When I use it though, it doesn't start the GUI, similar to when I tried pointing the first script to a stp file with a space in it's name.
--- End quote ---

Sorry, my mistake. The double quotes in the path to the stamp template are the cause.
To fix it, and also add support for templates with spaces in name/path, set target box as C:\stamps\Test.cmd "Template=C:\stamps\ps.stp" (double quotes are now needed)
and use next improved batch code.

--- Code: ---@ECHO OFF
     set s=%1
     SHIFT
     set v=%1
     SHIFT
:NEXT
     IF (%1)==() GOTO STAMPIT
     set v=%v%;%1
     SHIFT
GOTO NEXT
:STAMPIT
call rundll32 "C:\Program Files\PDF-ShellTools\PDFShellTools.dll",Stamp %s% stamprules=1- %v%

--- End code ---

LukeV:
OK. So I updated to the new code in the cmd file.
I also added the echo command (and deleted the echo off command at start). This is the output. It still won't show both files in StampIt. Maybe you can see something wrong with my output? Oh, 2.PDF is the file that shows up in the file list. EDIT - Actually the file that loads up is different every time.


C:\stamps>set s="Template=C:\stamps\ps.stp"

C:\stamps>SHIFT

C:\stamps>set v=C:\temp1\1.pdf

C:\stamps>SHIFT

C:\stamps>IF (C:\temp1\2.pdf) == () GOTO STAMPIT

C:\stamps>set v=C:\temp1\1.pdf ;C:\temp1\2.pdf

C:\stamps>SHIFT

C:\stamps>GOTO NEXT

C:\stamps>IF () == () GOTO STAMPIT

C:\stamps>call rundll32 "C:\Program Files\PDF-ShellTools\PDFShellTools.dll",Stamp
 "Template=C:\stamps\ps.stp" stamprules=1- C:\temp1\1.pdf ;C:\temp1\2.pdf

LukeV:
OK. So I worked out the problem. There is a space between the first file extension and the semi-colon. If I put the file names in manually without the space it works.
Only problem is I don't know what is putting the space in there, so I may need your help.


Thanks,

Luke

RTT:
I only see one possibility, you have a space after set v=%1_
Make sure the end of line is just after the 1.

LukeV:
Hehehe....I should have worked that out  ::)
I think when you copy and paste scripts from IE it adds a space after every line.

All working now :)

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.

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

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version