Results 1 to 3 of 3
  1. #1

    Member Since
    Aug 03, 2010
    How print files in Preview to pdf from command line?
    I have a number of files. I want open them by Preview and Print them to pdf. I'm wondering if there is an automatic way to do (for example, from command line). Opening each of them manually and print them is tedious.

  2. #2

    McYukon's Avatar
    Member Since
    May 14, 2009
    Near Whitehorse, Yukon
    2012 MBP i7 2.7 GHz 15" Matte - 16 GB RAM - 120 GB Intel SSD - 500 GB DataDoubler Mac OS 10.9
    Hello, Welcome to M-F

    Download Cups-PDF, this mimics a real printer so we can access it with Automator.
    Install it and open Automator.
    Choose workflow, then add from the Files/Folder category "Get Specified Finder Items" add all the files you want to print by drag 'n drop or by the "Add…" button. You can add multiple files at once.
    Then in the Utilities category add "Print Finder Items", select the Cups printer for the "Print to" and click the run button.
    Use the reputation system if a post helps you!
    Mac Forums IRC Channel - Help build it by hanging out with us
    The next sentence is true. The previous sentence is false.

  3. #3

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Early 2015 13" rMBP
    You can use the lpr tool to print from the CLI. Open up Terminal and execute the following:
    lpr /path/to/file
    That will print the file from the default printer. If you want to specify a printer, execute the following to get the appropriate printer names:
    lpstat -v | awk '{ print $3; }'
    Find the printer in that list and then specify for lpr by doing the following:
    lpr -P <printer name> /path/to/file
    When inserting the printer name in this command, exclude the colon at the end.

    Take a look at the man page for lpr to see some more options (man lpr).
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. New Blog: Learning the Command Line - Editing files
    By MF Blog Bot in forum Apple Rumors and Reports
    Replies: 0
    Last Post: 07-07-2014, 09:10 AM
  2. New Blog: Learning the Command Line - Listing Files
    By MF Blog Bot in forum Apple Rumors and Reports
    Replies: 0
    Last Post: 10-23-2013, 11:40 AM
  3. Compare OS X command line to Linux command line?
    By V6Pony in forum macOS - Development and Darwin
    Replies: 5
    Last Post: 09-26-2013, 12:32 PM
  4. How to print comments added to a PDF in Preview
    By axis42 in forum Switcher Hangout
    Replies: 0
    Last Post: 12-10-2008, 02:00 PM
  5. Problem with PDF files in Preview
    By medellkr in forum macOS - Apps and Games
    Replies: 0
    Last Post: 03-02-2008, 10:28 PM

Posting Permissions

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