Sample Code
Windows Driver Samples/ OEM Printer Customization Plug-in Samples/ C++/ PTPCPlPr/ install/ ptpcplpr.gpd/
*GPDFileName: "ptpcplpr.gpd" *GPDFileVersion: "1.0" *GPDSpecVersion: "1.0" *Include: "StdNames.gpd" *Include: "ttfsub.gpd" *ModelName: "UniDrv PT/PC Plugin Provider" *MasterUnits: PAIR(1200, 1200) *ResourceDLL: "unires.dll" *PrinterType: PAGE *MaxCopies: 99 *PrintRate: 16 *PrintRateUnit: PPM *PrintRatePPM: 16 *%****************************************************************************************** *% Orientation *%****************************************************************************************** *Feature: Orientation { *rcNameID: =ORIENTATION_DISPLAY *DefaultOption: PORTRAIT *Option: PORTRAIT { *rcNameID: =PORTRAIT_DISPLAY *Command: CmdSelect { *Order: DOC_SETUP.6 *Cmd: "<1B>&l0O" } } *Option: LANDSCAPE_CC90 { *rcNameID: =LANDSCAPE_DISPLAY *Command: CmdSelect { *Order: DOC_SETUP.8 *Cmd: "<1B>&l1O" } } } *%****************************************************************************************** *% Input Bin *%****************************************************************************************** *Feature: InputBin { *rcNameID: =PAPER_SOURCE_DISPLAY *DefaultOption: AUTO *Option: AUTO { *rcNameID: =AUTO_DISPLAY *Command: CmdSelect { *Order: DOC_SETUP.11 *Cmd: "<1B>&l0H" } } *Option: UPPER { *rcNameID: =UPPER_TRAY_DISPLAY *Command: CmdSelect { *Order: DOC_SETUP.11 *Cmd: "<1B>&l1H" } } } *%****************************************************************************************** *% Resolution *%****************************************************************************************** *Feature: Resolution { *rcNameID: =RESOLUTION_DISPLAY *DefaultOption: Option2 *Option: Option1 { *Name: "600 x 600" =DOTS_PER_INCH *DPI: PAIR(600, 600) *TextDPI: PAIR(600, 600) *MinStripBlankPixels: 32 EXTERN_GLOBAL: *StripBlanks: LIST(ENCLOSED,TRAILING) *SpotDiameter: 100 *Command: CmdBeginRaster { *Cmd : "<1B>*v7S<1B>*r1A" } *Command: CmdEndRaster { *Cmd : "<1B>*rC" } *Command: CmdSendBlockData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" } *Command: CmdSelect { *Order: DOC_SETUP.7 *Cmd: "@PJL SET RESOLUTION=600<0A>@PJL ENTER LANGUAGE=PCL<0A0D1B>E<1B>*t600R" } } *Option: Option2 { *Name: "300 x 300" =DOTS_PER_INCH *DPI: PAIR(300, 300) *TextDPI: PAIR(300, 300) *MinStripBlankPixels: 32 EXTERN_GLOBAL: *StripBlanks: LIST(ENCLOSED, TRAILING) *SpotDiameter: 100 *Command: CmdBeginRaster { *Cmd : "<1B>*v7S<1B>*r1A" } *Command: CmdEndRaster { *Cmd : "<1B>*rC" } *Command: CmdSendBlockData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" } *Command: CmdSelect { *Order: DOC_SETUP.7 *Cmd: "@PJL SET RESOLUTION=300<0A>@PJL ENTER LANGUAGE=PCL<0A0D1B>E<1B>*t300R" } } *Option: Option3 { *Name: "150 x 150" =DOTS_PER_INCH *DPI: PAIR(150, 150) *TextDPI: PAIR(150, 150) *MinStripBlankPixels: 32 EXTERN_GLOBAL: *StripBlanks: LIST(ENCLOSED, TRAILING) *SpotDiameter: 100 *Command: CmdBeginRaster { *Cmd : "<1B>*v7S<1B>*r1A" } *Command: CmdEndRaster { *Cmd : "<1B>*rC" } *Command: CmdSendBlockData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" } *Command: CmdSelect { *Order: DOC_SETUP.7 *Cmd: "@PJL SET RESOLUTION=150<0A>@PJL ENTER LANGUAGE=PCL<0A0D1B>E<1B>*t150R" } } } *%****************************************************************************************** *% HP-GL/2 Graphics Support *%****************************************************************************************** *Ifdef: WINNT_51 *Personality: =PERSONALITY_HPGL2 *Feature: GraphicsMode { *rcNameID: =GRAPHICSMODE_DISPLAY *DefaultOption: RASTERMODE *Option: HPGL2MODE { *rcNameID: =GRAPHICSMODE_HPGL2_DISPLAY } *Option: RASTERMODE { *rcNameID: =GRAPHICSMODE_RASTER_DISPLAY *Command: CmdSelect { *Order: DOC_SETUP.6 *Cmd: "@PJL SET LIMAGEENHANCE=OFF<0A>" } } } *Endif: *%****************************************************************************************** *% Paper Size *%****************************************************************************************** *Feature: PaperSize { *rcNameID: =PAPER_SIZE_DISPLAY *DefaultOption: LETTER *Option: LETTER { *rcNameID: =RCID_DMPAPER_SYSTEM_NAME *PageProtectMem: 1028 *switch: Orientation { *case: PORTRAIT { *PrintableArea: PAIR(9500, 12500) *PrintableOrigin: PAIR(400, 400) *CursorOrigin: PAIR(300, 300) *Command: CmdSelect { *Order: DOC_SETUP.12 *Cmd: "<1B>&l2a8c1E<1B>*p0x0Y<1B>*c0t5260x7704Y" } } *case: LANDSCAPE_CC90 { *PrintableArea: PAIR(9500, 12200) *PrintableOrigin: PAIR(450, 300) *CursorOrigin: PAIR(200, 12900) *Command: CmdSelect { *Order: DOC_SETUP.12 *Cmd: "<1B>&l2a8c1E<1B>*p0x0Y<1B>*c0t7332x5880Y" } } } } *Option: LEGAL { *rcNameID: =RCID_DMPAPER_SYSTEM_NAME *PageProtectMem: 1692 *switch: Orientation { *case: PORTRAIT { *PrintableArea: PAIR(9000, 15500) *PrintableOrigin: PAIR(400, 600) *CursorOrigin: PAIR(180, 300) *Command: CmdSelect { *Order: DOC_SETUP.12 *Cmd: "<1B>&l3a8c1E<1B>*p0x0Y<1B>*c0t5880x8900Y" } } *case: LANDSCAPE_CC90 { *PrintableArea: PAIR(9000, 15500) *PrintableOrigin: PAIR(400, 900) *CursorOrigin: PAIR(180, 16500) *Command: CmdSelect { *Order: DOC_SETUP.12 *Cmd: "<1B>&l3a8c1E<1B>*p0x0Y<1B>*c0t8900x5880Y" } } } } *Option: EXECUTIVE { *rcNameID: =RCID_DMPAPER_SYSTEM_NAME *PageProtectMem: 4109 *switch: Orientation { *case: PORTRAIT { *PrintableArea: PAIR(8100, 11500) *PrintableOrigin: PAIR(300, 300) *CursorOrigin: PAIR(300, 200) *Command: CmdSelect { *Order: DOC_SETUP.12 *Cmd: "<1B>&l1a8c1E<1B>*p0x0Y<1B>*c0t4860x7344Y" } } *case: LANDSCAPE_CC90 { *PrintableArea: PAIR(8300, 11500) *PrintableOrigin: PAIR(200, 300) *CursorOrigin: PAIR(200, 12300) *Command: CmdSelect { *Order: DOC_SETUP.12 *Cmd: "<1B>&l1a8c1E<1B>*p0x0Y<1B>*c0t7272x4980Y" } } } } *Option: A4 { *rcNameID: =RCID_DMPAPER_SYSTEM_NAME *PageProtectMem: 4249 *switch: Orientation { *case: PORTRAIT { *PrintableArea: PAIR(9100, 13200) *PrintableOrigin: PAIR(400, 300) *CursorOrigin: PAIR(288, 180) *Command: CmdSelect { *Order: DOC_SETUP.12 *Cmd: "<1B>&l26a8c1E<1B>*p0x0Y<1B>*c0t5594x8201Y" } } *case: LANDSCAPE_CC90 { *PrintableArea: PAIR(9100, 13200) *PrintableOrigin: PAIR(400, 300) *CursorOrigin: PAIR(204, 13824) *Command: CmdSelect { *Order: DOC_SETUP.12 *Cmd: "<1B>&l26a8c1E<1B>*p0x0Y<1B>*c0t8129x5714Y" } } } } *Option: B5 { *rcNameID: =RCID_DMPAPER_SYSTEM_NAME *PageProtectMem: 3198 *switch: Orientation { *case: PORTRAIT { *PrintableArea: PAIR(7900, 11140) *PrintableOrigin: PAIR(352, 300) *CursorOrigin: PAIR(300, 100) *Command: CmdSelect { *Order: DOC_SETUP.12 *Cmd: "<1B>&l12a8c1E<1B>*p0x0Y<1B>*c0t4970x7040Y" } } *case: LANDSCAPE_CC90 { *PrintableArea: PAIR(7760, 11140) *PrintableOrigin: PAIR(300, 400) *CursorOrigin: PAIR(100, 11940) *Command: CmdSelect { *Order: DOC_SETUP.12 *Cmd: "<1B>&l12a8c1E<1B>*p0x0Y<1B>*c0t6780x4970Y" } } } } } *%****************************************************************************************** *% Media Type *%****************************************************************************************** *Feature: MediaType { *rcNameID: =MEDIA_TYPE_DISPLAY *DefaultOption: STANDARD *Option: STANDARD { *rcNameID: =PLAIN_PAPER_DISPLAY *Command: CmdSelect { *Order: DOC_SETUP.15 *Cmd: "<1B>&n6WdPlain" } } *Option: CustomPhotographicPaper { *Name: "Photographic" *PrintSchemaKeywordMap: "Photographic" *Command: CmdSelect { *Order: DOC_SETUP.15 *Cmd: "<1B>&n13WdPhotographic" } } } *%****************************************************************************************** *% Color Mode *%****************************************************************************************** *Feature: ColorMode { *rcNameID: =COLOR_PRINTING_MODE_DISPLAY *DefaultOption: 24bpp *Option: Mono { *rcNameID: =MONO_DISPLAY *DevNumOfPlanes: 1 *DevBPP: 1 *Color?: FALSE } *Option: Color { *rcNameID: =COLOR_DISPLAY *DevNumOfPlanes: 3 *DevBPP: 1 *DrvBPP: 4 EXTERN_GLOBAL: *RasterSendAllData?: TRUE *ColorPlaneOrder: LIST(CYAN, MAGENTA, YELLOW) *Command: CmdSendCyanData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"V" } *Command: CmdSendMagentaData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"V" } *Command: CmdSendYellowData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" } *Command: CmdSelectBlackColor { *Cmd : "<1B>*v7S" } *Command: CmdSelectRedColor { *Cmd : "<1B>*v6S" } *Command: CmdSelectGreenColor { *Cmd : "<1B>*v5S" } *Command: CmdSelectYellowColor { *Cmd : "<1B>*v4S" } *Command: CmdSelectBlueColor { *Cmd : "<1B>*v3S" } *Command: CmdSelectMagentaColor { *Cmd : "<1B>*v2S" } *Command: CmdSelectCyanColor { *Cmd : "<1B>*v1S" } *Command: CmdSelectWhiteColor { *Cmd : "<1B>*v0S" } *Command: CmdSelect { *Order: PAGE_SETUP.16 *Cmd: "<1B>*r-3U" } } *Option: 8bpp { *rcNameID: =8BPP_DISPLAY *DevNumOfPlanes: 1 *DevBPP: 8 *DrvBPP: 8 *PaletteSize: 256 *PaletteProgrammable? : TRUE *Command: CmdDefinePaletteEntry { *Cmd : "<1B>*v" %d{RedValue}"a" %d{GreenValue}"b" %d{BlueValue}"c" + %d{PaletteIndexToProgram} "I" } *Command: CmdSelectPaletteEntry { *Cmd : "<1B>*v" %d{CurrentPaletteIndex}"S" } *Command: CmdSelect { *Order: PAGE_SETUP.16 *Cmd: "<1B>*v1N<1B>*v1O<1B>*t0I<1B>*l184O<1B>*v6W<000108080808>" } } *Option: 24bpp { *rcNameID: =24BPP_DISPLAY *DevNumOfPlanes: 1 *DevBPP: 24 *DrvBPP: 24 *Command: CmdEnableDRC { *Cmd : "<1B>*b3M" } *PaletteSize: 256 *PaletteProgrammable? : TRUE *Command: CmdDefinePaletteEntry { *Cmd : "<1B>*v" %d{RedValue}"a" %d{GreenValue}"b" %d{BlueValue}"c" + %d{PaletteIndexToProgram} "I" } *Command: CmdSelectPaletteEntry { *Cmd : "<1B>*v" %d{CurrentPaletteIndex}"S" } *Command: CmdSetSrcBmpWidth { *Cmd : "<1B>*r" %d{RasterDataWidthInBytes / 3}"S" } *Command: CmdSelect { *Order: PAGE_SETUP.16 *Cmd: "<1B>*v1N<1B>*v1O<1B>*l184O<1B>*v6W<0003080808081B>*v0a0b0c7i255a255b255c0I<1B>*" + "o3W<060400>" } } } *%****************************************************************************************** *% HalfTone *%****************************************************************************************** *Feature: Halftone { *rcNameID: =HALFTONING_DISPLAY *DefaultOption: HT_PATSIZE_AUTO *Option: HT_PATSIZE_AUTO { *rcNameID: =HT_AUTO_SELECT_DISPLAY } *Option: HT_PATSIZE_SUPERCELL_M { *rcNameID: =HT_SUPERCELL_DISPLAY } *Option: HT_PATSIZE_6x6_M { *rcNameID: =HT_DITHER6X6_DISPLAY } *Option: HT_PATSIZE_8x8_M { *rcNameID: =HT_DITHER8X8_DISPLAY } } *%****************************************************************************************** *% Memory *% *% Note: Unidrv uses the font memory information to estimate when it needs to stop *% downloading fonts for a page, and thus driver writers should err on the conservative *% side. Otherwise, printers will generate "out of memory" device errors for pages with *% a large number of fonts / unique glyphs. *%****************************************************************************************** *Feature: Memory { *rcNameID: =PRINTER_MEMORY_DISPLAY *DefaultOption: 32768KB *Option: 4096KB { *Name: "4MB" *MemoryConfigKB: PAIR(4096, 6750) } *Option: 8192KB { *Name: "8MB" *MemoryConfigKB: PAIR(8192, 10350) } *Option: 16384KB { *Name: "16MB" *MemoryConfigKB: PAIR(16384, 13950) } *Option: 24576KB { *Name: "24MB" *MemoryConfigKB: PAIR(24576, 21150) } *Option: 32768KB { *Name: "32MB" *MemoryConfigKB: PAIR(32768, 28350) } *Option: 49152KB { *Name: "48MB" *MemoryConfigKB: PAIR(49152, 43050) } *Option: 65536KB { *Name: "64MB" *MemoryConfigKB: PAIR(65536, 57150) } *Option: 98304KB { *Name: "96MB" *MemoryConfigKB: PAIR(98304, 85950) } *Option: 102400KB { *Name: "100MB" *MemoryConfigKB: PAIR(102400, 89700) } *Option: 114688KB { *Name: "112MB" *MemoryConfigKB: PAIR(114688, 100550) } *Option: 131072KB { *Name: "128MB" *MemoryConfigKB: PAIR(131072, 116250) } } *%****************************************************************************************** *% Duplex Unit *%****************************************************************************************** *Feature: DuplexUnit { *rcNameID: 429 *FeatureType: PRINTER_PROPERTY *DefaultOption: FALSE *Option: FALSE { *rcNameID: 444 *DisabledFeatures: LIST(Duplex.VERTICAL, Duplex.HORIZONTAL) } *Option: TRUE { *rcNameID: 443 } } *%****************************************************************************************** *% Duplex Type *%****************************************************************************************** *Feature: Duplex { *rcNameID: =TWO_SIDED_PRINTING_DISPLAY *DefaultOption: NONE *Option: NONE { *rcNameID: =NONE_DISPLAY *Command: CmdSelect { *Order: DOC_SETUP.9 *Cmd: "<1B>&l0S" } } *Option: VERTICAL { *rcNameID: =FLIP_ON_LONG_EDGE_DISPLAY *Command: CmdSelect { *Order: DOC_SETUP.9 *Cmd: "<1B>&l1S" } } *Option: HORIZONTAL { *rcNameID: =FLIP_ON_SHORT_EDGE_DISPLAY *Command: CmdSelect { *Order: DOC_SETUP.9 *Cmd: "<1B>&l2S" } } } *%****************************************************************************************** *% Page Photo Printing Intent *%****************************************************************************************** *Feature: PhotoPrintingIntent { *Name: "Photo Printing Intent" *PrintSchemaKeywordMap: "PagePhotoPrintingIntent" *DefaultOption: None *Option: None { *Name: "None" *PrintSchemaKeywordMap: "None" } *Option: Draft { *Name: "Draft" *PrintSchemaKeywordMap: "PhotoDraft" } *Option: Standard { *Name: "Standard" *PrintSchemaKeywordMap: "PhotoStandard" } *Option: Best { *Name: "Best" *PrintSchemaKeywordMap: "PhotoBest" } } *Feature: OutputQuality { *Name: "Page Output Quality" *PrintSchemaKeywordMap: "PageOutputQuality" *DefaultOption: None *Option: None { *Name: "None" *PrintSchemaKeywordMap: "None" } *Option: Draft { *Name: "Draft" *PrintSchemaKeywordMap: "Draft" } *Option: High { *Name: "High" *PrintSchemaKeywordMap: "High" } *Option: Photographic { *Name: "Photographic" *PrintSchemaKeywordMap: "Photographic" } } *%****************************************************************************************** *% Page Protect *%****************************************************************************************** *Feature: PageProtect { *rcNameID: =PAGE_PROTECTION_DISPLAY *DefaultOption: OFF *Option: ON { *rcNameID: =ON_DISPLAY *Command: CmdSelect { *Order: DOC_SETUP.1 *Cmd: "<1B>%%-12345X@PJL SET PAGEPROTECT=LETTER<0A>" } } *Option: OFF { *rcNameID: =OFF_DISPLAY *Command: CmdSelect { *Order: DOC_SETUP.1 *Cmd: "<1B>%%-12345X@PJL SET PAGEPROTECT=OFF<0A>" } } } *%****************************************************************************************** *% Doc setup commands *%****************************************************************************************** *Command: CmdStartDoc { *Order: DOC_SETUP.7 *Cmd: "<1B>&u1200D<1B>*r0F" } *Command: CmdStartPage { *Order: PAGE_SETUP.1 *Cmd: "<1B>*b0M<0D>" } *Command: CmdEndJob { *Order: JOB_FINISH.1 *Cmd: "<1B>E<1B>%%-12345X@PJL<20>LPORTROTATE<0A><1B>%%-12345X" } *Command: CmdCopies { *Order: DOC_SETUP.13 *Cmd: "<1B>&l" %d{NumOfCopies}"X" } *%****************************************************************************************** *% Cursor, Page and Color Commands *%****************************************************************************************** *RotateCoordinate?: TRUE *RotateRaster?: TRUE *RotateFont?: TRUE *TextCaps: LIST(TC_CR_90,TC_UA_ABLE) *MemoryUsage: LIST(FONT, RASTER, VECTOR) *CursorXAfterCR: AT_PRINTABLE_X_ORIGIN *BadCursorMoveInGrxMode: LIST(X_PORTRAIT,Y_LANDSCAPE) *XMoveThreshold: 0 *YMoveThreshold: 0 *XMoveUnit: 300 *YMoveUnit: 300 *Command: CmdXMoveAbsolute { *Cmd : "<1B>*p" %d{(DestX) }"X" } *Command: CmdXMoveRelRight { *Cmd : "<1B>*p+" %d[0,9600]{max_repeat((DestXRel) )}"X" } *Command: CmdXMoveRelLeft { *Cmd : "<1B>*p-" %d[0,9600]{max_repeat((DestXRel) )}"X" } *Command: CmdYMoveAbsolute { *Cmd : "<1B>*p" %d{(DestY) }"Y" } *Command: CmdYMoveRelDown { *Cmd : "<1B>*p+" %d{(DestYRel) }"Y" } *Command: CmdYMoveRelUp { *Cmd : "<1B>*p-" %d{(DestYRel) }"Y" } *Command: CmdDefinePaletteEntry { *Cmd : "<1B>*v" %d{RedValue}"a" %d{GreenValue}"b" %d{BlueValue}"c" + %d{PaletteIndexToProgram} "I" } *Command: CmdSelectPaletteEntry { *Cmd : "<1B>*v" %d{CurrentPaletteIndex}"S" } *Command: CmdCR { *Cmd : "<0D>" } *Command: CmdLF { *Cmd : "<0A>" } *Command: CmdFF { *Cmd : "<0C>" } *Command: CmdBackSpace { *Cmd : "<08>" } *Command: CmdUniDirectionOn { *Cmd : "<00>" } *Command: CmdUniDirectionOff { *Cmd : "<00>" } *Command: CmdPushCursor { *Cmd : "<1B>&f0S" } *Command: CmdPopCursor { *Cmd : "<1B>&f1S" } *Command: CmdSetSimpleRotation { *Cmd : "<1B>&a" %d{PrintDirInCCDegrees}"P" } *EjectPageWithFF?: TRUE *Command: CmdEnableTIFF4 { *Cmd : "<1B>*b2M" } *Command: CmdDisableCompression { *Cmd : "<1B>*b0M" } *OutputDataFormat: H_BYTE *OptimizeLeftBound?: TRUE *CursorXAfterSendBlockData: AT_GRXDATA_ORIGIN *CursorYAfterSendBlockData: AUTO_INCREMENT *%****************************************************************************************** *% Font Descriptions and Commands *%****************************************************************************************** *TTFSEnabled?: TRUE *DefaultFont: 136 *DefaultCTT: 0 *CharPosition: BASELINE *DeviceFonts: LIST(136,138,146,147,148,149,150,151,152,153,154,155,156,157, + 163,164,165,166,196,197,198,199,200,201,202,203,209,210, + 211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226, + 227,228,229,230) *MinFontID: 16534 *MaxFontID: 32768 *switch: Resolution { *case: Option1 { *FontFormat: HPPCL_OUTLINE } *case: Option2 { *FontFormat: HPPCL_OUTLINE } *case: Option3 { *FontFormat: HPPCL_RES } } *Command: CmdSetFontID { *Cmd : "<1B>*c" %d{NextFontID}"D" } *Command: CmdSelectFontID { *Cmd : "<1B>(" %d{CurrentFontID}"X" } *Command: CmdSetCharCode { *Cmd : "<1B>*c" %d{NextGlyph}"E" } *Command: CmdUnderlineOn { *Cmd : "<1B>&dD" } *Command: CmdUnderlineOff { *Cmd : "<1B>&d@" } *Command: CmdWhiteTextOn { *Cmd : "<1B>*v1o1T" } *Command: CmdWhiteTextOff { *Cmd : "<1B>*v0o0T" } *%******************************************************************************************** *%* Vector Commands. *%******************************************************************************************** *MinGrayFill: 1 *MaxGrayFill: 100 *Command: CmdSetRectWidth { *Cmd : "<1B>*c" %d{(RectXSize) }"A" } *Command: CmdSetRectHeight { *Cmd : "<1B>*c" %d{(RectYSize) }"B" } *Command: CmdRectGrayFill { *Cmd : "<1B>*c" %d{GrayPercentage }"g2P" } *Command: CmdRectWhiteFill { *Cmd : "<1B>*c1P" } *Command: CmdRectBlackFill { *Cmd : "<1B>*c0P" }
Our Services
-
What our customers say about us?
Read our customer testimonials to find out why our clients keep returning for their projects.
View Testimonials