
See
http://www.linuxfoundation.org/collaborate/workgroups/openprinting/database/query
"Modification of the output" and
"Downloading PPD files"


This web page reads in particular:
------------------------------------------------------
Query types

The basic query types are asking for manufacturers,
printers, or drivers.

All manufacturers for which there are printers
in the database get listed by

  * http://openprinting.org/query.cgi?type=manufacturers

All printers in the database get listed by

  * http://openprinting.org/query.cgi?type=printers

All drivers in the database get listed by

  * http://openprinting.org/query.cgi?type=drivers

These queries are not necessarily useful,
usually you will apply modifications and/or filters
to them.


Modification of the output

Instead of plain text you can have XML as output format.
Simply add the

format=xml

option to the URL:

  * http://openprinting.org/query.cgi?type=printers&format=xml

Default is "format=text".

Note: In URLs there can be no spaces. Options have to be
separated by the ampersand ("&").

Now you have only seen the names of the drivers and printers.
To get details about them add "moreinfo=1":

  * http://openprinting.org/query.cgi?type=printers&moreinfo=1

These two options can be combined:

  * http://openprinting.org/query.cgi?type=printers&moreinfo=1&format=xml

[...]


Downloading PPD files

There is also a query scheme for downloading
single PPD files. It works both with PPD files
which are generated from the database by Foomatic
and with PPD files which are ready-to-use on the
server (manufacturer-supplied PPDs).

The parameters needed are the driver name and the
Foomatic printer ID. Both appear in the answers
to the above-mentioned database queries. They are
the headlines of the entries in the plain text output
of driver and printer queries or the "id" parameter
in the driver and printer entries of the XML
output ("<driver id="driver/...">"
or "<printer id="printer/...">").
Driver queries with the "showprinterid=1" option show
the Foomatic ID of the printer in the first
line ("Printer: ...") of the plain text output or in
the XML output as "<drivers printer="printer/...">",
also in the first line.

The URL for downloading a PPD is then

http://www.openprinting.org/ppd-o-matic.cgi?driver=<driver ID>&printer=<Foomatic printer ID>

Here is an example for the Infotec IS2032
(Foomatic ID: Infotec-IS2032) with the
pxlmono-Infotec driver:

http://www.openprinting.org/ppd-o-matic.cgi?driver=pxlmono-Infotec&printer=Infotec-IS2032

This directly downloads the PPD file.
------------------------------------------------------



Regarding "Modification of the output":

wget -O printers.txt 'http://www.openprinting.org/query.cgi?type=printers&moreinfo=1'
-------------------------------------------------------
Alps-MD-1300
  Manufacturer: Alps
  Model: MD-1300
  Works: Perfectly
  Recommended driver: ppmtomd
  Drivers:
    md1xMono
    md2k
    ppmtocpva
    ppmtomd
  Comments:
--------------------------------------------------------

wget -O printers.xml 'http://openprinting.org/query.cgi?type=printers&moreinfo=1&format=xml'
-------------------------------------------------------
  <printer id="printer/Alps-MD-1300">
    <id>Alps-MD-1300</id>
    <make>Alps</make>
    <model>MD-1300</model>
    <functionality>A</functionality>
    <driver>ppmtomd</driver>
    <drivers>
      <driver>md1xMono</driver>
      <driver>md2k</driver>
      <driver>ppmtocpva</driver>
      <driver>ppmtomd</driver>
    </drivers>
-------------------------------------------------------

egrep '<id>|<driver>' printers.xml
-------------------------------------------------------
    <id>Alps-MD-1300</id>
    <driver>ppmtomd</driver>
      <driver>md1xMono</driver>
      <driver>md2k</driver>
      <driver>ppmtocpva</driver>
      <driver>ppmtomd</driver>
-------------------------------------------------------


wget -O drivers.xml 'http://openprinting.org/query.cgi?type=drivers&moreinfo=1&format=xml'
-------------------------------------------------------
  <driver id="driver/epson-ep-302">
    <name>epson-ep-302</name>
    <url>http://avasys.jp/linux/</url>
    ...
    <nonfreesoftware />
    <nopatents />
...
  <driver id="driver/hplip">
    <name>hplip</name>
    <url>http://hplipopensource.com/</url>
    ...
    <freesoftware />
    <nopatents />
...
  <driver id="driver/ljet4">
    <name>ljet4</name>
    <url>http://www.ghostscript.com/</url>
    ...
    <freesoftware />
    <nopatents />
...
  <driver id="driver/splix">
    <name>splix</name>
    <url>http://splix.ap2c.org/</url>
    ...
    <freesoftware />
    <patents />
-------------------------------------------------------

egrep '<name>|<url>|freesoftware />|patents />' drivers.xml
-------------------------------------------------------
    <name>epson-ep-302</name>
    <url>http://avasys.jp/linux/</url>
    <nonfreesoftware />
    <nopatents />
...
    <name>hplip</name>
    <url>http://hplipopensource.com/</url>
    <freesoftware />
    <nopatents />
...
    <name>ljet4</name>
    <url>http://www.ghostscript.com/</url>
    <freesoftware />
    <nopatents />
...
    <name>splix</name>
    <url>http://splix.ap2c.org/</url>
    <freesoftware />
    <patents />
-------------------------------------------------------


Regarding "Downloading PPD files" in the above example:

wget -O Alps-MD-1300.ppmtocpva.ppd 'http://www.openprinting.org/ppd-o-matic.cgi?driver=ppmtocpva&printer=Alps-MD-1300'



As reference the OpenPrinting Database is included
in the sources of this package.

It was downloaded from
http://www.openprinting.org/download/foomatic/foomatic-db-4.0-20110112.tar.gz

See
http://www.linuxfoundation.org/collaborate/workgroups/openprinting/database/foomatic
which reads in particular:
-------------------------------------------------------
foomatic-db
  The collected knowledge about printers, drivers,
  and driver options in XML files, used
  by foomatic-db-engine to generate PPD files.
  It also contains manufacturer-supplied PPD files
  which got released under free software licenses.
...
There are daily snapshots of the stable "4.0" branches
...
You don't need to install all packages. You can install
only "foomatic-filters" and use PPD files from
PostScript printers or download the PPD files
from OpenPrinting.
-------------------------------------------------------
The "foomatic-filters" package (also distributed
by openSUSE) is required when PPDs of this package
are used for print queues.

The OpenPrinting Database itself is not used to make the PPDs.
The PPDs are directly downloaded one by one from OpenPrinting.org
according to what is described above at "Downloading PPD files"
via various scripts which are also included in the sources
of this package. See the HOWTO file how exactly it was done.



The GNU General Public License version 2 (GPLv2) was downloaded from
http://www.gnu.org/licenses/gpl-2.0.txt


