| <<<Back 1 day (to 2021/01/10) | Fwd 1 day (to 2021/01/12) >>> | 20210111 |
XpressionUser | I am wanting to merge multiple PDF files into a single PDF file to batch printing. When I run this it is not working dir /B *.pdf >> files.txt | 18:32.04 |
| gswin32c -sDEVICE=pdfwrite -dBATCH -dNOPAUSE -sOutputFile=\temp\out.pdf @files.txt | 18:32.04 |
| but if I run this it does work gswin32c -sDEVICE=pdfwrite -dBATCH -dNOPAUSE -sOutputFile=\temp\out.pdf a.pdf b.pdf c.pdf | 18:32.40 |
artifexirc-bot | <RayJohnston> what is in files.txt ? | 18:33.05 |
XpressionUser | How can I merge ALL the pdf files in the directory into one PDF file? | 18:33.12 |
artifexirc-bot | <RayJohnston> have you tried: gswin32c -sDEVICE=pdfwrite -dBATCH -dNOPAUSE -sOutputFile=\temp\out.pdf *.pdf | 18:33.42 |
XpressionUser | files.txt contains the list of the pdf files in the directory i.e. dir /B *.pdf >> files.txt | 18:33.42 |
| yes it did not like the "*" | 18:34.02 |
artifexirc-bot | <RayJohnston> "it" ? | 18:34.11 |
XpressionUser | did not like the wild card | 18:34.13 |
artifexirc-bot | <RayJohnston> * is expanded by the shell -- what shell are you using ? | 18:34.36 |
XpressionUser | sorry .. i'm not understanding he question .. what shell | 18:35.07 |
| this is on a server | 18:35.20 |
| windows 2016 | 18:35.25 |
artifexirc-bot | <RayJohnston> you cannot put *.pdf into files.txt and use that with @files.txt (gs doesn't expand wildcards, but the shell should) | 18:35.28 |
XpressionUser | this was in a bat file | 18:35.52 |
artifexirc-bot | <RayJohnston> are you invoking gswin32c from 'command.com' shell or what? | 18:35.53 |
XpressionUser | from a bat command | 18:36.02 |
| what do I need to do to invoke it from a shell? | 18:36.24 |
| yes running the bat file from a command window | 18:36.46 |
artifexirc-bot | <RayJohnston> just paste the command line (without the .bat file) | 18:37.15 |
XpressionUser | I need to run this in a batch enviorment daily triggered by a control-m | 18:37.53 |
| so I need some kind of bat file the scheduler we use kicks off (we use control-m) | 18:38.45 |
| you are saying I need to run this from a shell ? and then it will work? | 18:40.05 |
artifexirc-bot | <RayJohnston> after the "dir /B *.pdf >> files.txt" add a line to print the contents, e.g.: "type files.txt" | 18:41.27 |
| <RayJohnston> just to make sure it has what you expect | 18:41.44 |
XpressionUser | yes it has the file names in it | 18:42.50 |
artifexirc-bot | <RayJohnston> you can run from a batch file, but you just have to make sure that it works. The problem may be that the PDF files aren't in the cwd | 18:43.06 |
XpressionUser | ok thanks .. will try creating a shell to run this from and see how that goes. | 18:46.05 |
artifexirc-bot | <RayJohnston> I just tried it and it works for me:dir /B *.pdf > x.list | 18:51.41 |
| <RayJohnston> type x.list | 18:51.42 |
| <RayJohnston> c:\Artifex\agit\ghostpdl\bin\gswin64c @x.list | 18:51.43 |
XpressionUser | thanks | 18:52.51 |
artifexirc-bot | <RayJohnston> Note that it did trip up when there was a space in a filename, but you should get an error mesage from that. | 18:53.12 |
XpressionUser | I think it was because I was running the bat file on the server from the user laptop | 18:53.34 |
artifexirc-bot | <RayJohnston> I just tried it and it works for me: dir /B *.pdf > x.list | 18:54.10 |
| <RayJohnston> type x.list | 18:54.10 |
| <RayJohnston> c:\Artifex\agit\ghostpdl\bin\gswin64c @x.list | 18:54.12 |
XpressionUser | Here Ghost Script is on the server so it's \\server-name\applications\gs\gwin32c.exe ... | 18:55.48 |
artifexirc-bot | <RayJohnston> yes, and the CWD when you run on the server may not be what you expect | 18:56.32 |
| <<<Back 1 day (to 2021/01/10) | Forward 1 day (to 2021/01/12)>>> | |