How to add papsersize to microsoft XPS document Writer by modify .gpd file

441 Views Asked by At

I wish to add a new papersize named 'ABC'

I Add in mxdwdui.gpd file as follows

*Option: ABC { *rcName: =258 *OptionID: 258 *PageDemenssion: PAIR(10000, 10000) *PrintableArea: PAIR(9900, 9900) *PrintableOrigin: PAIR(50, 50) }

It meet the Requirements of document https://learn.microsoft.com/en-us/windows-hardware/drivers/print/supporting-vendor-defined-paper-sizes

But I can not open Printer preferences if I Add it

Anyone knows how to make it? Thanks a lot.

1

There are 1 best solutions below

3
On

You should use "*PageDimensions" instead of "*PageDemenssion". I would also recommend "*Name" instead of "*rcName". The following should work:

*Option: ABC
{
    *Name: "ABC"
    *PageDimensions: PAIR(10000,10000)
    *switch: Orientation
    {
        *case: PORTRAIT
        {
            *PrintableArea: PAIR(9900,9900)
            *PrintableOrigin: PAIR(50, 50)
            *CursorOrigin: PAIR(50, 50)
        }
        *case: LANDSCAPE_CC270
        {
            *PrintableArea: PAIR(9900,9900)
            *PrintableOrigin: PAIR(50, 50)
            *CursorOrigin: PAIR(50, 50)
        }
    }
}