The second line of your code lacks an input term: if the PNG files created by the first line are in the same folder as the batch file you could try:
- Code: Select all
nconvert -dither -grey 256 -crop 42 250 945 200 -out png -xall -dpi 250 -o test-cropped test.pdf
nconvert -n 1 573 24 *.png
I would expect the folder after the batch file is run to contain both the input and output PNGs, so you might want to include a -D
term to delete the input PNDs after they have been processed...EDIT:
I'm not familiar with -n
and the above code doesn't produce the desired result, I'm not sure whether it can be used to renumber files...
Always use wildcards with caution, though, and always test with copies of files, one small step at a time...
I normally prefer to place the input files in a separate folder, and usually output to a different folder, although that does complicate the code slightly and needs care in relation to spaces in paths, for example.
An alternative approach to the original problem stated in the earlier post above might be to generate the required output file names directly when the original input file is are converted to PNGs, i.e. step counting rather than renaming the files initially created in a second operation.
One way that might be done is by creating a variable using cmd.exe ('DOS') SET that can be incremented, and then using that variable in the output term of the NConvert code to generate the required output file names directly when the code is run in a FOR loop; possibly Mixer
can suggest how that could be implemented, or suggest an alternative solution?
Another possible approach would be to perform the renaming function using a command line renaming utility such as Bulk Rename Command
and to include that operation in the batch file...