CUPS filter for cheap thermal receipt printers as Zijiang ZJ-58, XPrinter XP-58, JZ-80 with cutter, Epson TM-T20, and may be any other printers understanding ESC/POS commands.
Supported **2 Cash drawers** each may be opened either before, either after a whole print job. Length of the impulses to drive drawers may be customized.
**Blank feeds**: after printed job, or after every page paper may be rolled for extra 3-45mm with step 3mm
**Skip blank tail** if you print a small piece of data on a big roll - filter can determine the empty 'tail' of your printing and avoid to feed an extra paper. I.e. printing piece of 20mm on a paper 58x210mm will print only actually used 20mm and skip the rest huge tail.
ModelNumber from PPD contains number of pixels of printer's head. Filter extracts the value and that is how 58-mm is different from 80-mm. (also you can customize it by your own values without need to recompile the filter).
Print settings are passed and stored inside a print job, in each page header. That is different from previous approach where each time PPD was parsed for them.
58mm printer typically has 384 active pixels, placed in row of 48mm length. That is exactly 8 pixels/mm. Calculating from pix/mm to DPI gives you about 203 DPI (as 25.4mm/in * 8px/mm = 203.2 DPI ). In terms of points (1pt = 1/72in) paper of 58mm is has 164.4pt width, printing area of 48mm is 136. So, for page of 164pt we have, first, 14pt left margin, then 136pt of printing area and finally 14pt of right margin. That are physical limitations and they can't be overrided.
So, for customizing PPD for a printer with another dimensions you need to know these numbers: **resolution** (in DPI), **num of pixels**, and also physical **paper widht** and **printing area** expressed in points. Resolution and margins are placed in separate regions of PPD, paper width is used in defining media sizes; number of pixels is placed into 'modelnum' field of ppd.
*IMPORTANT!* If you upgrade from previous version of the filter, you NEED to manually change PPD file to one from this sources.
CUPS by default will not do it, and previous PPD with this filter will fail end even crash the job. So, if you previously used the driver from this repository, and it became crashing after installing this one, you need to go to printer's preferences and select 'new' driver instead of previous cached by CUPS.
Debug version of the filter may be achieved by using `cmake -DCMAKE_BUILD_TYPE=Debug`, or by switching the same param in `ccmake` TUI interface. Debug version will perform diagnostic output into file pointed by `DEBUGFILE` param. On Mac OS where CUPS is deeply sandboxed such file is selected by the filter and can't be customized (however you can rule your text viewer into that place). That is because cups filters are very limited and just can't write to any desirable folder.
Any packaging supported by CMake should work. However please note, that internally 'packaging' is the same as 'install into custom folder, then pack it'. And since installation suppose the things like changing permissions/owner, restarting CUPS service, that is also true when packaging (may be it is possible to avoid it, but not now). So, `make package` as `cpack .` both expects `sudo` rights, and will restart cups as a side effect (however the files will not be installed, but packed instead).