# command line image printing

This topic is 3856 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi all. Is there a command line way of saying "print the following images, each of which must be scaled and rotated as necessary to fill a Xcm by Ycm page as much as possible while preserving aspect ratio?" Even better would be to also specify that the image should be horizontally and vertically centred whatever the page size. Thanks

##### Share on other sites
I'm no ImageMagick expert, but maybe the following will get you started. It assumes all the files in the current working directory are images to be printed. You'll have to change the glob in other cases.

for i in *; do convert -page A4 +repage "\$i" ps:- | lpr

You'll want to run some tests before blindly running the batch job, as you'll likely have to tweak this one-liner. I didn't test it myself.

Hope this helps.

• ### Forum Statistics

• Total Topics
628715
• Total Posts
2984362

• 24
• 11
• 10
• 13
• 14