yjjie
驱动牛犊
驱动牛犊
  • 注册日期2008-06-12
  • 最后登录2008-11-08
  • 粉丝1
  • 关注0
  • 积分1分
  • 威望10点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:6956回复:2

打印机DDK sample—Bitmap

楼主#
更多 发布于:2008-11-08 17:20
bitmap这个驱动是把所有的页面通过 OEMEndDoc函数 保存到一个文本!
我对它进行了点修改,我添加OEMStartDoc,OEMSendPage两个函数
介绍是OEMStartDoc 打印开始的时候呼出!
OEMSendPage是已经得到一个页面数据的时候呼出!

但是我碰到一个问题:OEMSendPage不会再最后一个页面结束的时候呼出!就是说用OEMSendPage保存数据,少了最后一页!!!

还有一个问题,我Office Word 2007 打印的时候 包含图片的页面我接收不到
但是... Bitmap 用OEMEndDoc 却可以接收到所有数据,我就纳闷了。我到底漏了哪些部分!

做个虚拟打印机驱动,从哪个历程修改比较好,请大家多多指教!谢谢

最新喜欢:

xmuhlxmuhl
人生程序
kingmax5421
驱动牛犊
驱动牛犊
  • 注册日期2008-11-13
  • 最后登录2015-06-17
  • 粉丝1
  • 关注0
  • 积分63分
  • 威望502点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2008-12-02 11:31
To yjjie:

 给你顶一下。

我的MSN: kingmax5421@msn.com

交流一下!
kingmax5421
驱动牛犊
驱动牛犊
  • 注册日期2008-11-13
  • 最后登录2015-06-17
  • 粉丝1
  • 关注0
  • 积分63分
  • 威望502点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2008-12-02 14:23
Unidrv Bitmap Plugin Sample
Description
The Unidrv Bitmap Plugin sample demonstrates how to write a Unidrv-based bitmap driver. The sample is based on the redesigned version of the oemuni sample that also ships with the Windows DDK.
Theory of Operation
This sample includes the following features:
The supported ColorMode options in the bitmap driver’s GPD are monochrome, 4bpp, 8bpp, and 24bpp.
The bitmap driver implements the IPrintOemUni::ImageProcessing callback to access bitmap data one band at a time. The driver’s implementation of ImageProcessing buffers the band data every time it is called. The function is also responsible for filling the BITMAPINFOHEADER and COLORTABLE structures that are necessary for dumping the data out to a bitmap file.
The bitmap driver implements the OEMEndDoc DDI hook to dump the buffered bitmap data to the spooler at the end of the print job. The driver’s implementation of OEMEndDoc dumps the headers first and then the buffered data.
The GrowBuffer helper function is called every time the buffer needs to be enlarged to hold the bitmap data.
The bitmap driver renders multi-page documents into a single large output bitmap file.
 
This sample has the following known issues:
The plug-in does not support landscape orientation although the option exists in the GPD.
In 24bpp mode, documents larger than three pages will produce an extremely large bitmap (.bmp) file. Although the output is correct, you might not be able to view it because of memory limitations in the bitmap viewer.
Implementation and Design
To create a version with verbose debug output, add _DEBUG to the compile defines in the sources file.
Custom Implementation
To create a version with verbose debug output, add _DEBUG to the compile defines in the sources file.
Installation
General
After building the sample, you can install it by using the Add Printer Wizard and supplying the INF file that is part of the sample when you are prompted for an INF in the wizard. You do not need to copy the Unidrv binaries that are required for this driver to the local directory that contains bitmap.inf. You could install the printer on the FILE: port or you could create a port on a disk-file.
Code Tour
File Manifest
File Description
ddihook.cpp Source module that contains the implementation of OEMEndDoc.
ddihook.h Source module that defines the constants used to control DDI hooking. (IMPL_ALPHABLEND, IMPL_BITBLT, IMPL_NEXTBAND etc.)
debug.cpp  Source module that contains the debugging functions. (COemUniDbg::vDumpSURFOBJ, COemUniDbg::vDumpSTROBJ etc.)
debug.h The header file for the debug module defined in debug.cpp. (Definition of the COemUniDbg class)
devmode.cpp Source module that contains implementation of the OEM Devmode functions. (hrOEMDevmode, bConvertOEMDevmode etc.)
devmode.h  The header for devmode.cpp.
dllentry.cpp  Source module for DLL entry functions. (DllMain)
enable.cpp  Source module that contains the enable routines for the rendering plug-in. (OEMEnableDriver, OEMEnablePDEV, OEMDisableDriver etc.)
intrface.cpp Source module that implements the OEM COM printer customization rendering plug-in interface. (COemUni2::ImageProcessing, COemUni2::FilterGraphics etc.)
intrface.h  The header file for intrface.cpp that defines the COM interface for the rendering plug-in. (Definition of the COemUni2 class)
makefile  The generic makefile for building the code sample.
bitmap.def  The file that lists the exported functions for the sample.
bitmap.h  The header file that defines the PDEV class for the sample. (Definition and implementation of the COemPDEV class)
bitmap.rc  The resources file for the rendering plugin’s resources.
precomp.h  The header file that includes the header files to precompile.
resource.h  The header file the resources file.
sources The generic sources file for building the code sample.
bitmap.gpd The GPD file for this bitmap driver sample.
bitmap.inf The printer INF that will install this sample once it is built.
bitmap.ini The printer ini file that specifies the rendering plug-in DLL for this sample.
游客

返回顶部