New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus • Advice and insight from world-class Apple enthusiasts • Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Apps and Games Discussion of applications and games available for Mac OS X.

How print files in Preview to pdf from command line?


Post Reply New Thread Subscribe

 
Thread Tools
ypsd

 
Member Since: Aug 03, 2010
Posts: 10
ypsd is on a distinguished road

ypsd is offline
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.
QUOTE Thanks
McYukon

 
McYukon's Avatar
 
Member Since: May 14, 2009
Location: Near Whitehorse, Yukon
Posts: 2,053
McYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to behold
Mac Specs: 2012 MBP i7 2.7 GHz 15" Matte - 16 GB RAM - 120 GB Intel SSD - 500 GB DataDoubler Mac OS 10.9

McYukon is offline
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.
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 17,827
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
You can use the lpr tool to print from the CLI. Open up Terminal and execute the following:
Code:
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:
Code:
lpstat -v | awk '{ print $3; }'
Find the printer in that list and then specify for lpr by doing the following:
Code:
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
QUOTE Thanks

Post Reply New Thread Subscribe


« Best RSS Reader Software for the Mac | Opera browser does not access web pages »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Can't preview RAW files in Adobe Bridge GFPhoto Images, Graphic Design, and Digital Photography 11 08-19-2013 12:55 AM
PDF links in Preview? dannye OS X - Apps and Games 0 05-17-2010 04:16 PM
Artwork, iTunes and icons for audio files in Finder Theophil iOS and Apps 2 11-27-2008 09:55 AM
Unable to un-encrypt Preview PDF mskopel OS X - Apps and Games 0 02-29-2008 01:51 PM
PDF files misskool Switcher Hangout 1 08-20-2004 08:08 AM

All times are GMT -4. The time now is 02:11 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?