Sample Code

Windows Driver Samples/ Generic Text-Only Driver/ C++/ tty.gpd/

*%
*% Copyright (c) 1997-2003 Microsoft Corporation
*% All Rights Reserved.
*%
*GPDSpecVersion: "1.0"
*Include: "stdnames.gpd"
*ModelName: "Generic / Text Only"
*GPDFileName: "tty.gpd"
*GPDFileVersion: "1.0"
*MasterUnits: PAIR(600, 600)
*ResourceDLL: "ttyres.dll"
*PrinterType: TTY
*EjectPageWithFF?: TRUE
*CharPosition: BASELINE
*switch: InputBin
{
        *case:   Option3
        {
             *EjectPageWithFF?: FALSE
        }
}

*Feature: InputBin
{
    *rcNameID: =PAPER_SOURCE_DISPLAY
    *DefaultOption: Option1
    *Option: Option1
    {
        *rcNameID: 262  *% "Cut Sheets"
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.3
            *CallbackID: 4
        }
    }
    *Option: Option2
    {
        *rcNameID: 260  *%  "Continuous Feed - w breaks"
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.3
            *CallbackID: 4
        }
    }
    *Option: Option3
    {
        *rcNameID: 261  *%   "Continuous Feed - no breaks"
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.3
            *CallbackID: 4
        }
    }
}
*Feature: Resolution
{
    *rcNameID: =RESOLUTION_DISPLAY
    *ConcealFromUI?: TRUE
    *DefaultOption: Option1
    *Option: Option1
    {
        *rcNameID: 257
        *DPI: PAIR(600, 600)
        *TextDPI: PAIR(600, 600)
        *SpotDiameter: 100
        *IgnoreBlock:    *%  switch: Orientation
        {
                *case:   LANDSCAPE_CC270
                {
                        *DPI: PAIR(6, 120)
                        *TextDPI: PAIR(6, 120)
                }
        }
    }
}
*IgnoreBlock   *% Feature: ColorMode
{
        *rcNameID: =COLOR_PRINTING_MODE_DISPLAY
        *Option: Monochrome
        {
                *Name: "monochrome"
                *Color?: FALSE
            *DevNumOfPlanes: 1
            *DevBPP: 1
            *DrvBPP: 1

            *%  support OEMFilterGraphics instead of
            *%  OEMImageProcessing since this is a SERIAL printer.
            *%IPCallbackID: 1
            *%DevNumOfPlanes: 0
            *%DevBPP: 0
        }
}
*Feature: PaperSize
{
    *rcNameID: =PAPER_SIZE_DISPLAY
    *DefaultOption: LETTER
    *Option: LETTER
    {
        *rcNameID: =LETTER_DISPLAY
        *PrintableArea: PAIR(5100, 6600)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: LETTER_EXTRA
    {
        *rcNameID: =LETTER_EXTRA_DISPLAY
        *PrintableArea: PAIR(5700, 7200)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: LEGAL
    {
        *rcNameID: =LEGAL_DISPLAY
        *PrintableArea: PAIR(5100, 8400)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: LEGAL_EXTRA
    {
        *rcNameID: =LEGAL_EXTRA_DISPLAY
        *PrintableArea: PAIR(5700, 9000)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: A3
    {
        *rcNameID: =A3_DISPLAY
        *PrintableArea: PAIR(7010, 9900)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: A4
    {
        *rcNameID: =A4_DISPLAY
        *PrintableArea: PAIR(4960, 7000)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: ISO_B4
    {
        *rcNameID: =ISO_B4_DISPLAY
        *PrintableArea: PAIR(5900, 8300)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: B4
    {
        *rcNameID: =B4_DISPLAY
        *PrintableArea: PAIR(6070, 8500)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: B5
    {
        *rcNameID: =B5_DISPLAY
        *PrintableArea: PAIR(4300, 6000)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: LEDGER
    {
        *rcNameID: =LEDGER_DISPLAY
        *PrintableArea: PAIR(10200, 6600)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: TABLOID
    {
        *rcNameID: =TABLOID_DISPLAY
        *PrintableArea: PAIR(6600, 10200)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: TABLOID_EXTRA
    {
        *rcNameID: =TABLOID_EXTRA_DISPLAY
        *PrintableArea: PAIR(7010, 10800)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: FANFOLD_US
    {
        *rcNameID: =FANFOLD_US_DISPLAY
        *PrintableArea: PAIR(8925, 6600)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: FANFOLD_STD_GERMAN
    {
        *rcNameID: =FANFOLD_STD_GERMAN_DISPLAY
        *PageDimensions: PAIR(5100, 7200)
        *PrintableArea: PAIR(5100, 7200)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: FOLIO
    {
        *rcNameID: =FOLIO_DISPLAY
        *PageDimensions: PAIR(5100, 7800)
        *PrintableArea: PAIR(5100, 7800)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: ENV_DL
    {
        *rcNameID: =ENV_DL_DISPLAY
        *PrintableArea: PAIR(2595, 5100)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: ENV_C3
    {
        *rcNameID: =ENV_C3_DISPLAY
        *PrintableArea: PAIR(7655, 10800)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: ENV_C4
    {
        *rcNameID: =ENV_C4_DISPLAY
        *PrintableArea: PAIR(5410, 7600)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: ENV_C5
    {
        *rcNameID: =ENV_C5_DISPLAY
        *PrintableArea: PAIR(3825, 5400)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: ENV_C6
    {
        *rcNameID: =ENV_C6_DISPLAY
        *PrintableArea: PAIR(2690, 3800)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: ENV_C65
    {
        *rcNameID: =ENV_C65_DISPLAY
        *PrintableArea: PAIR(2690, 5400)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: ENV_B4
    {
        *rcNameID: =ENV_B4_DISPLAY
        *PrintableArea: PAIR(5900, 8300)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: ENV_B5
    {
        *rcNameID: =ENV_B5_DISPLAY
        *PrintableArea: PAIR(4155, 5900)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: ENV_B6
    {
        *rcNameID: =ENV_B6_DISPLAY
        *PrintableArea: PAIR(4155, 2900)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: ENV_ITALY
    {
        *rcNameID: =ENV_ITALY_DISPLAY
        *PrintableArea: PAIR(2595, 5400)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: ENV_MONARCH
    {
        *rcNameID: =ENV_MONARCH_DISPLAY
        *PrintableArea: PAIR(2325, 4500)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: ENV_PERSONAL
    {
        *rcNameID: =ENV_PERSONAL_DISPLAY
        *PrintableArea: PAIR(2175, 3900)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: ENV_9
    {
        *rcNameID: =ENV_9_DISPLAY
        *PrintableArea: PAIR(2325, 5300)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: ENV_10
    {
        *rcNameID: =ENV_10_DISPLAY
        *PrintableArea: PAIR(2475, 5700)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: ENV_11
    {
        *rcNameID: =ENV_11_DISPLAY
        *PrintableArea: PAIR(2700, 6200)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: ENV_12
    {
        *rcNameID: =ENV_12_DISPLAY
        *PrintableArea: PAIR(2850, 6600)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: ENV_14
    {
        *rcNameID: =ENV_14_DISPLAY
        *PrintableArea: PAIR(3000, 6900)
        *PrintableOrigin: PAIR(0, 0)
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
    *Option: CUSTOMSIZE
    {
        *rcNameID: =USER_DEFINED_SIZE_DISPLAY
        *MinSize: PAIR(60, 100)
        *MaxSize: PAIR(32400, 32400)
        *MaxPrintableWidth: 32400
        *MinLeftMargin: 0
        *CenterPrintable?: FALSE
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.2
            *CallbackID: 3
        }
    }
}
*Command: CmdStartDoc
{
    *Order: DOC_SETUP.1
    *CallbackID: 1

}
*Command: CmdEndJob
{
    *Order: JOB_FINISH.1
    *CallbackID: 2
}
*RotateCoordinate?: TRUE
*RotateRaster?: TRUE
*RotateFont?: TRUE
*Feature: Orientation
{
     *DefaultOption: PORTRAIT
        *rcNameID: =ORIENTATION_DISPLAY
    *Option: PORTRAIT
    {
        *rcNameID: =PORTRAIT_DISPLAY
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.1
            *Cmd: ""
        }

    }
    *Option: LANDSCAPE_CC270
    {
        *rcNameID: =LANDSCAPE_DISPLAY
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.1
            *Cmd: ""
        }
    }
}
*TextCaps: LIST(TC_OP_CHARACTER,TC_EA_DOUBLE,TC_UA_ABLE)
*DeviceFonts: LIST(1,2,3)
*CursorXAfterCR: AT_CURSOR_X_ORIGIN
*YMoveAttributes: LIST(SEND_CR_FIRST,FAVOR_LF)
*MaxLineSpacing: 100
*Command: CmdCR : "<0d>"
*Command: CmdLF : "<0a>"
*Command: CmdFF : "<0c>"
*OutputDataFormat: V_BYTE
*OptimizeLeftBound?: FALSE
*CursorXAfterSendBlockData: AT_GRXDATA_END
*CursorYAfterSendBlockData: NO_MOVE

*DefaultFont: 1
*DefaultCTT: -1
*Command: CmdBoldOn { *CallbackID: 7 }
*Command: CmdBoldOff { *CallbackID: 8 }
*Command: CmdUnderlineOn { *CallbackID: 9 }
*Command: CmdUnderlineOff { *CallbackID: 10 }

Our Services

  • What our customers say about us?

© 2011-2024 All Rights Reserved. Joya Systems. 4425 South Mopac Building II Suite 101 Austin, TX 78735 Tel: 800-DEV-KERNEL

Privacy Policy. Terms of use. Valid XHTML & CSS