Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Print pdf files in a folder?


    Hey,
    At the moment I'm having to open a load of PDF files, and print them one by one.. this is taking a while..
    Is there any way I can dump them in a folder.. run a script inside the folder which will send each one to the printer?

    the printer command I'm using is:
    //usr/bin/lpr -Pinfrared-2ds

    Thanks A lot,

    Dan

    (Using mandriva linux)

  2. #2
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,252
    You sure can. This is a very simple task. We are going to loop through all files ending in .pdf in the current directory, and print them.
    Code:
    #!/bin/bash
    
    for file in *.pdf; do
        /usr/bin/lpr -Pinfrared-2ds "$file"
    done
    Just copy this script into the directory where you have the PDFs, make it executable, and run it from that directory.

  3. #3
    Excellent, Thankyou

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •