Tech Support > Microsoft Windows > Drivers > unidrv resolution issue (Please help)
unidrv resolution issue (Please help)
Posted by Jobby on May 16th, 2005


Hi All,
I am a new guy in the
driver development. My task is to develop an image driver which actually
create multi-page tiff's. I am some
what sucessfull in developing that(using unidrv).
The procedure that i follow is to create the bitmap in ImageProcessing and
then later create the tiff from these
images. I got te GPD from some sample files and managed to print with a
resolution 150X150 but now i want this to
print in an higher resolution like 300X300.
I tried different options(for 300X300) for *PrintableArea and
*PrintableOrigin, but the bitmap seems to get cut.
Can sombody please tell me what i am doing wrong or if i put this correctly,

1) how do i do this?
2) what is the relation between *PrintableArea and *PrintableOrigin for
different resolutions and Orientations?
3) What does *%(9600, 12648) mean for Potrait orintation(8.5X11 inc), can
some one tell how we come with these two numbers related to the *MasterUnits:

I lookied in to the DDK documentation but did find an answer.


If somebody can please help me with this or some pointers in the internet
where i can go and find out how to do this
will be largly appreciated.

Note :Part of my GPD file looks like this
************************************************** ***************
:
:
*MasterUnits: PAIR(1200, 1200)
*ResourceDLL: "unires.dll"
*PrinterType: PAGE
*MaxCopies: 1
*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: Resolution
{
*rcNameID: =RESOLUTION_DISPLAY
*DefaultOption: Option2
*Option: Option2
{
*Name: "150 x 150 " =DOTS_PER_INCH
*DPI: PAIR(150, 150)
*TextDPI: PAIR(300, 300)
*SpotDiameter: 100
*Command: CmdBeginRaster { *Cmd : "" }
*Command: CmdEndRaster { *Cmd : "" }
*Command: CmdSendBlockData { *Cmd : "" }
*Command: CmdSelect
{
*Order: DOC_SETUP.4
*Cmd: ""
}
}
*Option: Option3
{
*Name: "300 x 300 " =DOTS_PER_INCH
*DPI: PAIR(300, 300)
*TextDPI: PAIR(600, 600)
*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)
*CursorOrigin: PAIR(300, 180)
*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)
}
*case: Option3
{
*PrintableArea: PAIR(9592, 12640)
*PrintableOrigin: PAIR(100, 604)
}
}
*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: ""
}
}
}
}
...................
..................
..................

*Feature: MediaType
{
*rcNameID: =MEDIA_TYPE_DISPLAY
*DefaultOption: STANDARD
*Option: STANDARD
{
*rcNameID: =PLAIN_PAPER_DISPLAY
*DefaultQuality: BETTERQUALITY
*Command: CmdSelect
{
*Order: DOC_SETUP.14
*Cmd: ""
}
}
*Option: TRANSPARENCY
{
*rcNameID: =TRANSPARENCY_DISPLAY
*DefaultQuality: BETTERQUALITY
*Command: CmdSelect
{
*Order: DOC_SETUP.14
*Cmd: ""
}
}
}
*Feature: ColorMode
{
*rcNameID: =COLOR_PRINTING_MODE_DISPLAY
*HelpIndex: 12004
*DefaultOption: 24bpp
*Option: 24bpp
{
*rcNameID: =24BPP_DISPLAY

*DevNumOfPlanes: 1
*DevBPP: 24
*DrvBPP: 24
*IPCallbackID: 7
*PaletteSize: 256
*PaletteProgrammable?:TRUE
*Command: CmdDefinePaletteEntry { *Cmd : "" }
*Command: CmdSelectPaletteEntry { *Cmd : ""}
*RasterMode: DIRECT

EXTERN_GLOBAL: *RasterSendAllData? : TRUE
}
}
*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_CR_90,TC_UA_ABLE)
*MemoryUsage: LIST(FONT)
*CursorXAfterCR: AT_PRINTABLE_X_ORIGIN
*BadCursorMoveInGrxMode: LIST(X_PORTRAIT,Y_LANDSCAPE)
*XMoveThreshold: 0
*YMoveThreshold: 0
*XMoveUnit: 300
*YMoveUnit: 300
*Command: CmdXMoveAbsolute { *Cmd : "" }
*Command: CmdXMoveRelRight { *Cmd : "" }
*Command: CmdXMoveRelLeft { *Cmd : "" }
*Command: CmdYMoveAbsolute { *Cmd : "" }
*Command: CmdYMoveRelDown { *Cmd : "" }
*Command: CmdYMoveRelUp { *Cmd : "" }
*Command: CmdCR { *Cmd : "" }
*Command: CmdLF { *Cmd : "" }
*Command: CmdFF { *Cmd : "" }
*Command: CmdDefinePaletteEntry { *Cmd : "" }
*Command: CmdSelectPaletteEntry { *Cmd : "" }
*Command: CmdBackSpace { *Cmd : "" }
*Command: CmdUniDirectionOn { *Cmd : "" }
*Command: CmdUniDirectionOff { *Cmd : "" }
*Command: CmdPushCursor { *Cmd : "" }
*Command: CmdPopCursor { *Cmd : "" }
*Command: CmdSetSimpleRotation { *Cmd : "" }
*EjectPageWithFF?: TRUE
*OutputDataFormat: H_BYTE
*OptimizeLeftBound?: FALSE
*CursorXAfterSendBlockData: AT_GRXDATA_ORIGIN
*CursorYAfterSendBlockData: AUTO_INCREMENT

*DefaultFont: 136
*DefaultCTT: 0
*CharPosition: BASELINE
*TTFSEnabled?: TRUE
*DeviceFonts:
LIST(134,135,136,137,138,139,140,146,147,148,149,1 50,151,152,153,154,
+ 155,156,157,164,165,166,196,197,198,199,200,201,20 2,203,209,210,
+ 211,212,213,214,215,216,217,218,219,220,221,222,22 3,224,225,226,
+ 227,228,229,230)

*MinFontID: 16534
*MaxFontID: 32768
*FontFormat: HPPCL_OUTLINE
*% When the %f format is implemented we can remove the /100 part of
*% CmdSelectFontHeight and CmdSelectFontWidth
*% NOTE: MasterUnits.x is hardcoded here!
*% NOTE: THIS dividing by 200 because I want to /100 and then /2 for now.
*% The number 60000 may look strange, but it's 1200/2 * 100.
*Command: CmdSelectFontHeight { *Cmd : "" }
*Command: CmdSelectFontWidth { *Cmd : "" }
*Command: CmdSetFontID { *Cmd : "" }
*Command: CmdSelectFontID { *Cmd : "" }
*Command: CmdSetCharCode { *Cmd : "" }
*Command: CmdUnderlineOn { *Cmd : "" }
*Command: CmdUnderlineOff { *Cmd : "" }
*Command: CmdWhiteTextOn { *Cmd : "" }
*Command: CmdWhiteTextOff { *Cmd : "" }
*MinGrayFill: 1
*MaxGrayFill: 100
*Command: CmdSetRectWidth { *Cmd : "" }
*Command: CmdSetRectHeight { *Cmd : "" }
*Command: CmdRectGrayFill { *Cmd : "" }
*Command: CmdRectWhiteFill { *Cmd : "" }
*Command: CmdRectBlackFill { *Cmd : "" }

Thanks in advance,
Jobby

Posted by Bobby Mattappally [MS] on May 16th, 2005


Please try the bitmap sample shipped with the latest DDK (server 2003 sp1)

--------------------

Hi All,
I am a new guy in the
driver development. My task is to develop an image driver which actually
create multi-page tiff's. I am some
what sucessfull in developing that(using unidrv).
The procedure that i follow is to create the bitmap in ImageProcessing and
then later create the tiff from these
images. I got te GPD from some sample files and managed to print with a
resolution 150X150 but now i want this to
print in an higher resolution like 300X300.
I tried different options(for 300X300) for *PrintableArea and
*PrintableOrigin, but the bitmap seems to get cut.
Can sombody please tell me what i am doing wrong or if i put this
correctly,



Hope this helps.

Thank you,
Bobby Mattappally
Microsoft

This posting is provided "AS IS" with no warranties, and confers no rights.

Posted by Jobby on May 17th, 2005


HI Bobby,
Thanks, i found that sample, but how can i use this along w2k any suggestions.

Jobby

"Bobby Mattappally [MS]" wrote:

Posted by Bobby Mattappally [MS] on May 20th, 2005


The main difference is the IPrintOemUni2 interface
XP Unidrv (that supports IPrintOemUni2) was backported to W2K SP3.
So the sample should work on W2K SP3 and later.


--------------------
Thread-Topic: unidrv resolution issue (Please help)
thread-index: AcVbHqUQewLM9mDPTkSs+MoOWJxxBg==
X-WBNR-Posting-Host: 66.210.26.81
From: "=?Utf-8?B?Sm9iYnk=?=" <Jobby@discussions.microsoft.com>
References: <169A42F4-2117-4433-BB6C-9BE4FD502ABE@microsoft.com>
<Xvi7HPmWFHA.2476@TK2MSFTNGXA01.phx.gbl>
Subject: RE: unidrv resolution issue (Please help)
Date: Tue, 17 May 2005 13:26:02 -0700

HI Bobby,
Thanks, i found that sample, but how can i use this along w2k any
suggestions.

Jobby

"Bobby Mattappally [MS]" wrote:


Hope this helps.

Thank you,
Bobby Mattappally
Microsoft

This posting is provided "AS IS" with no warranties, and confers no rights.


Posted by Jobby on May 20th, 2005


Thanks bobby, that was of a great help.
Can i ask you one more question? It is related to the resolution in for the
image and the DPI that we add in the GPD file. I have been trying with this
for long and could not figure out this and it frustrates me.
From some place i found out that the if you want a resolution of 300X300 DPI
(feo Letter 8.5X11in size potrait) then the *PrintableArea: should be 300*8.5
= 2550 and 300*11 = 3300 and the *PrintableOrign can me PAIR (1,1) if you
actually don't need any margins. But i tried this with my driver which still
cutts off the image(i.e i only get small portion of the image). If possible
can you please explain how all these are related or else if you have some
links where i can find out how to write a GPD file (other than the DDK
documentation)

My ImageProcessing looks like this:

HRESULT __stdcall IOemUni::ImageProcessing(
PDEVOBJ pdevobj,
PBYTE pSrcBitmap,
PBITMAPINFOHEADER pBitmapInfoHeader,
PBYTE pColorTable,
DWORD dwCallbackID,
PIPPARAMS pIPParams,
OUT PBYTE *ppbResult)
{
VERBOSE(DLLTEXT("IOemUni::ImageProcessing() entry.\r\n"));
LogMessage ("IOemUni::ImageProcessing() entry.\r\n");

MyDBG ("********************* %ld X %ld ***********************\r\n"
,pBitmapInfoHeader->biXPelsPerMeter, pBitmapInfoHeader->biYPelsPerMeter);

MyDBG ("**************Printer details *********************\n");
MyDBG ("pdevobj->pPublicDM ->dmYResolution :%ld\n", pdevobj->pPublicDM
->dmYResolution);

TCHAR szTempDirName[MAX_PATH];
TCHAR szTempFileName[MAX_PATH];
GetTempPath (MAX_PATH, szTempDirName);
GetTempFileName(szTempDirName,TEXT("BMP"),0,szTemp FileName);

char szAnsiTempFileName[1024];
StringCbPrintfA(szAnsiTempFileName, sizeof(szAnsiTempFileName), "%S",
szTempFileName);
int nLen = strlen(szAnsiTempFileName);
StringCchCopyA(szAnsiTempFileName + nLen - 3, sizeof(szAnsiTempFileName),
"bmp");


LPWSTR lpszBitmapFile = new WCHAR[1024];
StringCbPrintfW(lpszBitmapFile,1024,L"%S",szAnsiTe mpFileName);

allFilesW[count] = lpszBitmapFile;

count++;

if (SaveBitmap(lpszBitmapFile,pSrcBitmap,pBitmapInfoH eader,pColorTable))
MyDBG ("Bitmap file created\r\n");
else
MyDBG ("Cannot create bitmap file\r\n");
return S_OK;
}

Where the function SaveBitmap(.....) creates the bitmap image.

The GPD i used is posted in the first question.

Please help me.

"Bobby Mattappally [MS]" wrote:

Posted by Bobby Mattappally [MS] on May 20th, 2005


Jobby,
--------------------


Thanks bobby, that was of a great help.
Can i ask you one more question? It is related to the resolution in for the
image and the DPI that we add in the GPD file. I have been trying with this
for long and could not figure out this and it frustrates me.
From some place i found out that the if you want a resolution of 300X300
DPI
(feo Letter 8.5X11in size potrait) then the *PrintableArea: should be
300*8.5
= 2550 and 300*11 = 3300 and the *PrintableOrign can me PAIR (1,1) if you


You need to represent the dimensions in "Master Units".
Please see the detailed explanation on Master Units below.
http://msdn.microsoft.com/library/en...t5gpd_c7da5ac1
-b971-4a3d-a5f2-f69a98f2278f.xml.asp


Hope this helps.

Thank you,
Bobby Mattappally
Microsoft

This posting is provided "AS IS" with no warranties, and confers no rights.

Posted by Bobby Mattappally [MS] on May 20th, 2005


Jobby,

I looked at your GPD file and you have the below:

*MasterUnits: PAIR(1200, 1200)

So your printable area should be 1200*8.5 and 1200*11.
You are currently specifying a paper width and height of (8.5/4) X (11/4)

Hope this helps.

Thank you,
Bobby Mattappally
Microsoft

This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
Newsgroups: microsoft.public.development.device.drivers
From: bobbym@online.microsoft.com (Bobby Mattappally [MS])
Organization: Microsoft
Date: Fri, 20 May 2005 21:30:35 GMT
Subject: RE: unidrv resolution issue (Please help)
X-Tomcat-NG: microsoft.public.development.device.drivers
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="--Next.Tomcat.Message.With.ASCII.and.RTF.89734972302 30"
Content-Transfer-Encoding: 7bit

Jobby,
--------------------


Thanks bobby, that was of a great help.
Can i ask you one more question? It is related to the resolution in for the
image and the DPI that we add in the GPD file. I have been trying with this
for long and could not figure out this and it frustrates me.
From some place i found out that the if you want a resolution of 300X300
DPI
(feo Letter 8.5X11in size potrait) then the *PrintableArea: should be
300*8.5
= 2550 and 300*11 = 3300 and the *PrintableOrign can me PAIR (1,1) if you


You need to represent the dimensions in "Master Units".
Please see the detailed explanation on Master Units below.
http://msdn.microsoft.com/library/en...t5gpd_c7da5ac1
-b971-4a3d-a5f2-f69a98f2278f.xml.asp


Hope this helps.

Thank you,
Bobby Mattappally
Microsoft

This posting is provided "AS IS" with no warranties, and confers no rights.






Similar Posts