Printing files from terminal

Hey there,


I was wondering, is there any way to print files from terminal, i mean with files generally office files (*.doc, *.docx, *.ppt, *.pptx) and iWorks files, as an old windows user i was able to print these kinds of files from commandline with print command, is there any equivalent terminal command under Mac os, i found couple of commands like "lp" and "lpr" but these commands are printing directly binary data of files not formatted view of files by default programs like office or iWorks.

MacBook Pro, Mac OS X (10.7.3)

Posted on Jul 10, 2013 3:36 AM

Reply
2 replies

Jul 10, 2013 5:23 PM in response to Urseus

It is possible to print PDF and Postscript and text files directly from the command line, as is typical on most systems.


Microsoft Office files and iWork files are special cases, and first have to be converted into a file format that can be printed (on Windows or whatever other platform), and that generally means using some application that can read and process the files. (If you look at the details of the underlying file storage, you'll find that various of these document "files" are actually whole directories of files; they're what Apple calls "bundles".) (Based on this posting, some folks use this via-Word approach with the Windows command line printing, too.)


Based on a quick check of invoking the main executable from directly within the Pages bundle, the executable does not appear to accept command-line arguments.


This means some AppleScript to launch iWork and print, or possibly using the Scripting Bridge from another locally-written (for instance) Python procedure, or an add-on tool. Here are some other options.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Printing files from terminal

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.