Printer Driver - custom paper size

拥有回忆 提交于 2020-06-29 01:43:42

问题


I'm working on custom printer V3 driver. The current task is to give ability to create custom paper size to user. I google it a bit and found 2 ways of doing that:

1) CUSTOMSIZE option in GPD file. I've added this to my GPD file:

  *Option: CUSTOMSIZE
{
    *rcNameID: =USER_DEFINED_SIZE_DISPLAY
    *MinSize: PAIR(4724, 6992)      
    *MaxSize: PAIR(14032, 20410)    
    *MaxPrintableWidth: 14032
    *MinLeftMargin: 0
    *CenterPrintable?: FALSE
    *Command: CmdSelect
    {
        *Order: PAGE_SETUP.2
        *Cmd: ""
    }
}

, but could not find where it appears in UI.

2) also I found that some printers have custom dialogs which allow to create custom paper size. For example:

Is it possible to create for V3 printer driver? If yes then how?

Thanks in advance!


回答1:


Yes. Both ways work. To use customized (vendor-defined or user-defined) paper sizes (non-standard paper sizes) in V4 and V3 printer driver models, you can go through the following links but you need to develop some codes:

https://docs.microsoft.com/en-us/windows-hardware/drivers/print/unidrv-minidrivers

https://docs.microsoft.com/en-us/windows-hardware/drivers/print/printer-features

https://docs.microsoft.com/en-us/windows-hardware/drivers/print/customized-features

https://docs.microsoft.com/en-us/windows-hardware/drivers/print/customized-options

https://docs.microsoft.com/en-us/windows-hardware/drivers/print/specifying-paper-sizes

https://docs.microsoft.com/en-us/windows-hardware/drivers/print/supporting-vendor-defined-paper-sizes

https://docs.microsoft.com/en-us/windows-hardware/drivers/print/supporting-user-defined-paper-sizes

In V4 print driver model, changing .gpd file breaks the driver package sign and you will have difficulty to install your changed driver package in Windows Driver Repository. You have to re-sign the driver package that it does not look as simple as it sounds if you are not developing your own driver.

The second way is in fact provided by the driver vendor or developer using the first one. They include some GDL schema-based description in the .gpd file(s) of their driver to allow the end users to define their own custom paper size(s). For a clear and straight forward sample, see the last link above.




回答2:


Custom size paper should be created by the user in "Print server properties" form. It appeared in the paper size dropdown for the printer if fits minsize/maxsize and others.



来源:https://stackoverflow.com/questions/34613235/printer-driver-custom-paper-size

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!