<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../../general.ent">
  %general-entities;

  <!ENTITY a2ps-download-http "http://ftp.gnu.org/gnu/a2ps/a2ps-&a2ps-version;.tar.gz">
  <!ENTITY a2ps-download-ftp  "ftp://ftp.gnu.org/gnu/a2ps/a2ps-&a2ps-version;.tar.gz">
  <!ENTITY a2ps-md5sum        "781ac3d9b213fa3e1ed0d79f986dc8c7">
  <!ENTITY a2ps-size          "2.6 MB">
  <!ENTITY a2ps-buildsize     "22 MB">
  <!ENTITY a2ps-time          "0.3 SBU">

  <!ENTITY i18n-fonts-version "0.1">
]>

<sect1 id="a2ps" xreflabel="a2ps-&a2ps-version;">
  <?dbhtml filename="a2ps.html"?>

  <sect1info>
    <othername>$LastChangedBy: bdubbs $</othername>
    <date>$Date: 2015-03-01 20:45:33 -0500 (Sun, 01 Mar 2015) $</date>
  </sect1info>

  <title>a2ps-&a2ps-version;</title>

  <indexterm zone="a2ps">
    <primary sortas="a-a2ps">a2ps</primary>
  </indexterm>

  <sect2 role="package">
    <title>Introduction to a2ps</title>

    <para><application>a2ps</application> is a filter utilized mainly
    in the background and primarily by printing scripts to convert almost
    every input format into PostScript output. The application's name
    expands appropriately to <quote>all to PostScript</quote>.</para>

    &lfs77_checked;

    <caution>
      <para><application>a2ps</application> cannot convert UTF-8 encoded
      text to PostScript. The issue is discussed in detail in the
      <xref linkend="locale-not-valid-option"/> section of the
      <xref linkend="locale-issues"/> page.
      The solution is to use <xref linkend="paps"/> instead of
      <application>a2ps</application> for converting
      UTF-8 encoded text to PostScript.</para>
    </caution>

    <bridgehead renderas="sect3">Package Information</bridgehead>
    <itemizedlist spacing="compact">
      <listitem>
        <para>Download (HTTP): <ulink url="&a2ps-download-http;"/></para>
      </listitem>
      <listitem>
        <para>Download (FTP): <ulink url="&a2ps-download-ftp;"/></para>
      </listitem>
      <listitem>
        <para>Download MD5 sum: &a2ps-md5sum;</para>
      </listitem>
      <listitem>
        <para>Download size: &a2ps-size;</para>
      </listitem>
      <listitem>
        <para>Estimated disk space required: &a2ps-buildsize;</para>
      </listitem>
      <listitem>
        <para>Estimated build time: &a2ps-time;</para>
      </listitem>
    </itemizedlist>

    <bridgehead renderas="sect3">Additional Downloads</bridgehead>
    <itemizedlist spacing='compact'>
      <listitem>
        <para>International fonts: <ulink
        url="http://anduin.linuxfromscratch.org/sources/BLFS/conglomeration/i18n-fonts/i18n-fonts-&i18n-fonts-version;.tar.bz2"/></para>
      </listitem>
    </itemizedlist>

    <bridgehead renderas="sect3">a2ps Dependencies</bridgehead>

    <bridgehead renderas="sect4">Recommended</bridgehead>
    <para role="recommended">
      <xref linkend="psutils"/>, and
      <xref linkend="cups"/>
      (otherwise, <application>a2ps</application> will use the
      <command>cat &gt;/dev/lp0</command> command instead of <command>lpr</command>
      for sending its output to the printer)
    </para>

    <bridgehead renderas="sect4">Optional</bridgehead>
    <para role="optional">
      <xref linkend="gs"/>,
      <xref linkend="libpaper"/>,
      <xref linkend="texlive"/> (or <xref linkend="tl-installer"/>)
      <xref linkend="x-window-system"/>,
      <ulink url="http://www.adobe.com/products/acrobat/readstep2.html">Adobe Reader</ulink>, and
      <ulink url="http://www.gnu.org/software/ghostview/ghostview.html">Ghostview</ulink>
    </para>

    <para condition="html" role="usernotes">User Notes:
    <ulink url="&blfs-wiki;/A2PS"/></para>

  </sect2>

  <sect2 role="installation">
    <title>Installation of a2ps</title>

    <para>Install <application>a2ps</application> by running the following
    commands:</para>

<screen><userinput>autoconf &amp;&amp;
sed -i -e "s/GPERF --version |/&amp; head -n 1 |/" \
       -e "s|/usr/local/share|/usr/share|" configure &amp;&amp;

./configure --prefix=/usr  \
    --sysconfdir=/etc/a2ps \
    --enable-shared        \
    --with-medium=letter   &amp;&amp;
make                       &amp;&amp;
touch doc/*.info</userinput></screen>

    <para>To test the results, issue: <command>make check</command>.
    The <filename>printers.tst</filename> test will fail, as there is no default
    test printer.  The <filename>styles.tst</filename> may also fail, as the
    tests report some inconsistencies between the generated postscript and the
    reference sets.  This is caused by version number differences between the
    postscript test files and those generated by the tests &mdash; these do not
    affect the operation of the program and can be ignored.</para>

    <para>Now, as the <systemitem class="username">root</systemitem> user:</para>

<screen role="root"><userinput>make install</userinput></screen>

    <para>If desired, install the downloaded i18n-fonts by running the following
    commands as the <systemitem class="username">root</systemitem> user:</para>

<screen role="root"><userinput>tar -xf ../i18n-fonts-&i18n-fonts-version;.tar.bz2 &amp;&amp;
cp -v i18n-fonts-&i18n-fonts-version;/fonts/* /usr/share/a2ps/fonts               &amp;&amp;
cp -v i18n-fonts-&i18n-fonts-version;/afm/* /usr/share/a2ps/afm                   &amp;&amp;
pushd /usr/share/a2ps/afm    &amp;&amp;
  ./make_fonts_map.sh        &amp;&amp;
  mv fonts.map.new fonts.map &amp;&amp;
popd</userinput></screen>

  </sect2>

  <sect2 role="commands">
    <title>Command Explanations</title>

    <para><command>autoconf</command>: This command is used to recreate the
    <command>configure</command> script. This is required because there is
    an issue in the mktime test which causes the
    <command>configure</command> script to hang for 60 seconds and then report
    that there is no working mktime function.</para>

    <para><command>sed -i "s/GPERF --version |/&amp; head -n 1 |/" configure</command>:
    This fixes a bug in the handling of the version output of
    <command>gperf</command>.</para>

    <para><command>sed -i "s|/usr/local/share|/usr/share|" configure</command>:
    This command modifies the <command>configure</command> script to search for
    <application>Ghostscript</application> fonts at the location where they were
    installed by the BLFS instructions.</para>

    <para><parameter>--sysconfdir=/etc/a2ps</parameter>: Configuration data
    is installed in <filename class="directory">/etc/a2ps</filename> instead of
    <filename class="directory">/usr/etc</filename>.</para>

    <para><parameter>--enable-shared</parameter>: This switch enables building
    the dynamic <filename class='libraryfile'>liba2ps</filename> library.</para>

    <para><parameter>--with-medium=letter</parameter>: This switch changes the
    default paper format to US letter. It can either be given here or set
    in <filename>/etc/a2ps/a2ps-site.cfg</filename> after installation. The
    default is A4, but there are several other options, in particular: A4dj or
    letterdj are good settings for HP Deskjet and other printers that need
    wider paper-handling margins. See <filename>/etc/a2ps/a2ps.cfg</filename>
    after installation.</para>

    <para><command>touch doc/*.info</command>: This command avoids trying to
    regenerate the info files. This is an older package and the current
    .texi files will produce errors preventing <command>make install</command>
    from working properly.</para>

  </sect2>

  <sect2 role="configuration">
    <title>Configuring a2ps</title>

    <sect3 id="a2ps-config">
      <title>Config Files</title>

      <para><filename>/etc/a2ps/a2ps.cfg</filename>,
      <filename>/etc/a2ps/a2ps-site.cfg</filename></para>

      <indexterm zone="a2ps a2ps-config">
        <primary sortas="e-etc-a2ps-a2ps.cfg">/etc/a2ps/a2ps.cfg</primary>
      </indexterm>

      <indexterm zone="a2ps a2ps-config">
        <primary sortas="e-etc-a2ps-a2ps-site.cfg">/etc/a2ps/a2ps-site.cfg</primary>
      </indexterm>

    </sect3>

    <sect3>
      <title>Configuration Information</title>

      <para>Information about configuring <application>a2ps</application>
      can be found in the comments contained in the above files, and also
      by running <command>info a2ps</command>.</para>

    </sect3>

  </sect2>

  <sect2 role="content">
    <title>Contents</title>

    <segmentedlist>
      <segtitle>Installed Programs</segtitle>
      <segtitle>Installed Libraries</segtitle>
      <segtitle>Installed Directories</segtitle>

      <seglistitem>
        <seg>a2ps, card, composeglyphs, fixnt, fixps, ogonkify,
        pdiff, psmandup, psset, and texi2dvi4a2ps</seg>
        <seg>liba2ps.{so,a} and filter data</seg>
        <seg>/etc/a2ps and /usr/share/a2ps</seg>
      </seglistitem>
    </segmentedlist>

    <variablelist>
      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
      <?dbfo list-presentation="list"?>
      <?dbhtml list-presentation="table"?>

      <varlistentry id="a2ps-prog">
        <term><command>a2ps</command></term>
        <listitem>
          <para>is a filter, utilized primarily by printing scripts,
          that converts standard input or supported files to PostScript.</para>
          <indexterm zone="a2ps a2ps-prog">
            <primary sortas="b-a2ps">a2ps</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="card">
        <term><command>card</command></term>
        <listitem>
          <para>prints a reference card of a given program's options.</para>
          <indexterm zone="a2ps card">
            <primary sortas="b-card">card</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="composeglyphs">
        <term><command>composeglyphs</command></term>
        <listitem>
          <para>creates a composite font program.</para>
          <indexterm zone="a2ps composeglyphs">
            <primary sortas="b-composeglyphs">composeglyphs</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="fixnt">
        <term><command>fixnt</command></term>
        <listitem>
          <para>is supposed to fix the problems in the PostScript files
          generated by the Microsoft PostScript driver under Windows NT
          (3.5 and 4.0).</para>
          <indexterm zone="a2ps fixnt">
            <primary sortas="b-fixnt">fixnt</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="fixps">
        <term><command>fixps</command></term>
        <listitem>
          <para>tries to fix common PostScript problems that break
          postprocessing.</para>
          <indexterm zone="a2ps fixps">
            <primary sortas="b-fixps">fixps</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="ogonkify">
        <term><command>ogonkify</command></term>
        <listitem>
          <para>provides international support for Postscript by performing
          various munging of PostScript files related to printing in different
          languages.</para>
          <indexterm zone="a2ps ogonkify">
            <primary sortas="b-ogonkify">ogonkify</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="pdiff">
        <term><command>pdiff</command></term>
        <listitem>
          <para>produces a pretty comparison between files.</para>
          <indexterm zone="a2ps pdiff">
            <primary sortas="b-pdiff">pdiff</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="psmandup">
        <term><command>psmandup</command></term>
        <listitem>
          <para>tries to produce a version of a given PostScript file to
          print in manual duplex.</para>
          <indexterm zone="a2ps psmandup">
            <primary sortas="b-psmandup">psmandup</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="psset">
        <term><command>psset</command></term>
        <listitem>
          <para>produces a version of a given PostScript file with a
          protected call to the PostScript operator 'setpagedevice'.
          Typical use is making a file print duplex, or on the manual
          tray, etc.</para>
          <indexterm zone="a2ps psset">
            <primary sortas="b-psset">psset</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="texi2dvi4a2ps">
        <term><command>texi2dvi4a2ps</command></term>
        <listitem>
          <para>compiles Texinfo and LaTeX files to DVI or PDF</para>
          <indexterm zone="a2ps texi2dvi4a2ps">
            <primary sortas="b-texi2dvi4a2ps">texi2dvi4a2ps</primary>
          </indexterm>
        </listitem>
      </varlistentry>

    </variablelist>

  </sect2>

</sect1>
