diff --git a/CMakeLists.txt b/CMakeLists.txt index 82de494..0a9aea2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,9 +42,12 @@ mark_as_advanced( PPDC ) set ( PPDS "" ) if ( PPDC ) - set ( DRVSRC "${CMAKE_CURRENT_SOURCE_DIR}/zj-58.drv") + set ( DRVSRC "${CMAKE_CURRENT_SOURCE_DIR}/zjdrv.drv") set ( PPDDIR "${CMAKE_CURRENT_BINARY_DIR}/ppd" ) - list (APPEND PPDS "${PPDDIR}/zj58.ppd") + list (APPEND PPDS "${PPDDIR}/zj58.ppd" ) + list (APPEND PPDS "${PPDDIR}/xp58.ppd" ) + list (APPEND PPDS "${PPDDIR}/tm20.ppd" ) + list (APPEND PPDS "${PPDDIR}/zj80.ppd" ) ADD_CUSTOM_COMMAND ( OUTPUT ${PPDS} COMMAND LANG=c ${PPDC} ${DRVSRC} MAIN_DEPENDENCY ${DRVSRC} @@ -54,7 +57,9 @@ if ( PPDC ) ) ADD_CUSTOM_TARGET ( ppds ALL DEPENDS ${PPDS} ) else() - list (APPEND PPDS "${CMAKE_CURRENT_SOURCE_DIR}/ZJ-58.ppd") + message (STATUS "No ppdc found; fall back to defaultly shipped ZJ-58.ppd") + list ( APPEND PPDS "${CMAKE_CURRENT_SOURCE_DIR}/zj58.ppd" ) + list ( APPEND PPDS "${CMAKE_CURRENT_SOURCE_DIR}/zj80.ppd" ) endif() # installation stuff @@ -73,15 +78,13 @@ if ( APPLE ) set ( FILTERPATH "usr/libexec/cups/filter" ) set ( PPDPATH "Library/Printers/PPDs/Contents/Resources") set ( OWNER "root:wheel") - #install ( CODE "EXECUTE_PROCESS(COMMAND /etc/init.d/cups stop)" ) - # /private/etc/cups stop - # sudo launchctl stop org.cups.cupsd + install ( CODE "EXECUTE_PROCESS(COMMAND sudo launchctl stop org.cups.cupsd)" ) install ( TARGETS rastertozj DESTINATION ${FILTERPATH} ) # this line sets correct target permissions, due to CUPS requirements # However as a side effect you'll need either fakeroot, either sudo to even perform 'make package' because of it. install ( CODE "EXECUTE_PROCESS(COMMAND chown ${OWNER} \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${FILTERPATH}/rastertozj\")" ) install ( FILES ${PPDS} DESTINATION "${PPDPATH}" ) - # install ( CODE "EXECUTE_PROCESS(COMMAND /etc/init.d/cups start)" ) + install ( CODE "EXECUTE_PROCESS(COMMAND sudo launchctl start org.cups.cupsd)" ) elseif ( UNIX ) set ( FILTERPATH "usr/lib/cups/filter" ) set ( PPDPATH "usr/share/cups/model/zjiang/" ) diff --git a/Makefile b/Makefile deleted file mode 100644 index 2098bea..0000000 --- a/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -CC=gcc -RM=rm -f -CFLAGS=-Wl,-rpath,/usr/lib -Wall -fPIC -O3 -LDFLAGS= -LDLIBS=-lcupsimage -lcups - -SRCS=rastertozj.c -OBJS=$(subst .c,.o,$(SRCS)) - -all: rastertozj - -rastertozj: $(OBJS) - gcc $(LDFLAGS) -o rastertozj rastertozj.o $(LDLIBS) - -rastertozj.o: rastertozj.c - gcc $(CFLAGS) -c rastertozj.c - diff --git a/README.md b/README.md index 94ff3aa..cba386d 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,53 @@ -zj-58 +CUPS driver for thermal receipt printers (was: zj-58) +===================================================== + +CUPS filter for thermal receipt printers for rolls 58 and 80mm. + +Originally it was filter for Zijiang zj-58 with specific PPD, +but later it is revealed that it actually works with many other cheap 58mm printers, like +Xprinter XP-58, etc. Also support for 80mm printers added. + +Printing is performed from cups-raster using ESC/POS sequence 'GS v 0 '. +Empty (zero) lines feeded as 'feed' command (to avoid send empty raster). + +Also 2 Cash Drawers supported, with tunable impulse length for 'on' and 'off.' + +Build ===== -CUPS filter for thermal printer Zjiang ZJ-58 +You need toolchain, CMake and cups-devel. + +It may be achieved, say (as example) by running +``` +sudo apt install build-essential cmake libcups2-dev libcupsimage2-dev +``` + +After it the filter could be built by the sequence of commands: + +``` + mkdir build && cd build && cmake .. + make +``` + + +Installation +============ + +Need administrative rights! + +``` + sudo make install +``` + +'Sudo' is necessary to stop/restart cups service before operation, and also to place files with necessary rights. + + +Debian packaging +================ -The linux driver provided on Zjiang site unfortunately doesn't work. -First, it is 32-bit binary (and so, on x64 system need some x86 libs to be installed). -Second, it's PPD is not correct - it just doesn't show any advanced settings because of it. -Finally, raster filter just crashes on any try to run it! -But even if you run it, you'll see that it's working with printer is not optimal: for example, if it sees a blank line, it will send the blank raster to print (instead of just use 'feeding' command, which is definitely faster!) +For simplicity done with the same script as installation, so also need adminstrative rights. +``` + sudo cpack -G DEB +``` -This is the solution: -PPD is fixed and works. -Filter is provided as src (you can found a list of packages need to be installed in order to build it in the header of source). -Also, printing of blank lines is optimized. +That will stop/start cups as a side effect, however that is not critical. \ No newline at end of file diff --git a/ZJ-58.ppd b/ZJ-58.ppd deleted file mode 100644 index 5c77cc5..0000000 --- a/ZJ-58.ppd +++ /dev/null @@ -1,117 +0,0 @@ -*PPD-Adobe: "4.3" -*FormatVersion: "4.3" -*FileVersion: "1.2" -*LanguageVersion: English -*LanguageEncoding: ISOLatin1 -*PCFileName: "zj58.ppd" -*Manufacturer: "Zijiang" -*Product: "(zj-58)" -*1284DeviceID: "MFG:Zijiang;CMD:Zijiang;MDL:ZJ-58;CLS:PRINTER;" -*cupsVersion: 1.1 -*cupsManualCopies: True -*cupsModelNumber: 58 -*cupsFilter: "application/vnd.cups-raster 0 rastertozj" -*ModelName: "ZJ-58" -*ShortNickName: "ZJ-58" -*NickName: "Zijiang ZJ-58" -*PSVersion: "(3010.000) 550" -*LanguageLevel: "3" -*ColorDevice: False -*DefaultColorSpace: Gray -*FileSystem: False -*Throughput: "1" -*LandscapeOrientation: Plus90 -*VariablePaperSize: True -*TTRasterizer: Type42 - -*OpenUI *PageSize/Media Size: PickOne -*OrderDependency: 10 AnySetup *PageSize -*DefaultPageSize: X48MMY105MM - -*PageSize X48MMY105MM/58mm x 105mm: "<>setpagedevice" -*PageSize X48MMY210MM/58mm x 210mm: "<>setpagedevice" -*PageSize X48MMY297MM/58mm x 297mm: "<>setpagedevice" -*PageSize X48MMY3276MM/58mm x 3276mm: "<>setpagedevice" - -*CloseUI: *PageSize - -*OpenUI *PageRegion: PickOne -*OrderDependency: 10 AnySetup *PageRegion -*DefaultPageRegion: X48mmY105mm - -*PageRegion X48MMY105MM/58mm x 105mm: "<>setpagedevice" -*PageRegion X48MMY210MM/58mm x 210mm: "<>setpagedevice" -*PageRegion X48MMY297MM/58mm x 297mm: "<>setpagedevice" -*PageRegion X48MMY3276MM/58mm x 3276mm: "<>setpagedevice" - -*DefaultImageableArea: X48MMY105MM - -*ImageableArea X48MMY105MM: "0 0 136 298" -*ImageableArea X48MMY210MM: "0 0 136 595" -*ImageableArea X48MMY297MM: "0 0 136 842" -*ImageableArea X48MMY3276MM: "0 0 136 9286" - -*DefaultPaperDimension: X48MMY105MM - -*PaperDimension X48MMY105MM: "136 298" -*PaperDimension X48MMY210MM: "136 595" -*PaperDimension X48MMY297MM: "136 842" -*PaperDimension X48MMY3276MM: "136 9286" - -*MaxMediaWidth: "136" -*MaxMediaHeight: "9286" -*HWMargins: 0 0 0 0 -*CustomPageSize True: "pop pop pop <>setpagedevice" -*ParamCustomPageSize Width: 1 points 48 136 -*ParamCustomPageSize Height: 2 points 48 9282 -*ParamCustomPageSize WidthOffset: 3 points 0 0 -*ParamCustomPageSize HeightOffset: 4 points 0 0 -*ParamCustomPageSize Orientation: 5 int 0 0 - -*OpenGroup: CutGroup/Cut Options -*OpenUI *FeedDist/Feed distance after print: PickOne -*DefaultFeedDist: 2feed9mm -*FeedDist 0feed3mm/feed 3mm: "" -*FeedDist 1feed6mm/feed 6mm: "" -*FeedDist 2feed9mm/feed 9mm: "" -*FeedDist 3feed12mm/feed 12mm: "" -*FeedDist 4feed15mm/feed 15mm: "" -*FeedDist 5feed18mm/feed 18mm: "" -*FeedDist 6feed21mm/feed 21mm: "" -*FeedDist 7feed24mm/feed 24mm: "" -*FeedDist 8feed27mm/feed 27mm: "" -*FeedDist 9feed30mm/feed 30mm: "" -*FeedDist 10feed33mm/feed 33mm: "" -*FeedDist 11feed36mm/feed 36mm: "" -*FeedDist 12feed39mm/feed 39mm: "" -*FeedDist 13feed42mm/feed 42mm: "" -*FeedDist 14feed45mm/feed 45mm: "" -*CloseUI: *FeedDist - - -*OpenUI *BlankSpace/Blank space at page's end: PickOne -*DefaultBlankSpace: 1NoPrint -*BlankSpace 0Print/Print: "" -*BlankSpace 1NoPrint/Do not print: "" -*CloseUI: *BlankSpace - -*CloseGroup: *CutGroup - -*OpenGroup: *CashDrawerGroup/Cash Drawer Control -*OpenUI *CashDrawer1Setting/Cash Drawer 1: PickOne -*DefaultCashDrawer1Setting: 0NotCashDrawer1 -*CashDrawer1Setting 0NotCashDrawer1/Not Cash Drawer 1: "" -*CashDrawer1Setting 1NotCashDrawer1BeforePrinting/Cash Drawer 1 Before Printing: "" -*CashDrawer1Setting 2NotCashDrawer1BeforePrinting/Cash Drawer 1 After Printing: "" -*CloseUI: *CashDrawer1Setting - -*OpenUI *CashDrawer2Setting/Cash Drawer 2: PickOne -*DefaultCashDrawer2Setting: 0NotCashDrawer2 -*CashDrawer2Setting 0NotCashDrawer2/Not Cash Drawer 2: "" -*CashDrawer2Setting 1NotCashDrawer2BeforePrinting/Cash Drawer 2 Before Printing: "" -*CashDrawer2Setting 2NotCashDrawer2BeforePrinting/Cash Drawer 2 After Printing: "" -*CloseUI: *CashDrawer2Setting -*CloseGroup: *CashDrawerGroup - - -*% End diff --git a/install b/install index 45e0e08..96576c2 100755 --- a/install +++ b/install @@ -3,6 +3,9 @@ # Installs zj-58 driver # Tested as working under Ubuntu 14.04 +# Deprecated. Don't use this script; +# use build with cmake and then 'make install' instead + /etc/init.d/cups stop cp rastertozj /usr/lib/cups/filter/ mkdir -p /usr/share/cups/model/zjiang diff --git a/rastertozj.c b/rastertozj.c index 0115fbc..2b9bbbe 100644 --- a/rastertozj.c +++ b/rastertozj.c @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include @@ -20,49 +19,44 @@ static inline int min(int a, int b) { // settings and their stuff struct settings_ { - int cashDrawer1; - int cashDrawer2; - int blankSpace; - int feedDist; - int modelNum; + int modelNum; // the only setting we get from PPD. + unsigned CashDrawer1; + unsigned CashDrawer2; + unsigned CashDrawer1On; + unsigned CashDrawer1Off; + unsigned CashDrawer2On; + unsigned CashDrawer2Off; + cups_bool_t InsertSheet; + cups_adv_t AdvanceMedia; + cups_cut_t CutMedia; + unsigned int AdvanceDistance; }; struct settings_ settings; -// get an option -static inline int getOptionChoiceIndex(const char *sChoiceName, - ppd_file_t *pPpd) { - ppd_choice_t *pChoice = ppdFindMarkedChoice(pPpd, sChoiceName); - if (!pChoice) { - ppd_option_t *pOption = ppdFindOption(pPpd, sChoiceName); - if (pOption) - pChoice = ppdFindChoice(pOption, pOption->defchoice); - } - return pChoice ? atoi(pChoice->choice) : -1; -} - static void initializeSettings(char *commandLineOptionSettings, struct settings_ *pSettings) { ppd_file_t *pPpd = ppdOpenFile(getenv("PPD")); - ppdMarkDefaults(pPpd); - // char* sDestination = getenv("DestinationPrinterID"); - - cups_option_t *pOptions = NULL; - int iNumOptions = cupsParseOptions(commandLineOptionSettings, 0, &pOptions); - if (iNumOptions && pOptions) { - cupsMarkOptions(pPpd, iNumOptions, pOptions); - cupsFreeOptions(iNumOptions, pOptions); - } - memset(pSettings, 0, sizeof(struct settings_)); - pSettings->cashDrawer1 = getOptionChoiceIndex("CashDrawer1Setting", pPpd); - pSettings->cashDrawer2 = getOptionChoiceIndex("CashDrawer2Setting", pPpd); - pSettings->blankSpace = getOptionChoiceIndex("BlankSpace", pPpd); - pSettings->feedDist = getOptionChoiceIndex("FeedDist", pPpd); pSettings->modelNum = pPpd->model_number; - ppdClose(pPpd); } +static void update_settings_from_job (cups_page_header2_t * pHeader) +{ + if (!pHeader) + return; + settings.CashDrawer1 = pHeader->cupsInteger[0]; + settings.CashDrawer2 = pHeader->cupsInteger[1]; + settings.CashDrawer1On = pHeader->cupsInteger[2]; + settings.CashDrawer1Off = pHeader->cupsInteger[3]; + settings.CashDrawer2On = pHeader->cupsInteger[4]; + settings.CashDrawer2Off = pHeader->cupsInteger[5]; + settings.InsertSheet = pHeader->cupsInteger[6]; + settings.AdvanceMedia = pHeader->AdvanceMedia; + settings.CutMedia = pHeader->CutMedia; + settings.AdvanceDistance = pHeader->AdvanceDistance; +} + #ifndef DEBUGP static inline void mputchar(char c) { putchar(c); } #define DEBUGSTARTPRINT() @@ -128,17 +122,11 @@ static inline void mputnum(unsigned int val) { * esc '8' - wait{4, cutter also (char[4]){29,'V','A',20}}; GS V 'A' 20 */ -/* todo: - * generate pulse by esc p 0/ esc p 1/ - * XPrinter 58 - */ - // define printer initialize command static const char escInit[] = "\x1b@"; // define cashDrawerEjector command -static const char escCashDrawer1Eject[] = "\x1bp\0@P"; -static const char escCashDrawer2Eject[] = "\x1bp\1@P"; +static const char escCashDrawerEject[] = "\x1bp"; // define raster mode start command static const char escRasterMode[] = "\x1dv0\0"; @@ -147,9 +135,8 @@ static const char escRasterMode[] = "\x1dv0\0"; static const char escFlush[] = "\x1bJ"; // define cut command -static const char escCut[] = "\x1bi"; - -static const char getStatus[] = "\x10\x04\x04"; +//static const char escCut[] = "\x1bi"; +static const char escCut[] = "\x1dV\1"; // enter raster mode and set up x and y dimensions static inline void sendRasterHeader(int xsize, int ysize) { @@ -173,6 +160,7 @@ static inline void flushBuffer() { // flush, then feed 24 lines static inline void flushManyLines(int iLines) { + DEBUGPRINT("Skip %d empty lines: ", iLines); while ( iLines ) { int iStride = min (iLines, 24); @@ -181,21 +169,35 @@ static inline void flushManyLines(int iLines) } } +inline static void CashDrawerEject (unsigned iDrawer, unsigned iOn, + unsigned iOff) +{ + SendCommand(escCashDrawerEject); + mputchar(iDrawer); + mputchar(iOn); + mputchar(iOff); +} + +inline static void cutMedia() +{ + SendCommand(escCut); +} + // sent on the beginning of print job void setupJob() { SendCommand(escInit); - if (settings.cashDrawer1 == 1) - SendCommand(escCashDrawer1Eject); - if (settings.cashDrawer2 == 1) - SendCommand(escCashDrawer2Eject); + if (settings.CashDrawer1 == 1) + CashDrawerEject(0,settings.CashDrawer1On,settings.CashDrawer1Off); + if (settings.CashDrawer2 == 1) + CashDrawerEject(1, settings.CashDrawer2On, settings.CashDrawer2Off); } // sent at the very end of print job void finalizeJob() { - if (settings.cashDrawer1 == 2) - SendCommand(escCashDrawer1Eject); - if (settings.cashDrawer2 == 2) - SendCommand(escCashDrawer2Eject); + if (settings.CashDrawer1 == 2) + CashDrawerEject(0, settings.CashDrawer1On, settings.CashDrawer1Off); + if (settings.CashDrawer2 == 2) + CashDrawerEject(1, settings.CashDrawer2On, settings.CashDrawer2Off); // SendCommand(escInit); } @@ -338,8 +340,10 @@ static inline void send_raster(const unsigned char *pBuf, int width8, int height) { if (!height) return; + DEBUGPRINT("Raster block %dx%d pixels\n", width8*8, height); sendRasterHeader(width8, height); outputarray((char *)pBuf, width8 * height); + flushBuffer(); } #define EXITPRINT(CODE) \ @@ -383,21 +387,26 @@ int main(int argc, char *argv[]) { DEBUGPRINT("ModelNumber from PPD '%d'\n", settings.modelNum); // set max num of pixels per line depended from model number (from ppd) - int iMaxWidth; - switch ( settings.modelNum ) - { - case 80: iMaxWidth = 0x240; break; - case 58: iMaxWidth = 0x180; break; - default: iMaxWidth = 0x180; break; - } + int iMaxWidth = settings.modelNum; + if (!iMaxWidth) + iMaxWidth = 0x240; - setupJob(); + // postpone start of the job until we parse first header and get necessary values from there. + int iJobStarted = 0; // loop over the whole raster, page by page while (cupsRasterReadHeader2(pRasterSrc, &tHeader)) { if ((!tHeader.cupsHeight) || (!tHeader.cupsBytesPerLine)) break; + update_settings_from_job( &tHeader ); + + if (!iJobStarted) + { + setupJob(); + iJobStarted = 1; + } + DebugPrintHeader ( &tHeader ); if (!pRasterBuf) { @@ -429,7 +438,7 @@ int main(int argc, char *argv[]) { int iBlockHeight = min(iRowsToPrint, 24); - DEBUGPRINT("Processing block of %d, starting from %d lines\n", + DEBUGPRINT("--------Processing block of %d, starting from %d lines", iBlockHeight, tHeader.cupsHeight - iRowsToPrint); iRowsToPrint -= iBlockHeight; @@ -440,14 +449,23 @@ int main(int argc, char *argv[]) { iBytesChunk = cupsRasterReadPixels( pRasterSrc, pRasterBuf, tHeader.cupsBytesPerLine * iBlockHeight); + DEBUGPRINT("--------Got %d from %d requested bytes", + iBytesChunk, + tHeader.cupsBytesPerLine * + iBlockHeight); + // if original image is wider - rearrange buffer so that our calculated // lines come one-by-one without extra gaps - if (width_bytes < tHeader.cupsBytesPerLine) + if (width_bytes < tHeader.cupsBytesPerLine) { + DEBUGPRINT("--------Compress line from %d to %d bytes", tHeader.cupsBytesPerLine, width_bytes); iBytesChunk = compress_buffer(pRasterBuf, iBytesChunk, tHeader.cupsBytesPerLine, width_bytes); + } // runaround for sometimes truncated output of cupsRasterReadPixels if (iBytesChunk < width_bytes * iBlockHeight) { + DEBUGPRINT("--------Restore truncated gap of %d bytes", + width_bytes * iBlockHeight - iBytesChunk); memset(pRasterBuf + iBytesChunk, 0, width_bytes * iBlockHeight - iBytesChunk); iBytesChunk = width_bytes * iBlockHeight; @@ -469,7 +487,7 @@ int main(int argc, char *argv[]) { ++zeroy; } else { if (zeroy) { // met non-zero, need to feed calculated num of zero lines - flushLines(zeroy); + flushManyLines(zeroy); zeroy=0; } if (!nonzerolines) @@ -479,17 +497,28 @@ int main(int argc, char *argv[]) { pBuf += width_bytes; } send_raster(pChunk, width_bytes, nonzerolines); - flushBuffer(); + //flushBuffer(); } // loop over page // page is finished. // m.b. we have to print empty tail at the end - if (settings.blankSpace) + if (settings.InsertSheet) flushManyLines (zeroy); - flushManyLines(settings.feedDist * 24); + if (settings.AdvanceMedia == CUPS_ADVANCE_PAGE) + flushManyLines(settings.AdvanceDistance); + + if (settings.CutMedia == CUPS_CUT_PAGE) + cutMedia(); + finishPage(); - } + } // loop over all pages pages + + if (settings.AdvanceMedia==CUPS_ADVANCE_JOB) + flushManyLines(settings.AdvanceDistance); + + if (settings.CutMedia == CUPS_CUT_JOB) + cutMedia(); finalizeJob(); fputs(iCurrentPage ? "INFO: Ready to print.\n" : "ERROR: No pages found!\n", diff --git a/zj-58.drv b/zj-58.drv deleted file mode 100644 index a0fa28a..0000000 --- a/zj-58.drv +++ /dev/null @@ -1,138 +0,0 @@ -// CUPS PPD Compiler CUPS v2.1.3 -// (Don't edit .ppd directly, edit this file instead, then use -// ppdc zj-58.drv to generate zj58.ppd) - -// Zijiang ZJ-58 -{ - Manufacturer "Zijiang" - ModelName "ZJ-58" - PCFileName "zj58.ppd" - Version "1.2" - DriverType custom - ModelNumber 58 - ManualCopies Yes - Throughput 1 - Attribute "NickName" "" "Zijiang ZJ-58" - Attribute "ShortNickName" "" "ZJ-58" - Attribute "Product" "" "(zj-58)" - Attribute "1284DeviceID" "" "MFG:Zijiang;CMD:Zijiang;MDL:ZJ-58;CLS:PRINTER;" - Attribute "PSVersion" "" "(3010.000) 550" - Attribute "LanguageLevel" "" "3" - Attribute "DefaultColorSpace" "" "Gray" - Attribute "FileSystem" "" "False" - Attribute "LandscapeOrientation" "" "Plus90" - Attribute "TTRasterizer" "" "Type42" - Attribute "VariablePaperSize" "" "True" - Filter "application/vnd.cups-raster 100 rastertozj" - ColorDevice False - - Option "Resolution/Resolution" PickOne AnySetup 10 - *Choice "203x203dpi/203 DPI Grayscale" "<>setpagedevice" - - // Custom page sizes - VariablePaperSize Yes - MinSize 164 56 - MaxSize 164 9286 - //MinSize 226 56 // that is for 80mm (72mm printable) - //MaxSize 226 9286 - HWMargins 14 0 14 0 - - *CustomMedia "X58MMY65MM/58mm x 65mm" 164 182 14 0 14 0 "<>setpagedevice" "<>setpagedevice" - CustomMedia "X58MMY105MM/58mm x 105mm" 164 298 14 0 14 0 "<>setpagedevice" "<>setpagedevice" - CustomMedia "X58MMY210MM/58mm x 210mm" 164 595 14 0 14 0 "<>setpagedevice" "<>setpagedevice" - CustomMedia "X58MMY297MM/58mm x 297mm" 164 842 14 0 14 0 "<>setpagedevice" "<>setpagedevice" - CustomMedia "X58MMY3276MM/58mm x 3276mm" 164 9286 14 0 14 0 "<>setpagedevice" "<>setpagedevice" - - Group "BlankGroup/Blank Options" - Option "FeedDist/Feed distance after print" PickOne AnySetup 10 - Choice "0feed3mm/feed 3mm" "<>setpagedevice" - Choice "1feed6mm/feed 6mm" "<>setpagedevice" - *Choice "2feed9mm/feed 9mm" "<>setpagedevice" - Choice "3feed12mm/feed 12mm" "<>setpagedevice" - Choice "4feed15mm/feed 15mm" "<>setpagedevice" - Choice "5feed18mm/feed 18mm" "<>setpagedevice" - Choice "6feed21mm/feed 21mm" "<>setpagedevice" - Choice "7feed24mm/feed 24mm" "<>setpagedevice" - Choice "8feed27mm/feed 27mm" "<>setpagedevice" - Choice "9feed30mm/feed 30mm" "<>setpagedevice" - Choice "10feed33mm/feed 33mm" "<>setpagedevice" - Choice "11feed36mm/feed 36mm" "<>setpagedevice" - Choice "12feed39mm/feed 39mm" "<>setpagedevice" - Choice "13feed42mm/feed 42mm" "<>setpagedevice" - Choice "14feed45mm/feed 45mm" "<>setpagedevice" - - Option "BlankSpace/Blank space at page's end" Boolean AnySetup 10 - Choice "True/Print" "<>setpagedevice" - *Choice "False/None" "<>setpagedevice" - - Group "*CashDrawerGroup/Cash Drawer Control" - Option "CashDrawer1Setting/Cash Drawer 1" PickOne AnySetup 10 - *Choice "None/None" "<>setpagedevice" - Choice "1BeforePrinting/Before Printing" "<>setpagedevice" - Choice "1AfterPrinting/After Printing" "<>setpagedevice" - - Option "CashDrawer2Setting/Cash Drawer 2" PickOne AnySetup 10 - *Choice "None/None" "<>setpagedevice" - Choice "2BeforePrinting/Before Printing" "<>setpagedevice" - Choice "2AfterPrinting/After Printing" "<>setpagedevice" - - Group "*CashDrawerTune/Cash Drawer Tune" - Option "CashDrawer1PulseOn/Cash Drawer 1 pulse ON time" PickOne AnySetup 10 - Choice "None/None" "" - Choice "10XMS/32mS" "<>setpagedevice" - Choice "20XMS/64mS" "<>setpagedevice" - Choice "30XMS/96mS" "<>setpagedevice" - *Choice "40XMS/128mS" "<>setpagedevice" - Choice "50XMS/160mS" "<>setpagedevice" - Choice "60XMS/192mS" "<>setpagedevice" - Choice "70XMS/224mS" "<>setpagedevice" - Choice "80XMS/256mS" "<>setpagedevice" - - Option "CashDrawer1PulseOff/Cash Drawer 1 pulse OFF time" PickOne AnySetup 10 - Choice "None/None" "" - Choice "10XMS/32mS" "<>setpagedevice" - Choice "20XMS/64mS" "<>setpagedevice" - Choice "30XMS/96mS" "<>setpagedevice" - Choice "40XMS/128mS" "<>setpagedevice" - *Choice "50XMS/160mS" "<>setpagedevice" - Choice "60XMS/192mS" "<>setpagedevice" - Choice "70XMS/224mS" "<>setpagedevice" - Choice "80XMS/256mS" "<>setpagedevice" - - Option "CashDrawer2PulseOn/Cash Drawer 2 pulse ON time" PickOne AnySetup 10 - Choice "None/None" "" - Choice "10XMS/32mS" "<>setpagedevice" - Choice "20XMS/64mS" "<>setpagedevice" - Choice "30XMS/96mS" "<>setpagedevice" - *Choice "40XMS/128mS" "<>setpagedevice" - Choice "50XMS/160mS" "<>setpagedevice" - Choice "60XMS/192mS" "<>setpagedevice" - Choice "70XMS/224mS" "<>setpagedevice" - Choice "80XMS/256mS" "<>setpagedevice" - - Option "CashDrawer2PulseOff/Cash Drawer 2 pulse OFF time" PickOne AnySetup 10 - Choice "None/None" "" - Choice "10XMS/32mS" "<>setpagedevice" - Choice "20XMS/64mS" "<>setpagedevice" - Choice "30XMS/96mS" "<>setpagedevice" - Choice "40XMS/128mS" "<>setpagedevice" - *Choice "50XMS/160mS" "<>setpagedevice" - Choice "60XMS/192mS" "<>setpagedevice" - Choice "70XMS/224mS" "<>setpagedevice" - Choice "80XMS/256mS" "<>setpagedevice" - - - Installable "OptionCash1/Cash drawer 1" - UIConstraints "*CashDrawer1Setting *OptionCash1 False" -// UIConstraints "*CashDrawer1PulseOn *OptionCash1 False" -// UIConstraints "*CashDrawer1PulseOff *OptionCash1 False" - - Installable "OptionCash2/Cash drawer 2" - UIConstraints "*CashDrawer2Setting *OptionCash2 False" -// UIConstraints "*CashDrawer2PulseOn *OptionCash2 False" -// UIConstraints "*CashDrawer2PulseOff *OptionCash2 False" - - Cutter true - Installable "OptionCutter/Cutter" - UIConstraints "*CutMedia *OptionCutter False" -} diff --git a/zj58.ppd b/zj58.ppd new file mode 100644 index 0000000..737f433 --- /dev/null +++ b/zj58.ppd @@ -0,0 +1,212 @@ +*PPD-Adobe: "4.3" +*%%%% PPD file for ZJ-58 with CUPS. +*%%%% Created by the CUPS PPD Compiler CUPS v2.2.7. +*FormatVersion: "4.3" +*FileVersion: "1.2" +*LanguageVersion: English +*LanguageEncoding: ISOLatin1 +*PCFileName: "zj58.ppd" +*Product: "(zj-58)" +*Manufacturer: "Zijiang" +*ModelName: "Zijiang ZJ-58" +*ShortNickName: "ZJ-58" +*NickName: "Zijiang ZJ-58" +*PSVersion: "(3010.000) 550" +*LanguageLevel: "3" +*ColorDevice: False +*DefaultColorSpace: Gray +*FileSystem: False +*Throughput: "1" +*LandscapeOrientation: Plus90 +*TTRasterizer: Type42 +*% Driver-defined attributes... +*VariablePaperSize: True +*1284DeviceID: "MFG:Zijiang;CMD:Zijiang;MDL:ZJ-58;CLS:PRINTER;" +*cupsVersion: 2.2 +*cupsModelNumber: 384 +*cupsManualCopies: True +*cupsFilter: "application/vnd.cups-raster 100 rastertozj" +*cupsLanguages: "en" +*UIConstraints: *CashDrawer1Setting *OptionCash1 False +*UIConstraints: *OptionCash1 False *CashDrawer1Setting +*UIConstraints: *CashDrawer2Setting *OptionCash2 False +*UIConstraints: *OptionCash2 False *CashDrawer2Setting +*UIConstraints: *CutMedia *OptionCutter False +*UIConstraints: *OptionCutter False *CutMedia +*OpenUI *PageSize/Media Size: PickOne +*OrderDependency: 10 AnySetup *PageSize +*DefaultPageSize: X48MMY65MM +*PageSize X48MMY65MM/58mm x 65mm: "<>setpagedevice" +*PageSize X48MMY105MM/58mm x 105mm: "<>setpagedevice" +*PageSize X48MMY210MM/58mm x 210mm: "<>setpagedevice" +*PageSize X48MMY297MM/58mm x 297mm: "<>setpagedevice" +*PageSize X48MMY3276MM/58mm x 3276mm: "<>setpagedevice" +*CloseUI: *PageSize +*OpenUI *PageRegion/Media Size: PickOne +*OrderDependency: 10 AnySetup *PageRegion +*DefaultPageRegion: X48MMY65MM +*PageRegion X48MMY65MM/58mm x 65mm: "<>setpagedevice" +*PageRegion X48MMY105MM/58mm x 105mm: "<>setpagedevice" +*PageRegion X48MMY210MM/58mm x 210mm: "<>setpagedevice" +*PageRegion X48MMY297MM/58mm x 297mm: "<>setpagedevice" +*PageRegion X48MMY3276MM/58mm x 3276mm: "<>setpagedevice" +*CloseUI: *PageRegion +*DefaultImageableArea: X48MMY65MM +*ImageableArea X48MMY65MM/58mm x 65mm: "14 0 150 182" +*ImageableArea X48MMY105MM/58mm x 105mm: "14 0 150 298" +*ImageableArea X48MMY210MM/58mm x 210mm: "14 0 150 595" +*ImageableArea X48MMY297MM/58mm x 297mm: "14 0 150 842" +*ImageableArea X48MMY3276MM/58mm x 3276mm: "14 0 150 9286" +*DefaultPaperDimension: X48MMY65MM +*PaperDimension X48MMY65MM/58mm x 65mm: "164 182" +*PaperDimension X48MMY105MM/58mm x 105mm: "164 298" +*PaperDimension X48MMY210MM/58mm x 210mm: "164 595" +*PaperDimension X48MMY297MM/58mm x 297mm: "164 842" +*PaperDimension X48MMY3276MM/58mm x 3276mm: "164 9286" +*MaxMediaWidth: "164" +*MaxMediaHeight: "9286" +*HWMargins: 14 0 14 0 +*CustomPageSize True: "pop pop pop <>setpagedevice" +*ParamCustomPageSize Width: 1 points 164 164 +*ParamCustomPageSize Height: 2 points 56 9286 +*ParamCustomPageSize WidthOffset: 3 points 0 0 +*ParamCustomPageSize HeightOffset: 4 points 0 0 +*ParamCustomPageSize Orientation: 5 int 0 0 +*OpenUI *CutMedia/Cut Media: PickOne +*OrderDependency: 10 AnySetup *CutMedia +*DefaultCutMedia: None +*CutMedia None/No cutting: "<>setpagedevice" +*CutMedia EndOfPage/Cut at every page: "<>setpagedevice" +*CutMedia EndOfJob/Cut at every job: "<>setpagedevice" +*CloseUI: *CutMedia +*OpenGroup: InstallableOptions/Installable Options +*OpenUI *OptionCash1/Cash drawer 1: Boolean +*OrderDependency: 10 AnySetup *OptionCash1 +*DefaultOptionCash1: False +*OptionCash1 False/Not Installed: "" +*OptionCash1 True/Installed: "" +*CloseUI: *OptionCash1 +*OpenUI *OptionCash2/Cash drawer 2: Boolean +*OrderDependency: 10 AnySetup *OptionCash2 +*DefaultOptionCash2: False +*OptionCash2 False/Not Installed: "" +*OptionCash2 True/Installed: "" +*CloseUI: *OptionCash2 +*OpenUI *OptionCutter/Cutter: Boolean +*OrderDependency: 10 AnySetup *OptionCutter +*DefaultOptionCutter: False +*OptionCutter False/Not Installed: "" +*OptionCutter True/Installed: "" +*CloseUI: *OptionCutter +*CloseGroup: InstallableOptions +*OpenGroup: BlankGroup/Blank Options +*OpenUI *FeedDist/Feed distance: PickOne +*OrderDependency: 10 AnySetup *FeedDist +*DefaultFeedDist: 2feed9mm +*FeedDist 0feed3mm/3mm: "<>setpagedevice" +*FeedDist 1feed6mm/6mm: "<>setpagedevice" +*FeedDist 2feed9mm/9mm: "<>setpagedevice" +*FeedDist 3feed12mm/12mm: "<>setpagedevice" +*FeedDist 4feed15mm/15mm: "<>setpagedevice" +*FeedDist 5feed18mm/18mm: "<>setpagedevice" +*FeedDist 6feed21mm/21mm: "<>setpagedevice" +*FeedDist 7feed24mm/24mm: "<>setpagedevice" +*FeedDist 8feed27mm/27mm: "<>setpagedevice" +*FeedDist 9feed30mm/30mm: "<>setpagedevice" +*FeedDist 10feed33mm/33mm: "<>setpagedevice" +*FeedDist 11feed36mm/36mm: "<>setpagedevice" +*FeedDist 12feed39mm/39mm: "<>setpagedevice" +*FeedDist 13feed42mm/42mm: "<>setpagedevice" +*FeedDist 14feed45mm/45mm: "<>setpagedevice" +*CloseUI: *FeedDist +*OpenUI *FeedWhere/When to feed: PickOne +*OrderDependency: 10 AnySetup *FeedWhere +*DefaultFeedWhere: AfterJob +*FeedWhere None/Never: "" +*FeedWhere AfterPage/After each page: "<>setpagedevice" +*FeedWhere AfterJob/After whole printing: "<>setpagedevice" +*CloseUI: *FeedWhere +*OpenUI *BlankSpace/Blank space at page's end: Boolean +*OrderDependency: 10 AnySetup *BlankSpace +*DefaultBlankSpace: False +*BlankSpace True/Print: "<>setpagedevice" +*BlankSpace False/None: "<>setpagedevice" +*CloseUI: *BlankSpace +*CloseGroup: BlankGroup +*OpenGroup: *CashDrawerGroup/Cash Drawer Control +*OpenUI *CashDrawer1Setting/Cash Drawer 1: PickOne +*OrderDependency: 10 DocumentSetup *CashDrawer1Setting +*DefaultCashDrawer1Setting: None +*CashDrawer1Setting None/None: "<>setpagedevice" +*CashDrawer1Setting 1BeforePrinting/Before Printing: "<>setpagedevice" +*CashDrawer1Setting 1AfterPrinting/After Printing: "<>setpagedevice" +*CloseUI: *CashDrawer1Setting +*OpenUI *CashDrawer2Setting/Cash Drawer 2: PickOne +*OrderDependency: 10 DocumentSetup *CashDrawer2Setting +*DefaultCashDrawer2Setting: None +*CashDrawer2Setting None/None: "<>setpagedevice" +*CashDrawer2Setting 2BeforePrinting/Before Printing: "<>setpagedevice" +*CashDrawer2Setting 2AfterPrinting/After Printing: "<>setpagedevice" +*CloseUI: *CashDrawer2Setting +*CloseGroup: *CashDrawerGroup +*OpenGroup: *CashDrawerTune/Cash Drawer Tune +*OpenUI *CashDrawer1PulseOn/Cash Drawer 1 pulse ON time: PickOne +*OrderDependency: 9 DocumentSetup *CashDrawer1PulseOn +*DefaultCashDrawer1PulseOn: 40XMS +*CashDrawer1PulseOn None/None: "" +*CashDrawer1PulseOn 10XMS/32mS: "<>setpagedevice" +*CashDrawer1PulseOn 20XMS/64mS: "<>setpagedevice" +*CashDrawer1PulseOn 30XMS/96mS: "<>setpagedevice" +*CashDrawer1PulseOn 40XMS/128mS: "<>setpagedevice" +*CashDrawer1PulseOn 50XMS/160mS: "<>setpagedevice" +*CashDrawer1PulseOn 60XMS/192mS: "<>setpagedevice" +*CashDrawer1PulseOn 70XMS/224mS: "<>setpagedevice" +*CashDrawer1PulseOn 80XMS/256mS: "<>setpagedevice" +*CloseUI: *CashDrawer1PulseOn +*OpenUI *CashDrawer1PulseOff/Cash Drawer 1 pulse OFF time: PickOne +*OrderDependency: 9 DocumentSetup *CashDrawer1PulseOff +*DefaultCashDrawer1PulseOff: 50XMS +*CashDrawer1PulseOff None/None: "" +*CashDrawer1PulseOff 10XMS/32mS: "<>setpagedevice" +*CashDrawer1PulseOff 20XMS/64mS: "<>setpagedevice" +*CashDrawer1PulseOff 30XMS/96mS: "<>setpagedevice" +*CashDrawer1PulseOff 40XMS/128mS: "<>setpagedevice" +*CashDrawer1PulseOff 50XMS/160mS: "<>setpagedevice" +*CashDrawer1PulseOff 60XMS/192mS: "<>setpagedevice" +*CashDrawer1PulseOff 70XMS/224mS: "<>setpagedevice" +*CashDrawer1PulseOff 80XMS/256mS: "<>setpagedevice" +*CloseUI: *CashDrawer1PulseOff +*OpenUI *CashDrawer2PulseOn/Cash Drawer 2 pulse ON time: PickOne +*OrderDependency: 9 DocumentSetup *CashDrawer2PulseOn +*DefaultCashDrawer2PulseOn: 40XMS +*CashDrawer2PulseOn None/None: "" +*CashDrawer2PulseOn 10XMS/32mS: "<>setpagedevice" +*CashDrawer2PulseOn 20XMS/64mS: "<>setpagedevice" +*CashDrawer2PulseOn 30XMS/96mS: "<>setpagedevice" +*CashDrawer2PulseOn 40XMS/128mS: "<>setpagedevice" +*CashDrawer2PulseOn 50XMS/160mS: "<>setpagedevice" +*CashDrawer2PulseOn 60XMS/192mS: "<>setpagedevice" +*CashDrawer2PulseOn 70XMS/224mS: "<>setpagedevice" +*CashDrawer2PulseOn 80XMS/256mS: "<>setpagedevice" +*CloseUI: *CashDrawer2PulseOn +*OpenUI *CashDrawer2PulseOff/Cash Drawer 2 pulse OFF time: PickOne +*OrderDependency: 9 DocumentSetup *CashDrawer2PulseOff +*DefaultCashDrawer2PulseOff: 50XMS +*CashDrawer2PulseOff None/None: "" +*CashDrawer2PulseOff 10XMS/32mS: "<>setpagedevice" +*CashDrawer2PulseOff 20XMS/64mS: "<>setpagedevice" +*CashDrawer2PulseOff 30XMS/96mS: "<>setpagedevice" +*CashDrawer2PulseOff 40XMS/128mS: "<>setpagedevice" +*CashDrawer2PulseOff 50XMS/160mS: "<>setpagedevice" +*CashDrawer2PulseOff 60XMS/192mS: "<>setpagedevice" +*CashDrawer2PulseOff 70XMS/224mS: "<>setpagedevice" +*CashDrawer2PulseOff 80XMS/256mS: "<>setpagedevice" +*CloseUI: *CashDrawer2PulseOff +*OpenUI *Resolution/Resolution: PickOne +*OrderDependency: 10 AnySetup *Resolution +*DefaultResolution: 203x203dpi +*Resolution 203x203dpi/203 DPI Grayscale: "<>setpagedevice" +*CloseUI: *Resolution +*CloseGroup: *CashDrawerTune +*DefaultFont: Courier +*% End of zj58.ppd, 10245 bytes. diff --git a/zj80.ppd b/zj80.ppd new file mode 100644 index 0000000..6ac713d --- /dev/null +++ b/zj80.ppd @@ -0,0 +1,212 @@ +*PPD-Adobe: "4.3" +*%%%% PPD file for ZJ-80 with CUPS. +*%%%% Created by the CUPS PPD Compiler CUPS v2.2.7. +*FormatVersion: "4.3" +*FileVersion: "1.2" +*LanguageVersion: English +*LanguageEncoding: ISOLatin1 +*PCFileName: "zj80.ppd" +*Product: "(zj-80)" +*Manufacturer: "Zijiang" +*ModelName: "Zijiang ZJ-80" +*ShortNickName: "ZJ-80" +*NickName: "Zijiang ZJ-80" +*PSVersion: "(3010.000) 550" +*LanguageLevel: "3" +*ColorDevice: False +*DefaultColorSpace: Gray +*FileSystem: False +*Throughput: "1" +*LandscapeOrientation: Plus90 +*TTRasterizer: Type42 +*% Driver-defined attributes... +*VariablePaperSize: True +*1284DeviceID: "MFG:Zijiang;CMD:Zijiang;MDL:ZJ-80;CLS:PRINTER;" +*cupsVersion: 2.2 +*cupsModelNumber: 560 +*cupsManualCopies: True +*cupsFilter: "application/vnd.cups-raster 100 rastertozj" +*cupsLanguages: "en" +*UIConstraints: *CashDrawer1Setting *OptionCash1 False +*UIConstraints: *OptionCash1 False *CashDrawer1Setting +*UIConstraints: *CashDrawer2Setting *OptionCash2 False +*UIConstraints: *OptionCash2 False *CashDrawer2Setting +*UIConstraints: *CutMedia *OptionCutter False +*UIConstraints: *OptionCutter False *CutMedia +*OpenUI *PageSize/Media Size: PickOne +*OrderDependency: 10 AnySetup *PageSize +*DefaultPageSize: X70MMY65MM +*PageSize X70MMY65MM/80mm x 65mm: "<>setpagedevice" +*PageSize X70MMY105MM/80mm x 105mm: "<>setpagedevice" +*PageSize X70MMY210MM/80mm x 210mm: "<>setpagedevice" +*PageSize X70MMY297MM/80mm x 297mm: "<>setpagedevice" +*PageSize X70MMY3276MM/80mm x 3276mm: "<>setpagedevice" +*CloseUI: *PageSize +*OpenUI *PageRegion/Media Size: PickOne +*OrderDependency: 10 AnySetup *PageRegion +*DefaultPageRegion: X70MMY65MM +*PageRegion X70MMY65MM/80mm x 65mm: "<>setpagedevice" +*PageRegion X70MMY105MM/80mm x 105mm: "<>setpagedevice" +*PageRegion X70MMY210MM/80mm x 210mm: "<>setpagedevice" +*PageRegion X70MMY297MM/80mm x 297mm: "<>setpagedevice" +*PageRegion X70MMY3276MM/80mm x 3276mm: "<>setpagedevice" +*CloseUI: *PageRegion +*DefaultImageableArea: X70MMY65MM +*ImageableArea X70MMY65MM/80mm x 65mm: "14 0 212 182" +*ImageableArea X70MMY105MM/80mm x 105mm: "14 0 212 298" +*ImageableArea X70MMY210MM/80mm x 210mm: "14 0 212 595" +*ImageableArea X70MMY297MM/80mm x 297mm: "14 0 212 842" +*ImageableArea X70MMY3276MM/80mm x 3276mm: "14 0 212 9286" +*DefaultPaperDimension: X70MMY65MM +*PaperDimension X70MMY65MM/80mm x 65mm: "226 182" +*PaperDimension X70MMY105MM/80mm x 105mm: "226 298" +*PaperDimension X70MMY210MM/80mm x 210mm: "226 595" +*PaperDimension X70MMY297MM/80mm x 297mm: "226 842" +*PaperDimension X70MMY3276MM/80mm x 3276mm: "226 9286" +*MaxMediaWidth: "226" +*MaxMediaHeight: "9286" +*HWMargins: 14 0 14 0 +*CustomPageSize True: "pop pop pop <>setpagedevice" +*ParamCustomPageSize Width: 1 points 226 226 +*ParamCustomPageSize Height: 2 points 56 9286 +*ParamCustomPageSize WidthOffset: 3 points 0 0 +*ParamCustomPageSize HeightOffset: 4 points 0 0 +*ParamCustomPageSize Orientation: 5 int 0 0 +*OpenUI *CutMedia/Cut Media: PickOne +*OrderDependency: 10 AnySetup *CutMedia +*DefaultCutMedia: None +*CutMedia None/No cutting: "<>setpagedevice" +*CutMedia EndOfPage/Cut at every page: "<>setpagedevice" +*CutMedia EndOfJob/Cut at every job: "<>setpagedevice" +*CloseUI: *CutMedia +*OpenGroup: InstallableOptions/Installable Options +*OpenUI *OptionCash1/Cash drawer 1: Boolean +*OrderDependency: 10 AnySetup *OptionCash1 +*DefaultOptionCash1: False +*OptionCash1 False/Not Installed: "" +*OptionCash1 True/Installed: "" +*CloseUI: *OptionCash1 +*OpenUI *OptionCash2/Cash drawer 2: Boolean +*OrderDependency: 10 AnySetup *OptionCash2 +*DefaultOptionCash2: False +*OptionCash2 False/Not Installed: "" +*OptionCash2 True/Installed: "" +*CloseUI: *OptionCash2 +*OpenUI *OptionCutter/Cutter: Boolean +*OrderDependency: 10 AnySetup *OptionCutter +*DefaultOptionCutter: False +*OptionCutter False/Not Installed: "" +*OptionCutter True/Installed: "" +*CloseUI: *OptionCutter +*CloseGroup: InstallableOptions +*OpenGroup: BlankGroup/Blank Options +*OpenUI *FeedDist/Feed distance: PickOne +*OrderDependency: 10 AnySetup *FeedDist +*DefaultFeedDist: 2feed9mm +*FeedDist 0feed3mm/3mm: "<>setpagedevice" +*FeedDist 1feed6mm/6mm: "<>setpagedevice" +*FeedDist 2feed9mm/9mm: "<>setpagedevice" +*FeedDist 3feed12mm/12mm: "<>setpagedevice" +*FeedDist 4feed15mm/15mm: "<>setpagedevice" +*FeedDist 5feed18mm/18mm: "<>setpagedevice" +*FeedDist 6feed21mm/21mm: "<>setpagedevice" +*FeedDist 7feed24mm/24mm: "<>setpagedevice" +*FeedDist 8feed27mm/27mm: "<>setpagedevice" +*FeedDist 9feed30mm/30mm: "<>setpagedevice" +*FeedDist 10feed33mm/33mm: "<>setpagedevice" +*FeedDist 11feed36mm/36mm: "<>setpagedevice" +*FeedDist 12feed39mm/39mm: "<>setpagedevice" +*FeedDist 13feed42mm/42mm: "<>setpagedevice" +*FeedDist 14feed45mm/45mm: "<>setpagedevice" +*CloseUI: *FeedDist +*OpenUI *FeedWhere/When to feed: PickOne +*OrderDependency: 10 AnySetup *FeedWhere +*DefaultFeedWhere: AfterJob +*FeedWhere None/Never: "" +*FeedWhere AfterPage/After each page: "<>setpagedevice" +*FeedWhere AfterJob/After whole printing: "<>setpagedevice" +*CloseUI: *FeedWhere +*OpenUI *BlankSpace/Blank space at page's end: Boolean +*OrderDependency: 10 AnySetup *BlankSpace +*DefaultBlankSpace: False +*BlankSpace True/Print: "<>setpagedevice" +*BlankSpace False/None: "<>setpagedevice" +*CloseUI: *BlankSpace +*CloseGroup: BlankGroup +*OpenGroup: *CashDrawerGroup/Cash Drawer Control +*OpenUI *CashDrawer1Setting/Cash Drawer 1: PickOne +*OrderDependency: 10 DocumentSetup *CashDrawer1Setting +*DefaultCashDrawer1Setting: None +*CashDrawer1Setting None/None: "<>setpagedevice" +*CashDrawer1Setting 1BeforePrinting/Before Printing: "<>setpagedevice" +*CashDrawer1Setting 1AfterPrinting/After Printing: "<>setpagedevice" +*CloseUI: *CashDrawer1Setting +*OpenUI *CashDrawer2Setting/Cash Drawer 2: PickOne +*OrderDependency: 10 DocumentSetup *CashDrawer2Setting +*DefaultCashDrawer2Setting: None +*CashDrawer2Setting None/None: "<>setpagedevice" +*CashDrawer2Setting 2BeforePrinting/Before Printing: "<>setpagedevice" +*CashDrawer2Setting 2AfterPrinting/After Printing: "<>setpagedevice" +*CloseUI: *CashDrawer2Setting +*CloseGroup: *CashDrawerGroup +*OpenGroup: *CashDrawerTune/Cash Drawer Tune +*OpenUI *CashDrawer1PulseOn/Cash Drawer 1 pulse ON time: PickOne +*OrderDependency: 9 DocumentSetup *CashDrawer1PulseOn +*DefaultCashDrawer1PulseOn: 40XMS +*CashDrawer1PulseOn None/None: "" +*CashDrawer1PulseOn 10XMS/32mS: "<>setpagedevice" +*CashDrawer1PulseOn 20XMS/64mS: "<>setpagedevice" +*CashDrawer1PulseOn 30XMS/96mS: "<>setpagedevice" +*CashDrawer1PulseOn 40XMS/128mS: "<>setpagedevice" +*CashDrawer1PulseOn 50XMS/160mS: "<>setpagedevice" +*CashDrawer1PulseOn 60XMS/192mS: "<>setpagedevice" +*CashDrawer1PulseOn 70XMS/224mS: "<>setpagedevice" +*CashDrawer1PulseOn 80XMS/256mS: "<>setpagedevice" +*CloseUI: *CashDrawer1PulseOn +*OpenUI *CashDrawer1PulseOff/Cash Drawer 1 pulse OFF time: PickOne +*OrderDependency: 9 DocumentSetup *CashDrawer1PulseOff +*DefaultCashDrawer1PulseOff: 50XMS +*CashDrawer1PulseOff None/None: "" +*CashDrawer1PulseOff 10XMS/32mS: "<>setpagedevice" +*CashDrawer1PulseOff 20XMS/64mS: "<>setpagedevice" +*CashDrawer1PulseOff 30XMS/96mS: "<>setpagedevice" +*CashDrawer1PulseOff 40XMS/128mS: "<>setpagedevice" +*CashDrawer1PulseOff 50XMS/160mS: "<>setpagedevice" +*CashDrawer1PulseOff 60XMS/192mS: "<>setpagedevice" +*CashDrawer1PulseOff 70XMS/224mS: "<>setpagedevice" +*CashDrawer1PulseOff 80XMS/256mS: "<>setpagedevice" +*CloseUI: *CashDrawer1PulseOff +*OpenUI *CashDrawer2PulseOn/Cash Drawer 2 pulse ON time: PickOne +*OrderDependency: 9 DocumentSetup *CashDrawer2PulseOn +*DefaultCashDrawer2PulseOn: 40XMS +*CashDrawer2PulseOn None/None: "" +*CashDrawer2PulseOn 10XMS/32mS: "<>setpagedevice" +*CashDrawer2PulseOn 20XMS/64mS: "<>setpagedevice" +*CashDrawer2PulseOn 30XMS/96mS: "<>setpagedevice" +*CashDrawer2PulseOn 40XMS/128mS: "<>setpagedevice" +*CashDrawer2PulseOn 50XMS/160mS: "<>setpagedevice" +*CashDrawer2PulseOn 60XMS/192mS: "<>setpagedevice" +*CashDrawer2PulseOn 70XMS/224mS: "<>setpagedevice" +*CashDrawer2PulseOn 80XMS/256mS: "<>setpagedevice" +*CloseUI: *CashDrawer2PulseOn +*OpenUI *CashDrawer2PulseOff/Cash Drawer 2 pulse OFF time: PickOne +*OrderDependency: 9 DocumentSetup *CashDrawer2PulseOff +*DefaultCashDrawer2PulseOff: 50XMS +*CashDrawer2PulseOff None/None: "" +*CashDrawer2PulseOff 10XMS/32mS: "<>setpagedevice" +*CashDrawer2PulseOff 20XMS/64mS: "<>setpagedevice" +*CashDrawer2PulseOff 30XMS/96mS: "<>setpagedevice" +*CashDrawer2PulseOff 40XMS/128mS: "<>setpagedevice" +*CashDrawer2PulseOff 50XMS/160mS: "<>setpagedevice" +*CashDrawer2PulseOff 60XMS/192mS: "<>setpagedevice" +*CashDrawer2PulseOff 70XMS/224mS: "<>setpagedevice" +*CashDrawer2PulseOff 80XMS/256mS: "<>setpagedevice" +*CloseUI: *CashDrawer2PulseOff +*OpenUI *Resolution/Resolution: PickOne +*OrderDependency: 10 AnySetup *Resolution +*DefaultResolution: 203x203dpi +*Resolution 203x203dpi/203 DPI Grayscale: "<>setpagedevice" +*CloseUI: *Resolution +*CloseGroup: *CashDrawerTune +*DefaultFont: Courier +*% End of zj80.ppd, 10245 bytes. diff --git a/zjdrv.drv b/zjdrv.drv new file mode 100644 index 0000000..49fc364 --- /dev/null +++ b/zjdrv.drv @@ -0,0 +1,216 @@ +// CUPS PPD Compiler CUPS v2.1.3 +// (Don't edit .ppd directly, edit this file instead, then use +// ppdc zj-58.drv to generate zj58.ppd) + +// common for all thermal printers +Version "1.2" +DriverType custom +ManualCopies Yes +Throughput 1 +Attribute "PSVersion" "" "(3010.000) 550" +Attribute "LanguageLevel" "" "3" +Attribute "DefaultColorSpace" "" "Gray" +Attribute "FileSystem" "" "False" +Attribute "LandscapeOrientation" "" "Plus90" +Attribute "TTRasterizer" "" "Type42" +Attribute "VariablePaperSize" "" "True" +Filter "application/vnd.cups-raster 100 rastertozj" +ColorDevice False +VariablePaperSize Yes + +// cutter +Option "CutMedia/Cut Media" PickOne AnySetup 10 + *Choice "None/No cutting" "<>setpagedevice" + Choice "EndOfPage/Cut at every page" "<>setpagedevice" + Choice "EndOfJob/Cut at every job" "<>setpagedevice" + +Group "BlankGroup/Blank Options" + Option "FeedDist/Feed distance" PickOne AnySetup 10 + Choice "0feed3mm/3mm" "<>setpagedevice" + Choice "1feed6mm/6mm" "<>setpagedevice" + *Choice "2feed9mm/9mm" "<>setpagedevice" + Choice "3feed12mm/12mm" "<>setpagedevice" + Choice "4feed15mm/15mm" "<>setpagedevice" + Choice "5feed18mm/18mm" "<>setpagedevice" + Choice "6feed21mm/21mm" "<>setpagedevice" + Choice "7feed24mm/24mm" "<>setpagedevice" + Choice "8feed27mm/27mm" "<>setpagedevice" + Choice "9feed30mm/30mm" "<>setpagedevice" + Choice "10feed33mm/33mm" "<>setpagedevice" + Choice "11feed36mm/36mm" "<>setpagedevice" + Choice "12feed39mm/39mm" "<>setpagedevice" + Choice "13feed42mm/42mm" "<>setpagedevice" + Choice "14feed45mm/45mm" "<>setpagedevice" + + Option "FeedWhere/When to feed" PickOne AnySetup 10 + Choice "None/Never" "" + Choice "AfterPage/After each page" "<>setpagedevice" + *Choice "AfterJob/After whole printing" "<>setpagedevice" + + Option "BlankSpace/Blank space at page's end" Boolean AnySetup 10 + Choice "True/Print" "<>setpagedevice" + *Choice "False/None" "<>setpagedevice" + +Group "*CashDrawerGroup/Cash Drawer Control" + Option "CashDrawer1Setting/Cash Drawer 1" PickOne DocumentSetup 10 + *Choice "None/None" "<>setpagedevice" + Choice "1BeforePrinting/Before Printing" "<>setpagedevice" + Choice "1AfterPrinting/After Printing" "<>setpagedevice" + + Option "CashDrawer2Setting/Cash Drawer 2" PickOne DocumentSetup 10 + *Choice "None/None" "<>setpagedevice" + Choice "2BeforePrinting/Before Printing" "<>setpagedevice" + Choice "2AfterPrinting/After Printing" "<>setpagedevice" + +Group "*CashDrawerTune/Cash Drawer Tune" + Option "CashDrawer1PulseOn/Cash Drawer 1 pulse ON time" PickOne DocumentSetup 9 + Choice "None/None" "" + Choice "10XMS/32mS" "<>setpagedevice" + Choice "20XMS/64mS" "<>setpagedevice" + Choice "30XMS/96mS" "<>setpagedevice" + *Choice "40XMS/128mS" "<>setpagedevice" + Choice "50XMS/160mS" "<>setpagedevice" + Choice "60XMS/192mS" "<>setpagedevice" + Choice "70XMS/224mS" "<>setpagedevice" + Choice "80XMS/256mS" "<>setpagedevice" + + Option "CashDrawer1PulseOff/Cash Drawer 1 pulse OFF time" PickOne DocumentSetup 9 + Choice "None/None" "" + Choice "10XMS/32mS" "<>setpagedevice" + Choice "20XMS/64mS" "<>setpagedevice" + Choice "30XMS/96mS" "<>setpagedevice" + Choice "40XMS/128mS" "<>setpagedevice" + *Choice "50XMS/160mS" "<>setpagedevice" + Choice "60XMS/192mS" "<>setpagedevice" + Choice "70XMS/224mS" "<>setpagedevice" + Choice "80XMS/256mS" "<>setpagedevice" + + Option "CashDrawer2PulseOn/Cash Drawer 2 pulse ON time" PickOne DocumentSetup 9 + Choice "None/None" "" + Choice "10XMS/32mS" "<>setpagedevice" + Choice "20XMS/64mS" "<>setpagedevice" + Choice "30XMS/96mS" "<>setpagedevice" + *Choice "40XMS/128mS" "<>setpagedevice" + Choice "50XMS/160mS" "<>setpagedevice" + Choice "60XMS/192mS" "<>setpagedevice" + Choice "70XMS/224mS" "<>setpagedevice" + Choice "80XMS/256mS" "<>setpagedevice" + + Option "CashDrawer2PulseOff/Cash Drawer 2 pulse OFF time" PickOne DocumentSetup 9 + Choice "None/None" "" + Choice "10XMS/32mS" "<>setpagedevice" + Choice "20XMS/64mS" "<>setpagedevice" + Choice "30XMS/96mS" "<>setpagedevice" + Choice "40XMS/128mS" "<>setpagedevice" + *Choice "50XMS/160mS" "<>setpagedevice" + Choice "60XMS/192mS" "<>setpagedevice" + Choice "70XMS/224mS" "<>setpagedevice" + Choice "80XMS/256mS" "<>setpagedevice" + + + Installable "OptionCash1/Cash drawer 1" + UIConstraints "*CashDrawer1Setting *OptionCash1 False" + // UIConstraints "*CashDrawer1PulseOn *OptionCash1 False" + // UIConstraints "*CashDrawer1PulseOff *OptionCash1 False" + +// Attribute cupsUIConstraints Cash1Off "*OptionCash1 False *CashDrawer1Setting" +// Attribute cupsUIConstraints Cash1Off "*OptionCash1 False *CashDrawer1PulseOn" +// Attribute cupsUIConstraints Cash1Off "*OptionCash1 False *CashDrawer1PulseOff" +// Attribute cupsUIResolver Cash1Off "*CashDrawer1Setting None *CashDrawer1PulseOn None *CashDrawer1PulseOff None" +// Attribute cupsUIResolver Cash1Off "*CashDrawer1PulseOn None" +// Attribute cupsUIResolver Cash1Off "*CashDrawer1PulseOff None" + + Installable "OptionCash2/Cash drawer 2" + UIConstraints "*CashDrawer2Setting *OptionCash2 False" + // UIConstraints "*CashDrawer2PulseOn *OptionCash2 False" + // UIConstraints "*CashDrawer2PulseOff *OptionCash2 False" + + Installable "OptionCutter/Cutter" + UIConstraints "*CutMedia *OptionCutter False" + +// Attribute cupsUIConstraints CutterOff "*OptionCutter False *CutMedia" +// Attribute cupsUIResolver CutterOff "*CutMedia None" + + +Option "Resolution/Resolution" PickOne AnySetup 10 +*Choice "203x203dpi/203 DPI Grayscale" "<>setpagedevice" + +HWMargins 14 0 14 0 + +// 58mm printers +{ + #define POINTS 164 + #define PIXELS 384 + + // model num is used by filter to determine raster width. 384 for 48mm, 560 for 70mm + ModelNumber $PIXELS + MinSize $POINTS 56 + MaxSize $POINTS 9286 + + *CustomMedia "X48MMY65MM/58mm x 65mm" $POINTS 182 14 0 14 0 "<>setpagedevice" "<>setpagedevice" + CustomMedia "X48MMY105MM/58mm x 105mm" $POINTS 298 14 0 14 0 "<>setpagedevice" "<>setpagedevice" + CustomMedia "X48MMY210MM/58mm x 210mm" $POINTS 595 14 0 14 0 "<>setpagedevice" "<>setpagedevice" + CustomMedia "X48MMY297MM/58mm x 297mm" $POINTS 842 14 0 14 0 "<>setpagedevice" "<>setpagedevice" + CustomMedia "X48MMY3276MM/58mm x 3276mm" $POINTS 9286 14 0 14 0 "<>setpagedevice" "<>setpagedevice" + + // Zijiang ZJ-58 + { + Manufacturer "Zijiang" + ModelName "ZJ-58" + PCFileName "zj58.ppd" + Attribute "NickName" "" "Zijiang ZJ-58" + Attribute "ShortNickName" "" "ZJ-58" + Attribute "Product" "" "(zj-58)" + Attribute "1284DeviceID" "" "MFG:Zijiang;CMD:Zijiang;MDL:ZJ-58;CLS:PRINTER;" + } + + // XPrinter XP-58 + { + Manufacturer "J-speed" + ModelName "XP-58" + PCFileName "xp58.ppd" + Attribute "NickName" "" "J-speed XP-58" + Attribute "ShortNickName" "" "XP-58" + Attribute "Product" "" "(xp-58)" + Attribute "1284DeviceID" "" "MFG:J-speed;CMD:Xprinter;MDL:XP-58;CLS:PRINTER;" + } +} + +// 80mm printers +{ + #define POINTS 226 + #define PIXELS 560 + // model num is used by filter to determine raster width. 58 -> 0x180, 80 -> 0x240. + ModelNumber $PIXELS + MinSize $POINTS 56 + MaxSize $POINTS 9286 + + *CustomMedia "X70MMY65MM/80mm x 65mm" $POINTS 182 14 0 14 0 "<>setpagedevice" "<>setpagedevice" + CustomMedia "X70MMY105MM/80mm x 105mm" $POINTS 298 14 0 14 0 "<>setpagedevice" "<>setpagedevice" + CustomMedia "X70MMY210MM/80mm x 210mm" $POINTS 595 14 0 14 0 "<>setpagedevice" "<>setpagedevice" + CustomMedia "X70MMY297MM/80mm x 297mm" $POINTS 842 14 0 14 0 "<>setpagedevice" "<>setpagedevice" + CustomMedia "X70MMY3276MM/80mm x 3276mm" $POINTS 9286 14 0 14 0 "<>setpagedevice" "<>setpagedevice" + + // Zijiang ZJ-80 + { + Manufacturer "Zijiang" + ModelName "ZJ-80" + PCFileName "zj80.ppd" + Attribute "NickName" "" "Zijiang ZJ-80" + Attribute "ShortNickName" "" "ZJ-80" + Attribute "Product" "" "(zj-80)" + Attribute "1284DeviceID" "" "MFG:Zijiang;CMD:Zijiang;MDL:ZJ-80;CLS:PRINTER;" + } + + // Epson TM-T20 + { + Manufacturer "Epson" + ModelName "TM-T20" + PCFileName "tm20.ppd" + Attribute "NickName" "" "Epson TM-T20" + Attribute "ShortNickName" "" "TM-T20" + Attribute "Product" "" "(TM-T20)" + Attribute "1MFG:Epson;CMD:Epson;MDL:TMT20;CLS:PRINTER;" + } +} +