Hi. I am implementing a bitmap printer driver using oemuni sample in
NTDDK.
My problem is...
When I print a document, some(it could be one or more) garbage bitmaps
are generated in ImageProcessing. I just dumped the pSrcBitmap data to
a bitmap file in ImageProcessing. I think I can get a printed bitmap
image by merging all band images. But there is a problem in my driver.
As I mensioned above there are some garbage band images.

For example... During one page is printed through my driver, the page
devided into 5 bands and I saved each band. When I checked the saved
iamges after printing is finished the last image is a garbage image.
It has any portion of the document. But the portion has already been
included in previous band image. So to get a perfect bitmap I should
merge the first four images in this case. But I think there is no way
to find out what image is garbage.

I think the number of bands is sensitive to or dependent on the GPD.
But I don't know where should I change to solve this problem. If there
is no garbage image every printing job, all I have to do to get an
image is to merge all band images.

Anyone has good idea to solve my problem?

Thanks in advance.


/// below is my GPD snippet ///

*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.6
*Cmd: "<1B>&l1O"
}
}
}
*Feature: InputBin
{
*rcNameID: =PAPER_SOURCE_DISPLAY
*DefaultOption: MANUAL
*Option: MANUAL
{
*rcNameID: =MANUAL_FEED_DISPLAY
*Command: CmdSelect
{
*Order: DOC_SETUP.9
*Cmd: "<1B>&l2H"
}
}
}
*Feature: PaperSize
{
*rcNameID: =PAPER_SIZE_DISPLAY
*DefaultOption: LETTER
*Option: LETTER
{
*rcNameID: =RCID_DMPAPER_SYSTEM_NAME
*PageProtectMem: 4109
*switch: Orientation
{
*case: PORTRAIT
{
*PrintableArea: PAIR(9592, 12648)
*PrintableOrigin: PAIR(300, 300)
*CursorOrigin: PAIR(300, 180)
*Command: CmdSelect
{
*Order: DOC_SETUP.10
*Cmd: "<1B>&l2a8c1E<1B>*p0x0Y<1B>*c0t5760x7704Y"
}
}
*case: LANDSCAPE_CC90
{
*switch: Resolution
{
*case: Option1
{
*PrintableArea: PAIR(9754, 12710)
*PrintableOrigin: PAIR(200, 250)
}
*case: Option2
{
*PrintableArea: PAIR(9752, 12708)
*PrintableOrigin: PAIR(200, 252)
}
}
*CursorOrigin: PAIR(200, 12960)
*Command: CmdSelect
{
*Order: DOC_SETUP.10
*Cmd: "<1B>&l2a8c1E<1B>*p0x0Y<1B>*c0t7632x5880Y"
}
}
}
}
*Option: LEGAL
{
*rcNameID: =RCID_DMPAPER_SYSTEM_NAME
*PageProtectMem: 5230
*switch: Orientation
{
*case: PORTRAIT
{
*PrintableArea: PAIR(9592, 16248)
*PrintableOrigin: PAIR(300, 300)
*CursorOrigin: PAIR(300, 180)
*Command: CmdSelect
{
*Order: DOC_SETUP.10
*Cmd: "<1B>&l3a8c1E<1B>*p0x0Y<1B>*c0t5760x9864Y"
}
}
*case: LANDSCAPE_CC90
{
*switch: Resolution
{
*case: Option1
{
*PrintableArea: PAIR(9754, 16310)
*PrintableOrigin: PAIR(200, 250)
}
*case: Option2
{
*PrintableArea: PAIR(9752, 16308)
*PrintableOrigin: PAIR(200, 252)
}
}
*CursorOrigin: PAIR(200, 16560)
*Command: CmdSelect
{
*Order: DOC_SETUP.10
*Cmd: "<1B>&l3a8c1E<1B>*p0x0Y<1B>*c0t9792x5880Y"
}
}
}
}
*Option: A3
{
*rcNameID: =RCID_DMPAPER_SYSTEM_NAME
*switch: Orientation
{
*case: PORTRAIT
{
*PrintableArea: PAIR(13428, 19308)
*PrintableOrigin: PAIR(300, 300)
*switch: Resolution
{
*case: Option2
{
*PrintableArea: PAIR(13424, 19304)
*PrintableOrigin: PAIR(304, 304)
}
}
*CursorOrigin: PAIR(300, 180)
*Command: CmdSelect
{
*Order: DOC_SETUP.10
*Cmd: "<1B>&l27a8c1E<1B>*p0x0Y<1B>*c0t8057x11693Y"
}
}
*case: LANDSCAPE_CC90
{
*PrintableArea: PAIR(13588, 19368)
*PrintableOrigin: PAIR(200, 240)
*switch: Resolution
{
*case: Option2
{
*PrintableArea: PAIR(13584, 19368)
}
}
*CursorOrigin: PAIR(200, 19608)
*Command: CmdSelect
{
*Order: DOC_SETUP.10
*Cmd: "<1B>&l27a8c1E<1B>*p0x0Y<1B>*c0t11621x8177Y"
}
}
}
}

*Option: A4
{
*rcNameID: =RCID_DMPAPER_SYSTEM_NAME
*PageProtectMem: 4249
*switch: Orientation
{
*case: PORTRAIT
{
*PrintableArea: PAIR(9352, 13400)
*PrintableOrigin: PAIR(260, 300)
*CursorOrigin: PAIR(260, 160)
*switch: Resolution
{
*case: Option2
{
*PrintableArea: PAIR(9352, 13400)
}
}
*Command: CmdSelect
{
*Order: DOC_SETUP.10
*Cmd: "<1B>&l26a8c1E<1B>*p0x0Y<1B>*c0t5594x8201Y"
}
}
*case: LANDSCAPE_CC90
{
*PrintableArea: PAIR(9424, 13428)
*PrintableOrigin: PAIR(200, 300)
*CursorOrigin: PAIR(200, 13728)
*switch: Resolution
{
*case: Option2
{
*PrintableArea: PAIR(9424, 13428)
*PrintableOrigin: PAIR(200, 300)
}
}
*Command: CmdSelect
{
*Order: DOC_SETUP.10
*Cmd:
"<1B>&l26a8c1e-500Z<1B>*p0x0Y<1B>*c0t8129x5714Y"
}
}
}
}
*Option: ENV_10
{
*rcNameID: =RCID_DMPAPER_SYSTEM_NAME
*PageProtectMem: 4109
*switch: Orientation
{
*case: PORTRAIT
{
*PrintableArea: PAIR(4356, 10200)
*PrintableOrigin: PAIR(300, 300)
*CursorOrigin: PAIR(300, 160)
*Command: CmdSelect
{
*Order: DOC_SETUP.10
*Cmd:
"<1B>&l81a8c1e230Z<1B>*p0x0Y<1B>*c0t2614x6648Y"
}
}
*case: LANDSCAPE_CC90
{
*PrintableArea: PAIR(4356, 10200)
*PrintableOrigin: PAIR(300, 300)
*CursorOrigin: PAIR(200, 11100)
*Command: CmdSelect
{
*Order: DOC_SETUP.10
*Cmd:
"<1B>&l81a8c1e-220Z<1B>*p0x0Y<1B>*c0t6480x2734Y"
}
}
}
}
*Option: ENV_DL
{
*rcNameID: =RCID_DMPAPER_SYSTEM_NAME
*PageProtectMem: 4109
*switch: Orientation
{
*case: PORTRAIT
{
*PrintableArea: PAIR(4596, 9192)
*PrintableOrigin: PAIR(300, 300)
*CursorOrigin: PAIR(300, 160)
*Command: CmdSelect
{
*Order: DOC_SETUP.10
*Cmd:
"<1B>&l90a8c1e230Z<1B>*p0x0Y<1B>*c0t2758x6043Y"
}
}
*case: LANDSCAPE_CC90
{
*PrintableArea: PAIR(4596, 9192)
*PrintableOrigin: PAIR(300, 300)
*CursorOrigin: PAIR(200, 10092)
*Command: CmdSelect
{
*Order: DOC_SETUP.10
*Cmd:
"<1B>&l90a8c1e-220Z<1B>*p0x0Y<1B>*c0t5875x2878Y"
}
}
}
}
*Option: ENV_C5
{
*rcNameID: =RCID_DMPAPER_SYSTEM_NAME
*PageProtectMem: 4109
*switch: Orientation
{
*case: PORTRAIT
{
*PrintableArea: PAIR(7056, 9624)
*PrintableOrigin: PAIR(300, 300)
*CursorOrigin: PAIR(300, 200)
*Command: CmdSelect
{
*Order: DOC_SETUP.10
*Cmd:
"<1B>&l91a8c1e230Z<1B>*p0x0Y<1B>*c0t4234x6254Y"
}
}
*case: LANDSCAPE_CC90
{
*PrintableArea: PAIR(7056, 9624)
*PrintableOrigin: PAIR(300, 300)
*CursorOrigin: PAIR(200, 10524)
*Command: CmdSelect
{
*Order: DOC_SETUP.10
*Cmd:
"<1B>&l91a8c1e-220Z<1B>*p0x0Y<1B>*c0t6134x4354Y"
}
}
}
}
*Option: TABLOID
{
*rcNameID: =RCID_DMPAPER_SYSTEM_NAME
*switch: Orientation
{
*case: PORTRAIT
{
*PrintableArea: PAIR(12600, 19800)
*PrintableOrigin: PAIR(300, 220)
*switch: Resolution
{
*case: Option2
{
*PrintableArea: PAIR(12592, 19792)
*PrintableOrigin: PAIR(304, 220)
}
}
*CursorOrigin: PAIR(300, 200)
*Command: CmdSelect
{
*Order: DOC_SETUP.10
*Cmd: "<1B>&l6a8c1E<1B>*p0x0Y<1B>*c0t7560x12000Y"
}
}
*case: LANDSCAPE_CC90
{
*PrintableArea: PAIR(12600, 19800)
*PrintableOrigin: PAIR(300, 220)
*switch: Resolution
{
*case: Option2
{
*PrintableArea: PAIR(12592, 19792)
*PrintableOrigin: PAIR(304, 220)
}
}
*CursorOrigin: PAIR(200, 20100)
*Command: CmdSelect
{
*Order: DOC_SETUP.10
*Cmd: "<1B>&l6a8c1E<1B>*p0x0Y<1B>*c0t11880x7680Y"
}
}
}
}
*Option: CUSTOMSIZE
{
*rcNameID: =USER_DEFINED_SIZE_DISPLAY
*MinSize: PAIR(4680, 9000)
*MaxSize: PAIR(14040, 32767)
*MaxPrintableWidth: 14040
*MinLeftMargin: 100
*CenterPrintable?: FALSE
*PageProtectMem: 1692
*switch: Orientation
{
*case: PORTRAIT
{
*Command: CmdSelect
{
*Order: DOC_SETUP.12
*Cmd: "<1B>&l101a4d1e" %d{((PhysPaperWidth -
14040) / 20) }"u" %d{(PhysPaperLength / 300) - 1}
+ "F<1B>*p0x0Y<1B>*p0x0Y<1B>*c0t" %d{(((PhysPaperWidth - 598) * 6) /
10) }"x" %d{(((PhysPaperLength - 440) * 6) / 10) }
+ "Y"
}
}
*case: LANDSCAPE_CC90
{
*Command: CmdSelect
{
*Order: DOC_SETUP.12
*Cmd: "<1B>&l101a4d1e" %d{(PhysPaperLength / 300)
- 1}"f" %d{((PhysPaperWidth - 14040) / 20) + 10}
+ "u" %d{(((PhysPaperLength - 21240) * 6) / 10) +
10}"Z<1B>*p0x0Y<1B>*c0t" %d{(((PhysPaperLength - 600) * 6) / 10) }
+ "x" %d{(((PhysPaperWidth - 600) * 6) / 10) }"Y"
}
}
}
}

}
*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
*SpotDiameter: 100
*Command: CmdBeginRaster { *Cmd : "<1B>*r1A" }
*Command: CmdEndRaster { *Cmd : "<1B>*rB" }
*Command: CmdSelect
{
*Order: DOC_SETUP.4
*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
*SpotDiameter: 140
*Command: CmdBeginRaster { *Cmd : "<1B>*v7S<1B>*r1A" }
*Command: CmdEndRaster { *Cmd : "<1B>*rC" }
*Command: CmdSelect
{
*Order: DOC_SETUP.4
*Cmd: "@PJL SET RESOLUTION=300<0A>@PJL ENTER
LANGUAGE=PCL<0A0D1B>E<1B>*t300R"
}
}
*Option: Option3
{
*Name: "200 x 200 " =DOTS_PER_INCH
*DPI: PAIR(200, 200)
*TextDPI: PAIR(200, 200)
*MinStripBlankPixels: 32
*SpotDiameter: 100
*Command: CmdBeginRaster { *Cmd : "<1B>*v7S<1B>*r1A" }
*Command: CmdEndRaster { *Cmd : "<1B>*rC" }
*Command: CmdSelect
{
*Order: DOC_SETUP.4
*Cmd: "@PJL SET RESOLUTION=200<0A>@PJL ENTER
LANGUAGE=PCL<0A0D1B>E<1B>*t200R"
}
}
*Option: Option4
{
*Name: "100 x 100 " =DOTS_PER_INCH
*DPI: PAIR(100, 100)
*TextDPI: PAIR(100, 100)
*MinStripBlankPixels: 32
*SpotDiameter: 100
*Command: CmdBeginRaster { *Cmd : "<1B>*v7S<1B>*r1A" }
*Command: CmdEndRaster { *Cmd : "<1B>*rC" }
*Command: CmdSelect
{
*Order: DOC_SETUP.4
*Cmd: "@PJL SET RESOLUTION=100<0A>@PJL ENTER
LANGUAGE=PCL<0A0D1B>E<1B>*t100R"
}
}


}
*Feature: ColorMode
{
*rcNameID: =COLOR_PRINTING_MODE_DISPLAY
*DefaultOption: Mono

*Option: Mono
{
*rcNameID: =MONO_DISPLAY
*DevNumOfPlanes: 0
*DevBPP: 0
*DrvBPP:1
*Color? : FALSE
*ColorPlaneOrder: LIST(YELLOW, MAGENTA, CYAN, BLACK)
*RasterMode: DIRECT
*IPCallbackID: =COLOR_IPID
*Command: CmdSelect
{
*Order: DOC_SETUP.90
*CallbackID: =SET_COLORMODE
}
}

*Option: Color
{
*rcNameID: =24BPP_DISPLAY
*DevNumOfPlanes: 0
*DevBPP: 0
*DrvBPP:24
*Color? : TRUE
*ColorPlaneOrder: LIST(YELLOW, MAGENTA, CYAN, BLACK)
*RasterMode: DIRECT
*IPCallbackID: =COLOR_IPID
*Command: CmdSelect
{
*Order: DOC_SETUP.90
*CallbackID: =SET_COLORMODE
}
}
}
*Command: CmdStartDoc
{
*Order: DOC_SETUP.5
*Cmd: "<1B>&u600D<1B>*r0F"
}
*Command: CmdStartPage
{
*Order: PAGE_SETUP.1
*Cmd: "<1B>*b0M<0D>"
}
*Command: CmdEndJob
{
*Order: JOB_FINISH.1
*Cmd: "<1B>E<1B>%%-12345X"
}
*RotateCoordinate?: TRUE
*RotateRaster?: TRUE
*RotateFont?: TRUE
*TextCaps: LIST(TC_CR_90,TC_UA_ABLE)
*CursorXAfterCR: AT_PRINTABLE_X_ORIGIN
*BadCursorMoveInGrxMode: LIST(X_PORTRAIT,Y_LANDSCAPE)
*XMoveThreshold: 0
*YMoveThreshold: 0
*XMoveUnit: 600
*YMoveUnit: 600
*Command: CmdXMoveAbsolute { *Cmd : "<1B>*p" %d{(DestX / 2) }"X" }
*Command: CmdXMoveRelRight { *Cmd : "<1B>*p+"
%d[0,9600]{max_repeat((DestXRel / 2) )}"X" }
*Command: CmdXMoveRelLeft { *Cmd : "<1B>*p-"
%d[0,9600]{max_repeat((DestXRel / 2) )}"X" }
*Command: CmdYMoveAbsolute { *Cmd : "<1B>*p" %d{(DestY / 2) }"Y" }
*Command: CmdYMoveRelDown { *Cmd : "<1B>*p+" %d{(DestYRel / 2) }"Y" }
*Command: CmdYMoveRelUp { *Cmd : "<1B>*p-" %d{(DestYRel / 2) }"Y" }
*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: 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: 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: CmdEnableTIFF4 { *Cmd : "<1B>*b2M" }
*Command: CmdDisableCompression { *Cmd : "<1B>*b0M" }
*Command: CmdEnableDRC { *Cmd : "<1B>*b3M" }
*OutputDataFormat: H_BYTE
*%*OptimizeLeftBound?: TRUE

*%*StripBlanks: LIST(ENCLOSED,TRAILING)
*Command: CmdSendBlockData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" }

*CursorXAfterSendBlockData: AT_GRXDATA_ORIGIN
*CursorYAfterSendBlockData: AUTO_INCREMENT
*RasterSendAllData? : TRUE
*DefaultFont: 136
*DefaultCTT: 0
*CharPosition: BASELINE
*TTFSEnabled?: TRUE
*MinFontID: 16534
*MaxFontID: 32768
*FontFormat: HPPCL_OUTLINE
*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" }
*MinGrayFill: 1
*MaxGrayFill: 100
*Command: CmdSetRectWidth { *Cmd : "<1B>*c" %d{(RectXSize / 2) }"A" }
*Command: CmdSetRectHeight { *Cmd : "<1B>*c" %d{(RectYSize / 2) }"B" }
*Command: CmdRectGrayFill { *Cmd : "<1B>*c" %d{GrayPercentage }"g2P" }
*Command: CmdRectWhiteFill { *Cmd : "<1B>*c1P" }
*Command: CmdRectBlackFill { *Cmd : "<1B>*c0P" }

Re: IOemUni::ImageProcessing problem by kbl75

kbl75
Fri Aug 20 20:20:41 CDT 2004

Thanks very much for your answer, Ashwin.
This is the first time someone answers my message and I am glad it's
from you.

Actually I got the GPD from someone else and I am a newbie in
developing device driver.
Can I ask some more questions?

1. I changed my GPD as you pointed out but still the problem happens.
Below GPD is more short one that I have for testing and I got it from
a message posted here. In this GPD there is only one color mode and no
*Cmd statements.

2. About the IPCallbackIDs... I am wondering whether there is any rule
for specifying IPCallbackIDs. If I assign different integer value in
both mono and color mode, it will works well? For example for mono,
specify 0 and for color specify 1 or 100 and 101 for each mode.

3. I replaced all the *Cmd commands in previous GPD with *Cmd:"". But
still the problem happens. And this time I make the
*Feature: ColorMode statement exactly the same in both previous and
below GPD. When I used the previous GPD, there were 6 bands, while
below GPD generated only 5 bands. I guess there are more factors
related to this problem but can't guess what.

Sorry for asking my problem like this. That's why I don't know much
about device drivers and GPD now.

Up to now I've got much useful information from your message and
other's here.
Thanks very much.

///// My another GPD snippet mensioned as "below GPD" in my message.
///////

*Macros: MyCommands
{
START_JOB: 1
END_JOB: 2
START_PAGE: 3
END_PAGE: 4
SET_ORIENTATION: 5
SET_INPUTBIN: 6
SET_RESOLUTION: 7
SET_PAPERSIZE: 8
SET_MEDIATYPE: 9
SET_COLORMODE: 10
SET_COPIES: 11
CMD_MOVEX: 12
CMD_MOVEY: 13
CMD_CR: 14
CMD_LF: 15
CMD_FF: 16
CMD_SEND_BLOCK_DATA: 17
COLOR_IPID : 1
}


*Feature: Orientation
{
*rcNameID: =ORIENTATION_DISPLAY
*DefaultOption: PORTRAIT
*Option: PORTRAIT
{
*rcNameID: =PORTRAIT_DISPLAY
*Command: CmdSelect
{
*Order: DOC_SETUP.6
*CallbackID: =SET_ORIENTATION
}
}
*Option: LANDSCAPE_CC90
{
*rcNameID: =LANDSCAPE_DISPLAY
*Command: CmdSelect
{
*Order: DOC_SETUP.6
*CallbackID: =SET_ORIENTATION
}
}
}
*Feature: InputBin
{
*rcNameID: =PAPER_SOURCE_DISPLAY
*DefaultOption: UPPER
*Option: UPPER
{
*rcNameID: =UPPER_TRAY_DISPLAY
*Command: CmdSelect
{
*Order: DOC_SETUP.9
*CallbackID: =SET_INPUTBIN
}
}
}
*Feature: Resolution
{
*rcNameID: =RESOLUTION_DISPLAY
*DefaultOption: Option1
*Option: Option1
{
*Name: "320 x 320 " =DOTS_PER_INCH
*DPI: PAIR(320, 320)
*TextDPI: PAIR(320, 320)
*SpotDiameter: 100
*Command: CmdSendBlockData { *CallbackID: =CMD_SEND_BLOCK_DATA
}
*Command: CmdSelect
{
*Order: DOC_SETUP.4
*CallbackID: =SET_RESOLUTION
}
}
}

*Feature: PaperSize
{
*rcNameID: =PAPER_SIZE_DISPLAY
*DefaultOption: A4
*Option: A4
{
*rcNameID: =RCID_DMPAPER_SYSTEM_NAME
*PageProtectMem: 4249
*PrintableArea: PAIR(9352, 13400)
*PrintableOrigin: PAIR(260, 300)
*CursorOrigin: PAIR(260, 160)

*Command: CmdSelect
{
*Order: DOC_SETUP.10
*CallbackID: =SET_PAPERSIZE
}
}
}
*Feature: MediaType
{
*rcNameID: =MEDIA_TYPE_DISPLAY
*DefaultOption: STANDARD
*Option: STANDARD
{
*rcNameID: =PLAIN_PAPER_DISPLAY
*Command: CmdSelect
{
*Order: DOC_SETUP.14
*CallbackID: =SET_MEDIATYPE
}
}
}

*Feature: ColorMode
{
*rcNameID: =COLOR_PRINTING_MODE_DISPLAY
*DefaultOption: Color

*Option: Color
{
*rcNameID: =24BPP_DISPLAY
*DevNumOfPlanes: 0
*DevBPP: 0
*DrvBPP:24
*Color? : TRUE
*ColorPlaneOrder: LIST(YELLOW, MAGENTA, CYAN, BLACK)
*RasterMode: DIRECT
*IPCallbackID: =COLOR_IPID
*Command: CmdSelect
{
*Order: DOC_SETUP.90
*CallbackID: =SET_COLORMODE
}
}
}


*Command: CmdStartDoc
{
*Order: DOC_SETUP.5
*CallbackID: =START_JOB
}
*Command: CmdStartPage
{
*Order: PAGE_SETUP.1
*CallbackID: =START_PAGE
}
*Command: CmdEndPage
{
*Order: PAGE_SETUP.1
*CallbackID: =END_PAGE
}
*Command: CmdEndJob
{
*Order: JOB_FINISH.1
*CallbackID: =END_JOB
}
*Command: CmdCopies
{
*Order: DOC_SETUP.11
*CallbackID: =SET_COPIES
}
*XMoveUnit: 1600
*YMoveUnit: 1600
*Command: CmdXMoveAbsolute { *CallbackID: 21 }
*Command: CmdYMoveAbsolute { *CallbackID: 22 }
*Command: CmdCR { *CallbackID: =CMD_CR }
*Command: CmdLF { *CallbackID: =CMD_LF }
*Command: CmdFF { *CallbackID: =CMD_FF }

*FontFormat: OEM_CALLBACK
/////////////////////////////////////////////////////////




"Ashwin [MS]" <ashwinn@online.microsoft.com> wrote in message news:<B11B6C60-EF1A-4D4C-A2DC-E60077558036@microsoft.com>...
> If you are writing a bitmap driver, why are you specifying printer commands
> in your GPD? All your *Cmd statements should have null ("") commands.
>
> Also, you are specifying the same IPCallbackID for both ColorMode options
> which doesn't make sense. You want to be able to identify within your plugin
> which ColorMode option was chosen by the user...you can do this by specifying
> different IPCallbackIDs.
>
> "kaedeluv" wrote:
>
> > Hi. I am implementing a bitmap printer driver using oemuni sample in
> > NTDDK.
> > My problem is...
> > When I print a document, some(it could be one or more) garbage bitmaps
> > are generated in ImageProcessing. I just dumped the pSrcBitmap data to
> > a bitmap file in ImageProcessing. I think I can get a printed bitmap
> > image by merging all band images. But there is a problem in my driver.
> > As I mensioned above there are some garbage band images.
> >
> > For example... During one page is printed through my driver, the page
> > devided into 5 bands and I saved each band. When I checked the saved
> > iamges after printing is finished the last image is a garbage image.
> > It has any portion of the document. But the portion has already been
> > included in previous band image. So to get a perfect bitmap I should
> > merge the first four images in this case. But I think there is no way
> > to find out what image is garbage.
> >
> > I think the number of bands is sensitive to or dependent on the GPD.
> > But I don't know where should I change to solve this problem. If there
> > is no garbage image every printing job, all I have to do to get an
> > image is to merge all band images.
> >
> > Anyone has good idea to solve my problem?
> >
> > Thanks in advance.
> >
> >

Re: IOemUni::ImageProcessing problem by kbl75

kbl75
Tue Aug 24 01:20:26 CDT 2004

Thanks again, Ashwin.

I used the GPD you attached and tested but still the problem happens.
I guess GPD is not a cause of my problem any more.

Now I think the PaperSize feature in GPD can cause the problem. While
I was testing my driver, I found that the number of bands and size of
bitmap images, including garbage image, vary as the values in
PrintableArea and other command in PaperSize feature. So I think to
solve my problem I should change the values and check generated
bitmaps. And find out the best value for a paper option. Do you think
it will be a good solution? If you have any doubtable point that you
think may cause my problem, please leave a message here.

If I figure out, I will post a message here.
Thanks for your help and the GPD.


"Ashwin [MS]" <ashwinn@online.microsoft.com> wrote in message news:<EA8ADAD1-B711-418B-9922-7DDFE34DA5CA@microsoft.com>...
> IIRC, you cannot specify an IPCallbackID of 0...it has to be a non-zero
> number. Anyway, I am including a GPD that can be used (along with
> ImageProcessing) to dump each band out as an individual bitmap. Hope this
> helps.
>
> *GPDFileName: "banddmp.gpd"
> *GPDFileVersion: "1.0"
> *GPDSpecVersion: "1.0"
> *Include: "StdNames.gpd"
> *ModelName: "Band dump Bitmap Driver"
> *MasterUnits: PAIR(1200, 1200)
> *ResourceDLL: "unires.dll"
> *PrinterType: PAGE
> *MaxCopies: 99
>
> *PrintRate: 8
> *PrintRateUnit: PPM
> *PrintRatePPM: 8
>
> *Feature: Orientation
> {
> *rcNameID: =ORIENTATION_DISPLAY
> *DefaultOption: PORTRAIT
> *Option: PORTRAIT
> {
> *rcNameID: =PORTRAIT_DISPLAY
> *Command: CmdSelect
> {
> *Order: DOC_SETUP.6
> *Cmd: ""
> }
> }
> *Option: LANDSCAPE_CC90
> {
> *rcNameID: =LANDSCAPE_DISPLAY
> *Command: CmdSelect
> {
> *Order: DOC_SETUP.6
> *Cmd: ""
> }
> }
> }
> *Feature: InputBin
> {
> *rcNameID: =PAPER_SOURCE_DISPLAY
> *DefaultOption: UPPER
> *Option: UPPER
> {
> *rcNameID: =UPPER_TRAY_DISPLAY
> *Command: CmdSelect
> {
> *Order: DOC_SETUP.9
> *Cmd: ""
> }
> }
> }
> *Feature: Resolution
> {
> *rcNameID: =RESOLUTION_DISPLAY
> *DefaultOption: Option1
> *Option: Option1
> {
> *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 : "" }
> *Command: CmdEndRaster { *Cmd : "" }
> *Command: CmdSendBlockData { *Cmd : "" }
> *Command: CmdSelect
> {
> *Order: DOC_SETUP.4
> *Cmd: ""
> }
> }
> *Option: Option2
> {
> *Name: "150 x 150 " =DOTS_PER_INCH
> *DPI: PAIR(150, 150)
> *TextDPI: PAIR(300, 300)
> *MinStripBlankPixels: 32
> EXTERN_GLOBAL: *StripBlanks: LIST(ENCLOSED,TRAILING)
> *SpotDiameter: 100
> *Command: CmdBeginRaster { *Cmd : "" }
> *Command: CmdEndRaster { *Cmd : "" }
> *Command: CmdSendBlockData { *Cmd : "" }
> *Command: CmdSelect
> {
> *Order: DOC_SETUP.4
> *Cmd: ""
> }
> }
> }
>
> *Feature: PaperSize
> {
> *rcNameID: =PAPER_SIZE_DISPLAY
> *DefaultOption: LETTER
> *Option: LETTER
> {
> *rcNameID: =RCID_DMPAPER_SYSTEM_NAME
> *switch: Orientation
> {
> *case: PORTRAIT
> {
> *%(9600, 12648)
> *% *PrintableArea: PAIR(9600, 12648)
> *PrintableArea: PAIR(9564, 12600)
> *% *PrintableArea: PAIR(5000,5000)
> *PrintableOrigin: PAIR(300, 300)
> *% *PrintableOrigin: PAIR(300, 500)
> *switch: Resolution
> {
> *case: Option2
> {
> *% Warning: the following printable width is adjusted (9600->9592) so it is
> divisible by the resolution X scale.
> *% Warning: the following printable length is adjusted (12648->12640) so it
> is divisible by the resolution Y scale.
> *PrintableArea: PAIR(9592, 12640)
> *% Warning: the following printable origin X is adjusted (300->304) so it is
> divisible by the resolution X scale.
> *% Warning: the following printable origin Y is adjusted (300->304) so it is
> divisible by the resolution Y scale.
> *PrintableOrigin: PAIR(304, 304)
> }
> }
> *CursorOrigin: PAIR(300, 180)
> *Command: CmdSelect
> {
> *%5760 -- 7560
> *Order: DOC_SETUP.10
> *Cmd: ""
> }
> }
> *case: LANDSCAPE_CC90
> {
> *%(9720, 12648)
> *PrintableArea: PAIR(9760, 12688)
> *PrintableOrigin: PAIR(200, 272)
> *CursorOrigin: PAIR(200, 12960)
> *Command: CmdSelect
> {
> *Order: DOC_SETUP.10
> *Cmd: ""
> }
> }
> }
> }
> *Option: LEGAL
> {
> *rcNameID: =RCID_DMPAPER_SYSTEM_NAME
> *switch: Orientation
> {
> *case: PORTRAIT
> {
> *PrintableArea: PAIR(9540, 16248)
> *PrintableOrigin: PAIR(300, 300)
> *switch: Resolution
> {
> *case: Option2
> {
> *% Warning: the following printable width is adjusted (9600->9592) so it is
> divisible by the resolution X scale.
> *% Warning: the following printable length is adjusted (16248->16240) so it
> is divisible by the resolution Y scale.
> *PrintableArea: PAIR(9592, 16240)
> *% Warning: the following printable origin X is adjusted (300->304) so it is
> divisible by the resolution X scale.
> *% Warning: the following printable origin Y is adjusted (300->304) so it is
> divisible by the resolution Y scale.
> *PrintableOrigin: PAIR(304, 304)
> }
> }
> *CursorOrigin: PAIR(300, 180)
> *Command: CmdSelect
> {
> *Order: DOC_SETUP.10
> *Cmd: ""
> }
> }
> *case: LANDSCAPE_CC90
> {
> *PrintableArea: PAIR(9760, 16288)
> *PrintableOrigin: PAIR(200, 272)
> *CursorOrigin: PAIR(200, 16560)
> *Command: CmdSelect
> {
> *Order: DOC_SETUP.10
> *Cmd: ""
> }
> }
> }
> }
> }
> *Feature: MediaType
> {
> *rcNameID: =MEDIA_TYPE_DISPLAY
> *DefaultOption: STANDARD
> *Option: STANDARD
> {
> *rcNameID: =PLAIN_PAPER_DISPLAY
> *Command: CmdSelect
> {
> *Order: DOC_SETUP.14
> *Cmd: ""
> }
> }
> *Option: TRANSPARENCY
> {
> *rcNameID: =TRANSPARENCY_DISPLAY
> *Command: CmdSelect
> {
> *Order: DOC_SETUP.14
> *Cmd: ""
> }
> }
> }
> *Feature: ColorMode
> {
> *rcNameID: =COLOR_PRINTING_MODE_DISPLAY
> *HelpIndex: 12004
> *DefaultOption: 24bpp
> *Option: 24bpp
> {
> *rcNameID: =24BPP_DISPLAY
> *DevNumOfPlanes: 0
> *DevBPP: 0
> *DrvBPP: 24
> *IPCallbackID: 24
> *Command: CmdEnableDRC { *Cmd : "" }
> *PaletteSize: 256
> *PaletteProgrammable? : TRUE
> *Command: CmdDefinePaletteEntry { *Cmd : "" }
> *Command: CmdSelectPaletteEntry { *Cmd : "" }
> *Command: CmdSetSrcBmpWidth { *Cmd : "" }
> *Command: CmdSelect
> {
> *Order: PAGE_SETUP.16
> *Cmd: ""
> }
> }
> }
> *Feature: Halftone
> {
> *rcNameID: =HALFTONING_DISPLAY
> *HelpIndex: 12005
> *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
> }
> }
> *Command: CmdStartDoc
> {
> *Order: DOC_SETUP.5
> *Cmd: ""
> }
> *Command: CmdStartPage
> {
> *Order: PAGE_SETUP.1
> *Cmd: ""
> }
> *Command: CmdEndJob
> {
> *Order: JOB_FINISH.1
> *Cmd: ""
> }
> *Command: CmdCopies
> {
> *Order: DOC_SETUP.11
> *Cmd: ""
> }
> *RotateCoordinate?: TRUE
> *RotateRaster?: TRUE
> *RotateFont?: TRUE
> *TextCaps: LIST(TC_RA_ABLE)
> *MemoryUsage: LIST(FONT)
> *CursorXAfterCR: AT_PRINTABLE_X_ORIGIN
> *BadCursorMoveInGrxMode: LIST(X_PORTRAIT,Y_LANDSCAPE)
> *XMoveThreshold: 0
> *YMoveThreshold: 0
> *XMoveUnit: 300
> *YMoveUnit: 300
> *EjectPageWithFF?: TRUE
> *OutputDataFormat: H_BYTE
> *OptimizeLeftBound?: TRUE
> *CursorXAfterSendBlockData: AT_GRXDATA_ORIGIN
> *CursorYAfterSendBlockData: AUTO_INCREMENT
>
> *Command: CmdCR { *Cmd : "" }
> *Command: CmdLF { *Cmd : "" }
> *Command: CmdFF { *Cmd : "" }
>
> *DefaultCTT: 0
>
>
> - Ashwin
>
>
> "kaedeluv" wrote:
>
> > Thanks very much for your answer, Ashwin.
> > This is the first time someone answers my message and I am glad it's
> > from you.
> >
> > Actually I got the GPD from someone else and I am a newbie in
> > developing device driver.
> > Can I ask some more questions?
> >
> > 1. I changed my GPD as you pointed out but still the problem happens.
> > Below GPD is more short one that I have for testing and I got it from
> > a message posted here. In this GPD there is only one color mode and no
> > *Cmd statements.
> >
> > 2. About the IPCallbackIDs... I am wondering whether there is any rule
> > for specifying IPCallbackIDs. If I assign different integer value in
> > both mono and color mode, it will works well? For example for mono,
> > specify 0 and for color specify 1 or 100 and 101 for each mode.
> >
> > 3. I replaced all the *Cmd commands in previous GPD with *Cmd:"". But
> > still the problem happens. And this time I make the
> > *Feature: ColorMode statement exactly the same in both previous and
> > below GPD. When I used the previous GPD, there were 6 bands, while
> > below GPD generated only 5 bands. I guess there are more factors
> > related to this problem but can't guess what.
> >
> > Sorry for asking my problem like this. That's why I don't know much
> > about device drivers and GPD now.
> >
> > Up to now I've got much useful information from your message and
> > other's here.
> > Thanks very much.
> >
> > ///// My another GPD snippet mensioned as "below GPD" in my message.
> > ///////
> >
> > *Macros: MyCommands
> > {
> > START_JOB: 1
> > END_JOB: 2
> > START_PAGE: 3
> > END_PAGE: 4
> > SET_ORIENTATION: 5
> > SET_INPUTBIN: 6
> > SET_RESOLUTION: 7
> > SET_PAPERSIZE: 8
> > SET_MEDIATYPE: 9
> > SET_COLORMODE: 10
> > SET_COPIES: 11
> > CMD_MOVEX: 12
> > CMD_MOVEY: 13
> > CMD_CR: 14
> > CMD_LF: 15
> > CMD_FF: 16
> > CMD_SEND_BLOCK_DATA: 17
> > COLOR_IPID : 1
> > }
> >
> >
> > *Feature: Orientation
> > {
> > *rcNameID: =ORIENTATION_DISPLAY
> > *DefaultOption: PORTRAIT
> > *Option: PORTRAIT
> > {
> > *rcNameID: =PORTRAIT_DISPLAY
> > *Command: CmdSelect
> > {
> > *Order: DOC_SETUP.6
> > *CallbackID: =SET_ORIENTATION
> > }
> > }
> > *Option: LANDSCAPE_CC90
> > {
> > *rcNameID: =LANDSCAPE_DISPLAY
> > *Command: CmdSelect
> > {
> > *Order: DOC_SETUP.6
> > *CallbackID: =SET_ORIENTATION
> > }
> > }
> > }
> > *Feature: InputBin
> > {
> > *rcNameID: =PAPER_SOURCE_DISPLAY
> > *DefaultOption: UPPER
> > *Option: UPPER
> > {
> > *rcNameID: =UPPER_TRAY_DISPLAY
> > *Command: CmdSelect
> > {
> > *Order: DOC_SETUP.9
> > *CallbackID: =SET_INPUTBIN
> > }
> > }
> > }
> > *Feature: Resolution
> > {
> > *rcNameID: =RESOLUTION_DISPLAY
> > *DefaultOption: Option1
> > *Option: Option1
> > {
> > *Name: "320 x 320 " =DOTS_PER_INCH
> > *DPI: PAIR(320, 320)
> > *TextDPI: PAIR(320, 320)
> > *SpotDiameter: 100
> > *Command: CmdSendBlockData { *CallbackID: =CMD_SEND_BLOCK_DATA
> > }
> > *Command: CmdSelect
> > {
> > *Order: DOC_SETUP.4
> > *CallbackID: =SET_RESOLUTION
> > }
> > }
> > }
> >
> > *Feature: PaperSize
> > {
> > *rcNameID: =PAPER_SIZE_DISPLAY
> > *DefaultOption: A4
> > *Option: A4
> > {
> > *rcNameID: =RCID_DMPAPER_SYSTEM_NAME
> > *PageProtectMem: 4249
> > *PrintableArea: PAIR(9352, 13400)
> > *PrintableOrigin: PAIR(260, 300)
> > *CursorOrigin: PAIR(260, 160)
> >
> > *Command: CmdSelect
> > {
> > *Order: DOC_SETUP.10
> > *CallbackID: =SET_PAPERSIZE
> > }
> > }
> > }
> > *Feature: MediaType
> > {
> > *rcNameID: =MEDIA_TYPE_DISPLAY
> > *DefaultOption: STANDARD
> > *Option: STANDARD
> > {
> > *rcNameID: =PLAIN_PAPER_DISPLAY
> > *Command: CmdSelect
> > {
> > *Order: DOC_SETUP.14
> > *CallbackID: =SET_MEDIATYPE
> > }
> > }
> > }
> >
> > *Feature: ColorMode
> > {
> > *rcNameID: =COLOR_PRINTING_MODE_DISPLAY
> > *DefaultOption: Color
> >
> > *Option: Color
> > {
> > *rcNameID: =24BPP_DISPLAY
> > *DevNumOfPlanes: 0
> > *DevBPP: 0
> > *DrvBPP:24
> > *Color? : TRUE
> > *ColorPlaneOrder: LIST(YELLOW, MAGENTA, CYAN, BLACK)
> > *RasterMode: DIRECT
> > *IPCallbackID: =COLOR_IPID
> > *Command: CmdSelect
> > {
> > *Order: DOC_SETUP.90
> > *CallbackID: =SET_COLORMODE
> > }
> > }
> > }
> >
> >
> > *Command: CmdStartDoc
> > {
> > *Order: DOC_SETUP.5
> > *CallbackID: =START_JOB
> > }
> > *Command: CmdStartPage
> > {
> > *Order: PAGE_SETUP.1
> > *CallbackID: =START_PAGE
> > }
> > *Command: CmdEndPage
> > {
> > *Order: PAGE_SETUP.1
> > *CallbackID: =END_PAGE
> > }
> > *Command: CmdEndJob
> > {
> > *Order: JOB_FINISH.1
> > *CallbackID: =END_JOB
> > }
> > *Command: CmdCopies
> > {
> > *Order: DOC_SETUP.11
> > *CallbackID: =SET_COPIES
> > }
> > *XMoveUnit: 1600
> > *YMoveUnit: 1600
> > *Command: CmdXMoveAbsolute { *CallbackID: 21 }
> > *Command: CmdYMoveAbsolute { *CallbackID: 22 }
> > *Command: CmdCR { *CallbackID: =CMD_CR }
> > *Command: CmdLF { *CallbackID: =CMD_LF }
> > *Command: CmdFF { *CallbackID: =CMD_FF }
> >
> > *FontFormat: OEM_CALLBACK
> > /////////////////////////////////////////////////////////
> >
> >
> >
> >
> > "Ashwin [MS]" <ashwinn@online.microsoft.com> wrote in message news:<B11B6C60-EF1A-4D4C-A2DC-E60077558036@microsoft.com>...
> > > If you are writing a bitmap driver, why are you specifying printer commands
> > > in your GPD? All your *Cmd statements should have null ("") commands.
> > >
> > > Also, you are specifying the same IPCallbackID for both ColorMode options
> > > which doesn't make sense. You want to be able to identify within your plugin
> > > which ColorMode option was chosen by the user...you can do this by specifying
> > > different IPCallbackIDs.
> > >
> > > "kaedeluv" wrote:
> > >
> > > > Hi. I am implementing a bitmap printer driver using oemuni sample in
> > > > NTDDK.
> > > > My problem is...
> > > > When I print a document, some(it could be one or more) garbage bitmaps
> > > > are generated in ImageProcessing. I just dumped the pSrcBitmap data to
> > > > a bitmap file in ImageProcessing. I think I can get a printed bitmap
> > > > image by merging all band images. But there is a problem in my driver.
> > > > As I mensioned above there are some garbage band images.
> > > >
> > > > For example... During one page is printed through my driver, the page
> > > > devided into 5 bands and I saved each band. When I checked the saved
> > > > iamges after printing is finished the last image is a garbage image.
> > > > It has any portion of the document. But the portion has already been
> > > > included in previous band image. So to get a perfect bitmap I should
> > > > merge the first four images in this case. But I think there is no way
> > > > to find out what image is garbage.
> > > >
> > > > I think the number of bands is sensitive to or dependent on the GPD.
> > > > But I don't know where should I change to solve this problem. If there
> > > > is no garbage image every printing job, all I have to do to get an
> > > > image is to merge all band images.
> > > >
> > > > Anyone has good idea to solve my problem?
> > > >
> > > > Thanks in advance.
> > > >
> > > >
> >

Re: IOemUni::ImageProcessing problem by kbl75

kbl75
Wed Aug 25 00:22:33 CDT 2004

Thanks Ashwin for your answer again.

I am sorry I can't do well though you helped a lot.
I visited the WinHEC web site but couldn't find any download link for
the kit.
Actually I don't have much time for solving this problem. If it's not
solved within several days, I won't be able to develop my driver any
more.

Before this problem, I had another problem with my driver. I posted a
question about it but no one answered yet. The problem was that my
driver couldn't print some boundary lines in table. That error didn't
happened in every document printing but some particular document such
as a PDF or MS Excel document. So I started looking for a way to solve
the problem. Implementing IOemUni::ImageProcessing is one of the best
alternative I found.

Anyway... As I told you previous message I have been doing trial and
error to find a optimum values for PaperSize feature. But I think it's
not a good idea.

Now from your latest answer I think I should have done something more
than just saving every band images as bitmaps. There have been a whole
black blank image every printing(the first band image was). I thought
it's nothing serious problem but now I guess it was a blank band.

Below is a snippet of my code in ImageProcessing. I just save the
pSrcBitmap data as a bitmap image every time the ImageProcessing
called.

///////////////////////////////////////////////////////////////////////////
fwrite(&bmfh, sizeof(BITMAPFILEHEADER), 1, stream); // bitmap file
header
fwrite(bmih, sizeof(BITMAPINFOHEADER), 1, stream); // bitmap info
header
fwrite(pSrcBitmap, sizeof(unsigned char), bmih->biSizeImage, stream);
// bitmap
///////////////////////////////////////////////////////////////////////////

Should I do anything else in ImageProcessing? Would you show me a
sample code here? If it's difficult to do that, could you tell me what
I have to do to get a perfect bitmap image?

Thanks for your time.


"Ashwin [MS]" <ashwinn@online.microsoft.com> wrote in message news:<A3B06773-2E21-46FB-ABE3-1BDF4E2E1BC6@microsoft.com>...
> The GPD I sent should work. I have written a bitmap driver with that GPD that
> dumps each band as individual bitmaps. The only other part in the driver is
> the actual dump within ImageProcessing. My guess is that you are doing
> something incorrect in ImageProcessing w.r.t blank bands. I would suggest
> that you try to get a hold of the most recent version of the Longhorn Driver
> Kit (LDK) and take a look at the bitmap driver sample in it. Since the LDK is
> not yet even a beta release, it might be difficult to get a hold of a
> copy...the most recent version was distributed at WinHEC.
>
> - Ashwin
>
>
> "kaedeluv" wrote:
>
> > Thanks again, Ashwin.
> >
> > I used the GPD you attached and tested but still the problem happens.
> > I guess GPD is not a cause of my problem any more.
> >
> > Now I think the PaperSize feature in GPD can cause the problem. While
> > I was testing my driver, I found that the number of bands and size of
> > bitmap images, including garbage image, vary as the values in
> > PrintableArea and other command in PaperSize feature. So I think to
> > solve my problem I should change the values and check generated
> > bitmaps. And find out the best value for a paper option. Do you think
> > it will be a good solution? If you have any doubtable point that you
> > think may cause my problem, please leave a message here.
> >
> > If I figure out, I will post a message here.
> > Thanks for your help and the GPD.
> >
> >
> > "Ashwin [MS]" <ashwinn@online.microsoft.com> wrote in message news:<EA8ADAD1-B711-418B-9922-7DDFE34DA5CA@microsoft.com>...
> > > IIRC, you cannot specify an IPCallbackID of 0...it has to be a non-zero
> > > number. Anyway, I am including a GPD that can be used (along with
> > > ImageProcessing) to dump each band out as an individual bitmap. Hope this
> > > helps.
> > >
> > > *GPDFileName: "banddmp.gpd"
> > > *GPDFileVersion: "1.0"
> > > *GPDSpecVersion: "1.0"
> > > *Include: "StdNames.gpd"
> > > *ModelName: "Band dump Bitmap Driver"
> > > *MasterUnits: PAIR(1200, 1200)
> > > *ResourceDLL: "unires.dll"
> > > *PrinterType: PAGE
> > > *MaxCopies: 99
> > >
> > > *PrintRate: 8
> > > *PrintRateUnit: PPM
> > > *PrintRatePPM: 8
> > >
> > > *Feature: Orientation
> > > {
> > > *rcNameID: =ORIENTATION_DISPLAY
> > > *DefaultOption: PORTRAIT
> > > *Option: PORTRAIT
> > > {
> > > *rcNameID: =PORTRAIT_DISPLAY
> > > *Command: CmdSelect
> > > {
> > > *Order: DOC_SETUP.6
> > > *Cmd: ""
> > > }
> > > }
> > > *Option: LANDSCAPE_CC90
> > > {
> > > *rcNameID: =LANDSCAPE_DISPLAY
> > > *Command: CmdSelect
> > > {
> > > *Order: DOC_SETUP.6
> > > *Cmd: ""
> > > }
> > > }
> > > }
> > > *Feature: InputBin
> > > {
> > > *rcNameID: =PAPER_SOURCE_DISPLAY
> > > *DefaultOption: UPPER
> > > *Option: UPPER
> > > {
> > > *rcNameID: =UPPER_TRAY_DISPLAY
> > > *Command: CmdSelect
> > > {
> > > *Order: DOC_SETUP.9
> > > *Cmd: ""
> > > }
> > > }
> > > }
> > > *Feature: Resolution
> > > {
> > > *rcNameID: =RESOLUTION_DISPLAY
> > > *DefaultOption: Option1
> > > *Option: Option1
> > > {
> > > *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 : "" }
> > > *Command: CmdEndRaster { *Cmd : "" }
> > > *Command: CmdSendBlockData { *Cmd : "" }
> > > *Command: CmdSelect
> > > {
> > > *Order: DOC_SETUP.4
> > > *Cmd: ""
> > > }
> > > }
> > > *Option: Option2
> > > {
> > > *Name: "150 x 150 " =DOTS_PER_INCH
> > > *DPI: PAIR(150, 150)
> > > *TextDPI: PAIR(300, 300)
> > > *MinStripBlankPixels: 32
> > > EXTERN_GLOBAL: *StripBlanks: LIST(ENCLOSED,TRAILING)
> > > *SpotDiameter: 100
> > > *Command: CmdBeginRaster { *Cmd : "" }
> > > *Command: CmdEndRaster { *Cmd : "" }
> > > *Command: CmdSendBlockData { *Cmd : "" }
> > > *Command: CmdSelect
> > > {
> > > *Order: DOC_SETUP.4
> > > *Cmd: ""
> > > }
> > > }
> > > }
> > >
> > > *Feature: PaperSize
> > > {
> > > *rcNameID: =PAPER_SIZE_DISPLAY
> > > *DefaultOption: LETTER
> > > *Option: LETTER
> > > {
> > > *rcNameID: =RCID_DMPAPER_SYSTEM_NAME
> > > *switch: Orientation
> > > {
> > > *case: PORTRAIT
> > > {
> > > *%(9600, 12648)
> > > *% *PrintableArea: PAIR(9600, 12648)
> > > *PrintableArea: PAIR(9564, 12600)
> > > *% *PrintableArea: PAIR(5000,5000)
> > > *PrintableOrigin: PAIR(300, 300)
> > > *% *PrintableOrigin: PAIR(300, 500)
> > > *switch: Resolution
> > > {
> > > *case: Option2
> > > {
> > > *% Warning: the following printable width is adjusted (9600->9592) so it is
> > > divisible by the resolution X scale.
> > > *% Warning: the following printable length is adjusted (12648->12640) so it
> > > is divisible by the resolution Y scale.
> > > *PrintableArea: PAIR(9592, 12640)
> > > *% Warning: the following printable origin X is adjusted (300->304) so it is
> > > divisible by the resolution X scale.
> > > *% Warning: the following printable origin Y is adjusted (300->304) so it is
> > > divisible by the resolution Y scale.
> > > *PrintableOrigin: PAIR(304, 304)
> > > }
> > > }
> > > *CursorOrigin: PAIR(300, 180)
> > > *Command: CmdSelect
> > > {
> > > *%5760 -- 7560
> > > *Order: DOC_SETUP.10
> > > *Cmd: ""
> > > }
> > > }
> > > *case: LANDSCAPE_CC90
> > > {
> > > *%(9720, 12648)
> > > *PrintableArea: PAIR(9760, 12688)
> > > *PrintableOrigin: PAIR(200, 272)
> > > *CursorOrigin: PAIR(200, 12960)
> > > *Command: CmdSelect
> > > {
> > > *Order: DOC_SETUP.10
> > > *Cmd: ""
> > > }
> > > }
> > > }
> > > }
> > > *Option: LEGAL
> > > {
> > > *rcNameID: =RCID_DMPAPER_SYSTEM_NAME
> > > *switch: Orientation
> > > {
> > > *case: PORTRAIT
> > > {
> > > *PrintableArea: PAIR(9540, 16248)
> > > *PrintableOrigin: PAIR(300, 300)
> > > *switch: Resolution
> > > {
> > > *case: Option2
> > > {
> > > *% Warning: the following printable width is adjusted (9600->9592) so it is
> > > divisible by the resolution X scale.
> > > *% Warning: the following printable length is adjusted (16248->16240) so it
> > > is divisible by the resolution Y scale.
> > > *PrintableArea: PAIR(9592, 16240)
> > > *% Warning: the following printable origin X is adjusted (300->304) so it is
> > > divisible by the resolution X scale.
> > > *% Warning: the following printable origin Y is adjusted (300->304) so it is
> > > divisible by the resolution Y scale.
> > > *PrintableOrigin: PAIR(304, 304)
> > > }
> > > }
> > > *CursorOrigin: PAIR(300, 180)
> > > *Command: CmdSelect
> > > {
> > > *Order: DOC_SETUP.10
> > > *Cmd: ""
> > > }
> > > }
> > > *case: LANDSCAPE_CC90
> > > {
> > > *PrintableArea: PAIR(9760, 16288)
> > > *PrintableOrigin: PAIR(200, 272)
> > > *CursorOrigin: PAIR(200, 16560)
> > > *Command: CmdSelect
> > > {
> > > *Order: DOC_SETUP.10
> > > *Cmd: ""
> > > }
> > > }
> > > }
> > > }
> > > }
> > > *Feature: MediaType
> > > {
> > > *rcNameID: =MEDIA_TYPE_DISPLAY
> > > *DefaultOption: STANDARD
> > > *Option: STANDARD
> > > {
> > > *rcNameID: =PLAIN_PAPER_DISPLAY
> > > *Command: CmdSelect
> > > {
> > > *Order: DOC_SETUP.14
> > > *Cmd: ""
> > > }
> > > }
> > > *Option: TRANSPARENCY
> > > {
> > > *rcNameID: =TRANSPARENCY_DISPLAY
> > > *Command: CmdSelect
> > > {
> > > *Order: DOC_SETUP.14
> > > *Cmd: ""
> > > }
> > > }
> > > }
> > > *Feature: ColorMode
> > > {
> > > *rcNameID: =COLOR_PRINTING_MODE_DISPLAY
> > > *HelpIndex: 12004
> > > *DefaultOption: 24bpp
> > > *Option: 24bpp
> > > {
> > > *rcNameID: =24BPP_DISPLAY
> > > *DevNumOfPlanes: 0
> > > *DevBPP: 0
> > > *DrvBPP: 24
> > > *IPCallbackID: 24
> > > *Command: CmdEnableDRC { *Cmd : "" }
> > >