Page 1 of 1
using wildcards in command line
Posted: 2007-01-08T15:32:45-07:00
by Arlene
I am trying to use the following command line:
convert -resample 300x300 -scale 250x -crop 250x350 *.* *.pdf
and the system doesn't seem to like the wildcard syntax ... any suggestions?
Posted: 2007-01-08T18:07:54-07:00
by anthony
What system. Unide UNIX the '*' are often expanded by the command line shell, under DOS the program itself has to to the expandsion. Both UNIX and Windows IM can do the expandsion, but may require quotes to prevent the command line shell expanding the wildcards.
Finally... READ in the images BEFORE you process them!!! Otherwise you may get unexpected ordering of operations.
Code: Select all
convert "*.*" -resample 300x300 -scale 250x -crop 250x350 +repage result.pdf
READ these IM example sections..
http://www.cit.gu.edu.au/~anthony/graph ... s/#postfix
http://www.cit.gu.edu.au/~anthony/graph ... rop_repage
wildcard usage
Posted: 2007-01-09T11:27:43-07:00
by Arlene
thank you for the repage tip and I am using a Windows 2000 Advanced server and running these scripts basically thru a dos command line
so would like the code to run an entire directory of files and output the files to a different directory as pdfs, i.e.,
convert "*.*" -resample 300x300 -scale 250x -crop 250x350 +repage "c:\crop\out\*.pdf"
but unfortunately this does not produce any results ... any ideas?
Arlene
Posted: 2007-01-09T17:36:20-07:00
by anthony
OH. you want seperate pdf's. Wrong command. You example looks like you wanted to combine ALL images into one pdf!
What you were after is "montage" with a
-format option. Though that will generate pdf's in the same directory.
See Montage, in-place batch processing
http://www.cit.gu.edu.au/~anthony/graph ... s/#mogrify
At the end of that section is
Batch Processing - Without using "mogrify"
http://www.cit.gu.edu.au/~anthony/graph ... ogrify_not
This show other looping methods that can use convert and output to different directories, but these are more UNIX centric, However you could install centrix on windows and use its scripting power. Then again you could use some other programming scripting too, like visual basic, or PHP, or Perl too.