We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Printing filters in Solaris 2.5.1

aikenc
aikenc asked
on
Medium Priority
312 Views
Last Modified: 2013-12-27
How do I setup a magic printing filter that is used by lpr so that whatever type of file I'm printing I just type lpr filename, and it prints it out to the default printer?  Can anybody point me to any web pages which deal with this, or can you tell me how you did it?  Thanks
Comment
Watch Question

Commented:
Declare your printer as the default printer, your can use the Admintool or the lpadmin (see man page) command.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
I know how to make the printer the default printer.  I was more interested in setting up the magic filter so that I can print just about any type of file by just typing lpr filename.
There are so many different types of file that leaving it to the
operating system to decide is probably expecting too much. Only
you know how you want each different type of file formatted.
Also, there are many files which you will not want to print at
all, such as executable files. If you have compressed files you
will want to uncompress them first, before you decide how to
print them.

What I would suggest is writing a script which uses "file" and
looks at the file extension to decide what sort of file you are
trying to print and sets the printing options appropriately.

The script might even look at the contents of some files to
further refine its printing options. For example, you might want
plain text files to be printed in one way if every line in the
file is less than 80 characters long but use a different setup
if some lines are more than 80 but less than 132 chars.

The script could be called "lpr" and be placed in the PATH or
could be aliased.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.