# $ApsCVS: www/tips.wml,v 1.4 2002/12/08 21:46:17 andreas Exp $
#use wml::tmpl::lbpage file=$(ROOT)/apps.html
<page_title name="Apsfilter Tips & Tricks">

<h2>
Apsfilter Tips & Tricks
</h2>

<p>This rubric shows some apsfilter tips and tricks.
  We use the same categories here like the
  <a href="http://www.FreeBSD.org/ports"
  >FreeBSD ports collection</a>.

<p>If you have some interesting ideas, feel free to write them to
  <sroberts> who is maintining this page. -Andreas

<p>Thanks for all your kind contributions !!! -Stacey
<p>

<linkgroup name="Graphics">
  <linkdesc name="The Gimp"
	url="http://www.gimp.org"
	maddr="mailto:sroberts@apsfilter.org">
	<p>
	  Contributed by: Michael Lossin
	  <br>Version: 1.2.3 and possibly others
	  <br>Level: easy
	<p>
	If you are using the Postscript output driver from Print Plugin and
	you don't have a "real" postscript printer, ensure that you DON'T
	include the "-o raw" option (which is the default).
	<p>
	Using the default ("-o raw") causes apsfilter to pass the input data
	unmodified, resulting in actual postscript code to be printed.
	Again, this does NOT apply if you indeed have a postscript printer.
  </linkdesc>
</linkgroup>

<linkgroup name="Print">
  <linkdesc name="Apsfilter"
	url="http://www.apsfilter.org"
	maddr="mailto:sroberts@apsfilter.org">
	<p>
	  Contributed by: Michael Lossin
	  <br>Version: 7.2.x and later
	  <br>Level: intermediate - expert
	<p>
	Another contribution from M. Lossin for configuring apsfilter to use
	personal apsfilter configs for printing from misc applications.
	<p>
	As we all know from reading the handbook, aps2file gives
	us the great opportunity to use "user managed" apsfilterrc
	configuration files without the usual security risks involved.
	This is because in this case apsfilter is executed by a
	user program (AbiWord or Mozilla, etc) with the corresponding
	user permissions - and not root or daemon permissions.
	<p>
	E.G., in a file like $HOME/.apsfilter/apsfilterrc.lp you
	can make permanent settings for the printer queue named
	"lp" that changes apsfilter's default behaviour (like
	resolution / colour, etc) for a given user. The good thing
	is, there is no need to resort to the sysadmin for help in
	making these changes to the actual printer's default settings.
	However, the bad thing is you have to remember the long
	command:
	<br>"aps2file -Z aps:filter:options file | lpr -Pqueue -C raw"
	<p>
	The following piece by M. Lossin seeks to automate what we
	have explained here in a way that allows you to substitute
	the lp/lpr command, by parsing the printer queue name and
	print options to the aps2filter command.
	<p>
	If you want apsfilter to use your personal configuration, as per
	(~/.apsfilter/apsfilterrc.QUEUE) at all times, you can substitute
	the "lpr" command with something like: $HOME/bin/my_lpr.
	<p>
	Create a script "$HOME/bin/my_lpr":
	<p>
	<pre>
	"#!/bin/sh" - DON'T INCLUDE THE QUOTES ON THIS LINE, PLEASE
	args="$@"
	unset my_queue
	while [ "$1" ]; do
		case "$1" in
			-P)	shift; my_queue="$1" ;;
			-P*)	my_queue="${1#-P}" ;;
		esac
		shift
	done
	aps2file $args | lpr ${my_queue:+-P$my_queue} -Craw
	</pre>
	<p>
	Make the script executable:
	chmod 755 $HOME/bin/my_lpr
	<p>
	And this should work (TM). NOTE: if your spooler uses "lp" and not
	"lpr", replace each occurance of "-P" with "-d" and "lpr" with "lp" 
	<p>
	Usage: my_lpr [-Pqueue] [-Z apsfilter:options] file
  </linkdesc>
</linkgroup>

<linkgroup name="Unix">
  <linkdesc name="Shell"
	url="http://www.ugu.org"
	maddr="mailto:andreas@apsfilter.org">
	<p>
	  Contributed by: Andreas Klemm
	  <br>Version: all flavours of Unix
	  <br>Level: easy
	<p>
	Goal: you want to make another system printer to your default
	printer, so that you don't have to use lpr's -P options again
	and again.
	<p>
	Simply define the PRINTER variable in your shell environment.
	<p>
	If you don't know which flavour of shell you have, simply
	type in
	<br><i>echo $SHELL</i>
	<p>
	<table border="1">
	<tr>
	  <th>Type of shell</th>
	  <th>Shell</th>
	  <th>Config File</th>
	  <th>Set this</th>
	</tr>
	<tr>
	  <td>Bourne Shell and compatible</td>
	  <td>sh, bash</td>
	  <td>$HOME/.profile</td>
	  <td>PRINTER=<i>name</i>; export PRINTER</td>
	</tr>
	<tr>
	  <td>C-Shell and compatible</td>
	  <td>csh, tcsh</td>
	  <td>$HOME/.cshrc</td>
	  <td>setenv PRINTER <name></td>
	</tr>
	</table>
  </linkdesc>
</linkgroup>

# vim: set ft=html:
