[753] | 1 | <!-- $Id$ --> |
---|
| 2 | |
---|
| 3 | <chapter> |
---|
[1187] | 4 | <title id="filter">PyKota's internals</title> |
---|
[865] | 5 | |
---|
| 6 | <para>Last modified on $Date$</para> |
---|
| 7 | |
---|
[753] | 8 | <para> |
---|
[1101] | 9 | To account for pages or eventually ink usage |
---|
| 10 | <footnote> |
---|
| 11 | <para> |
---|
| 12 | PyKota doesn't currently account for ink usage, it only accounts |
---|
[1600] | 13 | pages. To account for ink usage, you should use PrintBill instead for now. |
---|
[1101] | 14 | </para> |
---|
| 15 | </footnote> |
---|
| 16 | , you must plug your accounting |
---|
[959] | 17 | system somewhere into the printing system you use, be it either <application>CUPS</application> |
---|
| 18 | or <application>LPRng</application>. One way to do this without having |
---|
| 19 | to modify the printing system itself, is by using a <firstterm>filter</firstterm>. |
---|
[753] | 20 | </para> |
---|
[865] | 21 | |
---|
| 22 | <para> |
---|
| 23 | A filter is a computer program which takes data in one format as its input, and outputs the |
---|
| 24 | same data but transformed into another format. <application>CUPS</application> already |
---|
[1500] | 25 | contains many filters. For example there's one filter named <filename>pstops</filename> which accepts |
---|
[865] | 26 | PostScript data as its input, and, as its name implies, outputs PostScript data too, but after having |
---|
| 27 | eventually rearranged the pages to fit several pages on a single sheet of paper, or other manipulations |
---|
[1600] | 28 | like that. <application>LPRng</application> also contains several filters like this. |
---|
[865] | 29 | </para> |
---|
| 30 | |
---|
| 31 | <para> |
---|
[1500] | 32 | The <filename>pstops</filename> filter described above is also in charge of doing basic page |
---|
[865] | 33 | accounting, but <application>PyKota</application> currently doesn't use this facility since it may |
---|
[1168] | 34 | prove to be unreliable depending on the drivers used or if a paper jam occurs for example. |
---|
[865] | 35 | </para> |
---|
| 36 | |
---|
| 37 | <para> |
---|
[1600] | 38 | <application>LPRng</application> can also use filters, often used in combination with |
---|
| 39 | <application>LPRng</application> are <application>magicfilter</application> which can convert |
---|
| 40 | different input formats to native printers languages like PostScript or ESC/P2 and |
---|
| 41 | <application>ifhp</application> which can do low-level accounting. |
---|
[959] | 42 | </para> |
---|
| 43 | |
---|
| 44 | <para> |
---|
[1500] | 45 | So to do its own accounting, <application>PyKota</application> has its own filters, for <application>CUPS</application> |
---|
| 46 | it's named <filename>cupspykota</filename>, which is in fact a <application>CUPS</application> backends wrapper, |
---|
[1600] | 47 | and for <application>LPRng</application> it's named <filename>lprngpykota</filename>, as you have probably guessed. |
---|
[1500] | 48 | The procedure to plug the correct filter into your printing system is described in the |
---|
[865] | 49 | <xref linkend="installation" endterm="installation"> chapter. |
---|
| 50 | </para> |
---|
| 51 | |
---|
| 52 | <para> |
---|
[1500] | 53 | Currently with a <application>CUPS</application> internal accounting mechanism, the <filename>pstops</filename> |
---|
| 54 | filter can be bypassed. That's why <application>PyKota</application> uses its own backend. |
---|
[1600] | 55 | The <filename>cupspykota</filename> backend wrapper ensures that jobs can't bypass it, so you can use |
---|
[1187] | 56 | any printer with any driver and any command line option, and you can be sure that your |
---|
| 57 | print job will be correctly accounted for. |
---|
[865] | 58 | </para> |
---|
| 59 | |
---|
| 60 | <para> |
---|
[1475] | 61 | When using the <literal>hardware</literal> accounting method, |
---|
[1600] | 62 | <application>PyKota</application> launches the script you specified to |
---|
| 63 | ask the printer for its internal page counter at the start and at the end of the print job, and |
---|
| 64 | computes the values' difference to know the job's size. |
---|
[959] | 65 | </para> |
---|
| 66 | |
---|
| 67 | <para> |
---|
[1475] | 68 | When using the <literal>software</literal> accounting method, |
---|
[1099] | 69 | the command you specified is launched with the job's data on its |
---|
| 70 | standard input. Your command must print the job's size in number of |
---|
| 71 | pages on a single line on its standard output. This number is then |
---|
[1500] | 72 | read by <application>PyKota</application> and used to update the current user's quota information. |
---|
[1099] | 73 | </para> |
---|
| 74 | |
---|
| 75 | <para> |
---|
[1500] | 76 | If a problem occurs, it is logged either to the filter's standard error or to the system logger, depending on |
---|
[1168] | 77 | your preferences in <application>PyKota</application>'s configuration files. Also if a print quota is reached |
---|
[1099] | 78 | you may choose if the administrator, the user, both or no-one will receive an email message explaining |
---|
[1500] | 79 | the situation and proposing a solution. You can even configure another action instead of sending email |
---|
| 80 | messages if you want. |
---|
[959] | 81 | </para> |
---|
| 82 | |
---|
[753] | 83 | </chapter> |
---|
| 84 | |
---|
| 85 | <!-- |
---|
| 86 | |
---|
| 87 | $Log$ |
---|
[1600] | 88 | Revision 1.12 2004/07/16 12:22:45 jalet |
---|
| 89 | LPRng support early version |
---|
| 90 | |
---|
[1500] | 91 | Revision 1.11 2004/05/25 09:49:52 jalet |
---|
| 92 | The old pykota filter has been removed. LPRng support disabled for now. |
---|
| 93 | |
---|
[1475] | 94 | Revision 1.10 2004/05/13 13:59:28 jalet |
---|
| 95 | Code simplifications |
---|
| 96 | |
---|
[1386] | 97 | Revision 1.9 2004/03/03 19:35:36 jalet |
---|
| 98 | Spelling problem. Thanks to Jurandy Martins |
---|
| 99 | |
---|
[1187] | 100 | Revision 1.8 2003/11/15 14:59:53 jalet |
---|
| 101 | Documentation wrt the new CUPS backend. |
---|
| 102 | |
---|
[1168] | 103 | Revision 1.7 2003/10/14 20:26:53 jalet |
---|
| 104 | Better documentation. |
---|
| 105 | 1.15 is out ! |
---|
| 106 | |
---|
[1101] | 107 | Revision 1.6 2003/07/25 13:10:58 jalet |
---|
| 108 | Improved documentation |
---|
| 109 | |
---|
[1099] | 110 | Revision 1.5 2003/07/25 10:41:29 jalet |
---|
| 111 | Better documentation. |
---|
| 112 | pykotme now displays the current user's account balance. |
---|
| 113 | Some test changed in ldap module. |
---|
| 114 | |
---|
[982] | 115 | Revision 1.4 2003/04/30 20:00:51 jalet |
---|
| 116 | Typo |
---|
| 117 | |
---|
[959] | 118 | Revision 1.3 2003/04/24 21:09:47 jalet |
---|
| 119 | Documentation slightly improved. |
---|
| 120 | |
---|
[865] | 121 | Revision 1.2 2003/03/25 09:32:06 jalet |
---|
| 122 | Improved documentation. |
---|
| 123 | |
---|
[753] | 124 | Revision 1.1 2003/02/08 00:03:35 jalet |
---|
| 125 | Documentation skeleton added |
---|
| 126 | |
---|
| 127 | |
---|
| 128 | --> |
---|