Blondie trying Shell Executing pdftk.exe on server to fill form using asp
Posted on 2005-04-21
I need to execute pdftk.exe command on the server using asp.
the pdftk program is going to take a .fdf file in one dir and fill a form into a template pdf file in another dir then write that filled pdf file out to a new file flattened, (Challenge Note: I have done this before using cold fusion but that execute function is disabled by the sys admins fear of configuring iuser. )
I am of course out of time due to this change of language so help me back...
Here is what i have gotten thrown together so far, can you tell me the right way to exectute this code, as I do not understand the examples I am finding online that well...
' execute the shell
' is this wscript.shell the correct one to use?
Set server_shell = Server.CreateObject("wscript.shell")
server_shell.Run "%comspec% /c c:\web\x\htdocs\cgi-bin\pdftk.exe c:\web\x\htdocs\x\pdf\template\applicationtemplate.pdf fill_form c:\web\x\htdocs\x\pdf\102.fdf output c:\web\x\htdocs\x\pdf\temp\102.pdf flatten"
'or should I use something more like
c:\web\x\htdocs\x\pdf\template\applicationtemplate.pdf fill_form c:\web\x\htdocs\x\pdf\102.fdf output c:\web\x\htdocs\x\pdf\temp\102.pdf flatten")
'what does this do for me .. server.mappath? should I be using it? could something else be messing this up permissions? what about error handling please let me know!