! *viewer/papersizes.pvc - Paper Sizes Object
! By Gord Davey
! (c) Copyright 2004-2005 Sage Software Canada Ltd.
! Version:
! Source Code File: $RCSfile: papersizes.pvs,v $   Version: $Revision: 1.5 $
!      Last Edited: $Date: 2005/10/14 15:31:18 $   Author: $Author: gordd $
!
def class "*viewer/papersizes" unique

    property Version$ = mid(mid("$Revision: 1.5 $",12), 1, len(mid("$Revision: 1.5 $",12)) - 2)
    precision 3

    property DMPAPER_LETTER                         = 1
    property DMPAPER_LETTERSMALL                    = 2
    property DMPAPER_TABLOID                        = 3
    property DMPAPER_LEDGER                         = 4
    property DMPAPER_LEGAL                          = 5
    property DMPAPER_STATEMENT                      = 6
    property DMPAPER_EXECUTIVE                      = 7
    property DMPAPER_A3                             = 8
    property DMPAPER_A4                             = 9
    property DMPAPER_A4SMALL                        = 10
    property DMPAPER_A5                             = 11
    property DMPAPER_B4                             = 12
    property DMPAPER_B5                             = 13
    property DMPAPER_FOLIO                          = 14
    property DMPAPER_QUARTO                         = 15
    property DMPAPER_10X14                          = 16
    property DMPAPER_11X17                          = 17
    property DMPAPER_NOTE                           = 18
    property DMPAPER_ENV_9                          = 19
    property DMPAPER_ENV_10                         = 20
    property DMPAPER_ENV_11                         = 21
    property DMPAPER_ENV_12                         = 22
    property DMPAPER_ENV_14                         = 23
    property DMPAPER_CSHEET                         = 24
    property DMPAPER_DSHEET                         = 25
    property DMPAPER_ESHEET                         = 26
    property DMPAPER_ENV_DL                         = 27
    property DMPAPER_ENV_C5                         = 28
    property DMPAPER_ENV_C3                         = 29
    property DMPAPER_ENV_C4                         = 30
    property DMPAPER_ENV_C6                         = 31
    property DMPAPER_ENV_C65                        = 32
    property DMPAPER_ENV_B4                         = 33
    property DMPAPER_ENV_B5                         = 34
    property DMPAPER_ENV_B6                         = 35
    property DMPAPER_ENV_ITALY                      = 36
    property DMPAPER_ENV_MONARCH                    = 37
    property DMPAPER_ENV_PERSONAL                   = 38
    property DMPAPER_FANFOLD_US                     = 39
    property DMPAPER_FANFOLD_STD_GERMAN             = 40
    property DMPAPER_FANFOLD_LGL_GERMAN             = 41
    property DMPAPER_ISO_B4                         = 42
    property DMPAPER_JAPANESE_POSTCARD              = 43
    property DMPAPER_9X11                           = 44
    property DMPAPER_10X11                          = 45
    property DMPAPER_15X11                          = 46
    property DMPAPER_ENV_INVITE                     = 47
    property DMPAPER_RESERVED_48                    = 48
    property DMPAPER_RESERVED_49                    = 49
    property DMPAPER_LETTER_EXTRA                   = 50
    property DMPAPER_LEGAL_EXTRA                    = 51
    property DMPAPER_TABLOID_EXTRA                  = 52
    property DMPAPER_A4_EXTRA                       = 53
    property DMPAPER_LETTER_TRANSVERSE              = 54
    property DMPAPER_A4_TRANSVERSE                  = 55
    property DMPAPER_LETTER_EXTRA_TRANSVERSE        = 56
    property DMPAPER_A_PLUS                         = 57
    property DMPAPER_B_PLUS                         = 58
    property DMPAPER_LETTER_PLUS                    = 59
    property DMPAPER_A4_PLUS                        = 60
    property DMPAPER_A5_TRANSVERSE                  = 61
    property DMPAPER_B5_TRANSVERSE                  = 62
    property DMPAPER_A3_EXTRA                       = 63
    property DMPAPER_A5_EXTRA                       = 64
    property DMPAPER_B5_EXTRA                       = 65
    property DMPAPER_A2                             = 66
    property DMPAPER_A3_TRANSVERSE                  = 67
    property DMPAPER_A3_EXTRA_TRANSVERSE            = 68
    property DMPAPER_DBL_JAPANESE_POSTCARD          = 69
    property DMPAPER_A6                             = 70
    property DMPAPER_JENV_KAKU2                     = 71
    property DMPAPER_JENV_KAKU3                     = 72
    property DMPAPER_JENV_CHOU3                     = 73
    property DMPAPER_JENV_CHOU4                     = 74
    property DMPAPER_LETTER_ROTATED                 = 75
    property DMPAPER_A3_ROTATED                     = 76
    property DMPAPER_A4_ROTATED                     = 77
    property DMPAPER_A5_ROTATED                     = 78
    property DMPAPER_B4_JIS_ROTATED                 = 79
    property DMPAPER_B5_JIS_ROTATED                 = 80
    property DMPAPER_JAPANESE_POSTCARD_ROTATED      = 81
    property DMPAPER_DBL_JAPANESE_POSTCARD_ROTATED  = 82
    property DMPAPER_A6_ROTATED                     = 83
    property DMPAPER_JENV_KAKU2_ROTATED             = 84
    property DMPAPER_JENV_KAKU3_ROTATED             = 85
    property DMPAPER_JENV_CHOU3_ROTATED             = 86
    property DMPAPER_JENV_CHOU4_ROTATED             = 87
    property DMPAPER_B6_JIS                         = 88
    property DMPAPER_B6_JIS_ROTATED                 = 89
    property DMPAPER_12X11                          = 90
    property DMPAPER_JENV_YOU4                      = 91
    property DMPAPER_JENV_YOU4_ROTATED              = 92
    property DMPAPER_P16K                           = 93
    property DMPAPER_P32K                           = 94
    property DMPAPER_P32KBIG                        = 95
    property DMPAPER_PENV_1                         = 96
    property DMPAPER_PENV_2                         = 97
    property DMPAPER_PENV_3                         = 98
    property DMPAPER_PENV_4                         = 99
    property DMPAPER_PENV_5                         = 100
    property DMPAPER_PENV_6                         = 101
    property DMPAPER_PENV_7                         = 102
    property DMPAPER_PENV_8                         = 103
    property DMPAPER_PENV_9                         = 104
    property DMPAPER_PENV_10                        = 105
    property DMPAPER_P16K_ROTATED                   = 106
    property DMPAPER_P32K_ROTATED                   = 107
    property DMPAPER_P32KBIG_ROTATED                = 108
    property DMPAPER_PENV_1_ROTATED                 = 109
    property DMPAPER_PENV_2_ROTATED                 = 110
    property DMPAPER_PENV_3_ROTATED                 = 111
    property DMPAPER_PENV_4_ROTATED                 = 112
    property DMPAPER_PENV_5_ROTATED                 = 113
    property DMPAPER_PENV_6_ROTATED                 = 114
    property DMPAPER_PENV_7_ROTATED                 = 115
    property DMPAPER_PENV_8_ROTATED                 = 116
    property DMPAPER_PENV_9_ROTATED                 = 117
    property DMPAPER_PENV_10_ROTATED                = 118
    property DMPAPER_LAST                           = DMPAPER_PENV_10_ROTATED
    property DMPAPER_USER                           = 256

    ! Returns 1=Size Exists, 0=No Such Size
    function GetPaperSize(PaperNumber%)             GetPaperProperties

    ! Returns 1=Size Exists, 0=No Such Size, and Name
    function GetPaperSize(PaperNumber%, PaperName$) GetPaperProperties

    ! Returns 1=Size Exists, 0=No Such Size, and all paper properties
    function GetPaperSize(PaperNumber%, PaperName$, WidthInches, LengthInches, Widthmm, Lengthmm) GetPaperProperties

    ! Returns 1=Size Exists, 0=No Such Size, and all paper properties
    function GetPaperSize(PaperNumber%, PaperName$, WidthInches, LengthInches, Widthmm, Lengthmm, WindowsName$) GetPaperProperties

    ! Returns 1=Success, 0=No Names, and a SEP delim list of Paper names (not bin 256)
    function GetPaperSizeNames(PaperNames$)         GetPaperNames

fnend
!
!
GetPaperProperties:
    enter (Value%), PaperName$, WidthInches, LengthInches, Widthmm, Lengthmm, WindowsName$, err=*next

    switch Value%
        case 1
            WindowsName$ = "DMPAPER_LETTER", \
            x$ = msg("DMPAPER_LETTER"), \
            PaperName$ = tbl(x$ <> "DMPAPER_LETTER:", x$, "Letter 8-1/2 x 11 inches"), \
            WidthInches = 8.5, \
            LengthInches = 11, \
            Widthmm = 215.9, \
            Lengthmm = 279.4
            break

        case 2
            WindowsName$ = "DMPAPER_LETTERSMALL", \
            x$ = msg("DMPAPER_LETTERSMALL"), \
            PaperName$ = tbl(x$ <> "DMPAPER_LETTERSMALL:", x$, "Letter Small 8-1/2 x 11 inches"), \
            WidthInches = 8.5, \
            LengthInches = 11, \
            Widthmm = 215.9, \
            Lengthmm = 279.4
            break

        case 3
            WindowsName$ = "DMPAPER_TABLOID", \
            x$ = msg("DMPAPER_TABLOID"), \
            PaperName$ = tbl(x$ <> "DMPAPER_TABLOID:", x$, "Tabloid 11 x 17 inches"), \
            WidthInches = 11, \
            LengthInches = 17, \
            Widthmm = 279.4, \
            Lengthmm = 431.8
            break

        case 4
            WindowsName$ = "DMPAPER_LEDGER", \
            x$ = msg("DMPAPER_LEDGER"), \
            PaperName$ = tbl(x$ <> "DMPAPER_LEDGER:", x$, "Ledger 17 x 11 inches"), \
            WidthInches = 17, \
            LengthInches = 11, \
            Widthmm = 431.8, \
            Lengthmm = 279.4
            break

        case 5
            WindowsName$ = "DMPAPER_LEGAL", \
            x$ = msg("DMPAPER_LEGAL"), \
            PaperName$ = tbl(x$ <> "DMPAPER_LEGAL:", x$, "Legal 8-1/2 x 14 inches"), \
            WidthInches = 8.5, \
            LengthInches = 14, \
            Widthmm = 215.9, \
            Lengthmm = 355.6
            break

        case 6
            WindowsName$ = "DMPAPER_STATEMENT", \
            x$ = msg("DMPAPER_STATEMENT"), \
            PaperName$ = tbl(x$ <> "DMPAPER_STATEMENT:", x$, "Statement 5-1/2 x 14 inches"), \
            WidthInches = 5.5, \
            LengthInches = 14, \
            Widthmm = 139.7, \
            Lengthmm = 355.6
            break

        case 7
            WindowsName$ = "DMPAPER_EXECUTIVE", \
            x$ = msg("DMPAPER_EXECUTIVE"), \
            PaperName$ = tbl(x$ <> "DMPAPER_EXECUTIVE:", x$, "Executive 7-1/4 x 10-1/2 inches"), \
            WidthInches = 7.25, \
            LengthInches = 10.5, \
            Widthmm = 190.5, \
            Lengthmm = 266.7
            break

        case 8
            WindowsName$ = "DMPAPER_A3", \
            x$ = msg("DMPAPER_A3"), \
            PaperName$ =tbl(x$ <> "DMPAPER_A3:", x$, "A3 297 x 420 mm"), \
            Widthmm = 297, \
            Lengthmm = 420, \
            WidthInches = 11.693, \
            LengthInches = 16.535
            break

        case 9
            WindowsName$ = "DMPAPER_A4", \
            x$ = msg("DMPAPER_A4"), \
            PaperName$ = tbl(x$ <> "DMPAPER_A4:", x$, "A4 210 x 297 mm"), \
            Widthmm = 210, \
            Lengthmm = 297, \
            WidthInches = 8.268, \
            LengthInches = 11.693
            break

        case 10
            WindowsName$ = "DMPAPER_A4SMALL", \
            x$ = msg("DMPAPER_A4SMALL"), \
            PaperName$ = tbl(x$ <> "DMPAPER_A4SMALL:", x$, "A4 Small 210 x 297 mm"), \
            Widthmm = 210, \
            Lengthmm = 297, \
            WidthInches = 8.268, \
            LengthInches = 11.693
            break

        case 11
            WindowsName$ = "DMPAPER_A5", \
            x$ = msg("DMPAPER_A5"), \
            PaperName$ = tbl(x$ <> "DMPAPER_A5:", x$, "A5 148 x 210 mm"), \
            Widthmm = 148, \
            Lengthmm = 210, \
            WidthInches = 5.827, \
            LengthInches = 8.268
            break

        case 12
            WindowsName$ = "DMPAPER_B4", \
            x$ = msg("DMPAPER_B4"), \
            PaperName$ = tbl(x$ <> "DMPAPER_B4:", x$, "B4 (JIS) 250 x 354 mm"), \
            Widthmm = 250, \
            Lengthmm = 354, \
            WidthInches = 9.843, \
            LengthInches = 13.937
            break

        case 13
            WindowsName$ = "DMPAPER_B5", \
            x$ = msg("DMPAPER_B5"), \
            PaperName$ = tbl(x$ <> "DMPAPER_B5:", x$, "B5 (JIS) 182 x 257 mm"), \
            Widthmm = 182, \
            Lengthmm = 257, \
            WidthInches = 7.165, \
            LengthInches = 10.118
            break

        case 14
            WindowsName$ = "DMPAPER_FOLIO", \
            x$ = msg("DMPAPER_FOLIO"), \
            PaperName$ = tbl(x$ <> "DMPAPER_FOLIO:", x$, "Folio 8-1/2 x 13 inches"), \
            WidthInches = 8.5, \
            LengthInches = 13, \
            Widthmm = 215.9, \
            Lengthmm = 330.2
            break

        case 15
            WindowsName$ = "DMPAPER_QUARTO", \
            x$ = msg("DMPAPER_QUARTO"), \
            PaperName$ = tbl(x$ <> "DMPAPER_QUARTO:", x$, "Quarto 215 x 275 mm"), \
            Widthmm = 215, \
            Lengthmm = 275, \
            WidthInches = 8.465, \
            LengthInches = 10.827
            break

        case 16
            WindowsName$ = "DMPAPER_10X14", \
            x$ = msg("DMPAPER_10X14"), \
            PaperName$ = tbl(x$ <> "DMPAPER_10X14:", x$, "10 x 14 inches"), \
            WidthInches = 10, \
            LengthInches = 14, \
            Widthmm = 254, \
            Lengthmm = 355.6
            break

        case 17
            WindowsName$ = "DMPAPER_11X17", \
            x$ = msg("DMPAPER_11X17"), \
            PaperName$ = tbl(x$ <> "DMPAPER_11X17:", x$, "11 x 17 inches"), \
            WidthInches = 11, \
            LengthInches = 17, \
            Widthmm = 279.4, \
            Lengthmm = 431.8
            break

        case 18
            WindowsName$ = "DMPAPER_NOTE", \
            x$ = msg("DMPAPER_NOTE"), \
            PaperName$ = tbl(x$ <> "DMPAPER_NOTE:", x$, "Note 8-1/2 x 11 inches"), \
            WidthInches = 8.5, \
            LengthInches = 11, \
            Widthmm = 215.9, \
            Lengthmm = 279.4
            break

        case 19
            WindowsName$ = "DMPAPER_ENV_9", \
            x$ = msg("DMPAPER_ENV_9"), \
            PaperName$ = tbl(x$ <> "DMPAPER_ENV_9:", x$, "Envelope #9 3-7/8 x 8-7/8 inches"), \
            WidthInches = 3.875, \
            LengthInches = 8.875, \
            Widthmm = 98.4, \
            Lengthmm = 225.4
            break

        case 20
            WindowsName$ = "DMPAPER_ENV_10", \
            x$ = msg("DMPAPER_ENV_10"), \
            PaperName$ = tbl(x$ <> "DMPAPER_ENV_10:", x$, "Envelope #10 4-1/8 x 9-1/2 inches"), \
            WidthInches = 4.125, \
            LengthInches = 9.5, \
            Widthmm = 104.8, \
            Lengthmm = 241.3
            break

        case 21
            WindowsName$ = "DMPAPER_ENV_11", \
            x$ = msg("DMPAPER_ENV_11"), \
            PaperName$ = tbl(x$ <> "DMPAPER_ENV_11:", x$, "Envelope #11 4-1/2 x 10-3/8 inches"), \
            WidthInches = 4.5, \
            LengthInches = 10.375, \
            Widthmm = 114.3, \
            Lengthmm = 263.5
            break

        case 22
            WindowsName$ = "DMPAPER_ENV_12", \
            x$ = msg("DMPAPER_ENV_12"), \
            PaperName$ = tbl(x$ <> "DMPAPER_ENV_12:", x$, "Envelope #12 4-3/4 x 11 inches"), \
            WidthInches = 4.75, \
            LengthInches = 11, \
            Widthmm = 120.7, \
            Lengthmm = 279.4
            break

        case 23
            WindowsName$ = "DMPAPER_ENV_14", \
            x$ = msg("DMPAPER_ENV_14"), \
            PaperName$ = tbl(x$ <> "DMPAPER_ENV_14:", x$, "Envelope #14 5 x 11-1/2 inches"), \
            WidthInches = 5, \
            LengthInches = 11.5, \
            Widthmm = 127, \
            Lengthmm =292.1
            break

        case 24
            WindowsName$ = "DMPAPER_CSHEET", \
            x$ = msg("DMPAPER_CSHEET"), \
            PaperName$ = tbl(x$ <> "DMPAPER_CSHEET:", x$, "C Size Sheet"), \
            WidthInches = 17, \
            LengthInches = 22, \
            Widthmm = 431.8, \
            Lengthmm = 558.8
            break

        case 25
            WindowsName$ = "DMPAPER_DSHEET", \
            x$ = msg("DMPAPER_DSHEET"), \
            PaperName$ = tbl(x$ <> "DMPAPER_DSHEET:", x$, "D Size Sheet"), \
            WidthInches = 22, \
            LengthInches = 34, \
            Widthmm = 558.8, \
            Lengthmm = 863.6
            break

        case 26
            WindowsName$ = "DMPAPER_ESHEET", \
            x$ = msg("DMPAPER_ESHEET"), \
            PaperName$ = tbl(x$ <> "DMPAPER_ESHEET:", x$, "E Size Sheet"), \
            WidthInches = 34, \
            LengthInches = 44, \
            Widthmm = 863.6, \
            Lengthmm = 1117.6
            break

        case 27
            WindowsName$ = "DMPAPER_ENV_DL", \
            x$ = msg("DMPAPER_ENV_DL"), \
            PaperName$ = tbl(x$ <> "DMPAPER_ENV_DL:", x$, "Envelope DL 110 x 220 mm"), \
            Widthmm = 110, \
            Lengthmm = 220, \
            WidthInches = 4.331, \
            LengthInches = 8.661
            break

        case 28
            WindowsName$ = "DMPAPER_ENV_C5", \
            x$ = msg("DMPAPER_ENV_C5"), \
            PaperName$ = tbl(x$ <> "DMPAPER_ENV_C5:", x$, "Envelope C5 162 x 229 mm"), \
            Widthmm = 162, \
            Lengthmm = 229, \
            WidthInches = 6.378, \
            LengthInches = 9.016
            break

        case 29
            WindowsName$ = "DMPAPER_ENV_C3", \
            x$ = msg("DMPAPER_ENV_C3"), \
            PaperName$ = tbl(x$ <> "DMPAPER_ENV_C3:", x$, "Envelope C3 324 x 458 mm"), \
            Widthmm = 324, \
            Lengthmm = 458, \
            WidthInches = 12.756, \
            LengthInches = 18.032
            break

        case 30
            WindowsName$ = "DMPAPER_ENV_C4", \
            x$ = msg("DMPAPER_ENV_C4"), \
            PaperName$ = tbl(x$ <> "DMPAPER_ENV_C4:", x$, "Envelope C4 229 x 324 mm"), \
            Widthmm = 229, \
            Lengthmm = 324, \
            WidthInches = 9.016, \
            LengthInches = 12.756
            break

        case 31
            WindowsName$ = "DMPAPER_ENV_C6", \
            x$ = msg("DMPAPER_ENV_C6"), \
            PaperName$ = tbl(x$ <> "DMPAPER_ENV_C6:", x$, "Envelope C6 114 x 162 mm"), \
            Widthmm = 114, \
            Lengthmm = 162, \
            WidthInches = 4.488, \
            LengthInches = 6.378
            break

        case 32
            WindowsName$ = "DMPAPER_ENV_C65", \
            x$ = msg("DMPAPER_ENV_C65"), \
            PaperName$ = tbl(x$ <> "DMPAPER_ENV_C65:", x$, "Envelope C65 114 x 229 mm"), \
            Widthmm = 114, \
            Lengthmm = 229, \
            WidthInches = 4.488, \
            LengthInches = 9.016
            break

        case 33
            WindowsName$ = "DMPAPER_ENV_B4", \
            x$ = msg("DMPAPER_ENV_B4"), \
            PaperName$ = tbl(x$ <> "DMPAPER_ENV_B4:", x$, "Envelope B4 250 x 353 mm"), \
            Widthmm = 250, \
            Lengthmm = 353, \
            WidthInches = 9.843, \
            LengthInches = 13.898
            break

        case 34
            WindowsName$ = "DMPAPER_ENV_B5", \
            x$ = msg("DMPAPER_ENV_B5"), \
            PaperName$ = tbl(x$ <> "DMPAPER_ENV_B5:", x$, "Envelope B5 176 x 250 mm"), \
            Widthmm = 176, \
            Lengthmm = 250, \
            WidthInches = 6.929, \
            LengthInches = 9.843
            break

        case 35
            WindowsName$ = "DMPAPER_ENV_B6", \
            x$ = msg("DMPAPER_ENV_B6"), \
            PaperName$ = tbl(x$ <> "DMPAPER_ENV_B6:", x$, "Envelope B6 176 x 125 mm"), \
            Widthmm = 176, \
            Lengthmm = 125, \
            WidthInches = 6.929, \
            LengthInches = 4.921
            break

        case 36
            WindowsName$ = "DMPAPER_ENV_ITALY", \
            x$ = msg("DMPAPER_ENV_ITALY"), \
            PaperName$ = tbl(x$ <> "DMPAPER_ENV_ITALY:", x$, "Envelope 110 x 230 mm"), \
            Widthmm = 110, \
            Lengthmm = 230, \
            WidthInches = 4.331, \
            LengthInches = 9.055
            break

        case 37
            WindowsName$ = "DMPAPER_ENV_MONARCH", \
            x$ = msg("DMPAPER_ENV_MONARCH"), \
            PaperName$ = tbl(x$ <> "DMPAPER_ENV_MONARCH:", x$, "Envelope Monarch 3-7/8 x 7-1/2 inches"), \
            WidthInches = 3.875, \
            LengthInches = 7.5, \
            Widthmm = 98.4, \
            Lengthmm = 190.5
            break

        case 38
            WindowsName$ = "DMPAPER_ENV_PERSONAL", \
            x$ = msg("DMPAPER_ENV_PERSONAL"), \
            PaperName$ = tbl(x$ <> "DMPAPER_ENV_PERSONAL:", x$, "Envelope 3-5/8 x 6-1/2 inches"), \
            WidthInches = 3.675, \
            LengthInches = 6.5, \
            Widthmm = 93.4, \
            Lengthmm = 165.1
            break

        case 39
            WindowsName$ = "DMPAPER_FANFOLD_US", \
            x$ = msg("DMPAPER_FANFOLD_US"), \
            PaperName$ = tbl(x$ <> "DMPAPER_FANFOLD_US:", x$, "US Std Fanfold 14-7/8 x 11 inches"), \
            WidthInches = 14.875, \
            LengthInches = 11, \
            Widthmm = 377.8, \
            Lengthmm = 279.4
            break

        case 40
            WindowsName$ = "DMPAPER_FANFOLD_STD_GERMAN", \
            x$ = msg("DMPAPER_FANFOLD_STD_GERMAN"), \
            PaperName$ = tbl(x$ <> "DMPAPER_FANFOLD_STD_GERMAN:", x$, "German Std Fanfold 8-1/2 x 12 inches"), \
            WidthInches = 8.5, \
            LengthInches = 12, \
            Widthmm = 215.9, \
            Lengthmm = 304.8
            break

        case 41
            WindowsName$ = "DMPAPER_FANFOLD_LGL_GERMAN", \
            x$ = msg("DMPAPER_FANFOLD_LGL_GERMAN"), \
            PaperName$ = tbl(x$ <> "DMPAPER_FANFOLD_LGL_GERMAN:", x$, "German Legal Fanfold 8-1/2 x 13 inches"), \
            WidthInches = 8.5, \
            LengthInches = 13, \
            Widthmm = 215.9, \
            Lengthmm = 330.2
            break

        case 42
            WindowsName$ = "DMPAPER_ISO_B4", \
            x$ = msg("DMPAPER_ISO_B4"), \
            PaperName$ = tbl(x$ <> "DMPAPER_ISO_B4:", x$, "B4 (ISO) 250 x 353 mm"), \
            Widthmm = 250, \
            Lengthmm = 353, \
            WidthInches = 9.843, \
            LengthInches = 13.898
            break

        case 43
            WindowsName$ = "DMPAPER_JAPANESE_POSTCARD", \
            x$ = msg("DMPAPER_JAPANESE_POSTCARD"), \
            PaperName$ = tbl(x$ <> "DMPAPER_JAPANESE_POSTCARD:", x$, "Japanese Postcard 100 x 148 mm"), \
            Widthmm = 100, \
            Lengthmm = 148, \
            WidthInches = 3.937, \
            LengthInches = 5.827
            break

        case 44
            WindowsName$ = "DMPAPER_9X11", \
            x$ = msg("DMPAPER_9X11"), \
            PaperName$ = tbl(x$ <> "DMPAPER_9X11:", x$, "9 x 11 inches"), \
            WidthInches = 9, \
            LengthInches = 11, \
            Widthmm = 228.6, \
            Lengthmm = 279.4
            break

        case 45
            WindowsName$ = "DMPAPER_10X11", \
            x$ = msg("DMPAPER_10X11"), \
            PaperName$ = tbl(x$ <> "DMPAPER_10X11:", x$, "10 x 11 inches"), \
            WidthInches = 10, \
            LengthInches = 11, \
            Widthmm = 254, \
            Lengthmm = 279.4
            break

        case 46
            WindowsName$ = "DMPAPER_15X11", \
            x$ = msg("DMPAPER_15X11"), \
            PaperName$ = tbl(x$ <> "DMPAPER_15X11:", x$, "15 x 11 inches"), \
            WidthInches = 15, \
            LengthInches = 11, \
            Widthmm = 381, \
            Lengthmm = 279.4
            break

        case 47
            WindowsName$ = "DMPAPER_ENV_INVITE", \
            x$ = msg("DMPAPER_ENV_INVITE"), \
            PaperName$ = tbl(x$ <> "DMPAPER_ENV_INVITE:", x$, "Envelope Invitation 220 x 220 mm"), \
            Widthmm = 220, \
            Lengthmm = 220, \
            WidthInches = 8.661, \
            LengthInches = 8.661
            break

        case 48
            WindowsName$ = "DMPAPER_RESERVED_48", \
            x$ = msg("DMPAPER_RESERVED_48"), \
            PaperName$ = "<Error>", \
            WidthInches = 0, \
            LengthInches = 0, \
            Widthmm = 0, \
            Lengthmm = 0
            break

        case 49
            WindowsName$ = "DMPAPER_RESERVED_49", \
            x$ = msg("DMPAPER_RESERVED_49"), \
            PaperName$ = "<Error>", \
            WidthInches = 0, \
            LengthInches = 0, \
            Widthmm = 0, \
            Lengthmm = 0
            break

        case 50
            WindowsName$ = "DMPAPER_LETTER_EXTRA", \
            x$ = msg("DMPAPER_LETTER_EXTRA"), \
            PaperName$ = tbl(x$ <> "DMPAPER_LETTER_EXTRA:", x$, "Letter Extra 9-1/2 x 12 inches"), \
            WidthInches = 9.5, \
            LengthInches = 12, \
            Widthmm = 241.3, \
            Lengthmm = 304.8
            break

        case 51
            WindowsName$ = "DMPAPER_LEGAL_EXTRA", \
            x$ = msg("DMPAPER_LEGAL_EXTRA"), \
            PaperName$ = tbl(x$ <> "DMPAPER_LEGAL_EXTRA:", x$, "Legal Extra 9-1/2 x 15 inches"), \
            WidthInches = 9.5, \
            LengthInches = 15, \
            Widthmm = 241.3, \
            Lengthmm = 381
            break

        case 52
            WindowsName$ = "DMPAPER_TABLOID_EXTRA", \
            x$ = msg("DMPAPER_TABLOID_EXTRA"), \
            PaperName$ = tbl(x$ <> "DMPAPER_TABLOID_EXTRA:", x$, "Tabloid Extra 11-5/8 x 18 inches"), \
            WidthInches = 11.675, \
            LengthInches = 18, \
            Widthmm = 296.6, \
            Lengthmm = 457.2
            break

        case 53
            WindowsName$ = "DMPAPER_A4_EXTRA", \
            x$ = msg("DMPAPER_A4_EXTRA"), \
            PaperName$ = tbl(x$ <> "DMPAPER_A4_EXTRA:", x$, "A4 Extra"), \
            WidthInches = 9.268, \
            LengthInches = 12.693, \
            Widthmm = 235.4, \
            Lengthmm = 322.4
            break

        case 54
            WindowsName$ = "DMPAPER_LETTER_TRANSVERSE", \
            x$ = msg("DMPAPER_LETTER_TRANSVERSE"), \
            PaperName$ = tbl(x$ <> "DMPAPER_LETTER_TRANSVERSE:", x$, "Letter Transverse 8-1/2 x 11 inches"), \
            WidthInches = 8.5, \
            LengthInches = 11, \
            Widthmm = 215.9, \
            Lengthmm = 279.4
            break

        case 55
            WindowsName$ = "DMPAPER_A4_TRANSVERSE", \
            x$ = msg("DMPAPER_A4_TRANSVERSE"), \
            PaperName$ = tbl(x$ <> "DMPAPER_A4_TRANSVERSE:", x$, "A4 Transverse 210 x 297 mm"), \
            Widthmm = 210, \
            Lengthmm = 297, \
            WidthInches = 8.268, \
            LengthInches = 11.693
            break

        case 56
            WindowsName$ = "DMPAPER_LETTER_EXTRA_TRANSVERSE", \
            x$ = msg("DMPAPER_LETTER_EXTRA_TRANSVERSE"), \
            PaperName$ = tbl(x$ <> "DMPAPER_LETTER_EXTRA_TRANSVERSE:", x$, "Letter Extra Transverse 9-1/2 x 12 inches"), \
            WidthInches = 9.5, \
            LengthInches = 12, \
            Widthmm = 241.3, \
            Lengthmm = 304.8
            break

        case 57
            WindowsName$ = "DMPAPER_A_PLUS", \
            x$ = msg("DMPAPER_A_PLUS"), \
            PaperName$ = tbl(x$ <> "DMPAPER_A_PLUS:", x$, "Super A/A4 227 x 356 mm"), \
            Widthmm = 227, \
            Lengthmm = 356, \
            WidthInches = 8.937, \
            LengthInches = 14.016
            break

        case 58
            WindowsName$ = "DMPAPER_B_PLUS", \
            x$ = msg("DMPAPER_B_PLUS"), \
            PaperName$ = tbl(x$ <> "DMPAPER_B_PLUS:", x$, "Super B/A3 305 x 487 mm"), \
            Widthmm = 305, \
            Lengthmm = 487, \
            WidthInches = 12.008, \
            LengthInches = 19.173
            break

        case 59
            WindowsName$ = "DMPAPER_LETTER_PLUS", \
            x$ = msg("DMPAPER_LETTER_PLUS"), \
            PaperName$ = tbl(x$ <> "DMPAPER_LETTER_PLUS:", x$, "Letter Plus 8-1/2 x 12-5/8 inches"), \
            WidthInches = 8.5, \
            LengthInches = 12.675, \
            Widthmm = 215.9, \
            Lengthmm = 322
            break

        case 60
            WindowsName$ = "DMPAPER_A4_PLUS", \
            x$ = msg("DMPAPER_A4_PLUS"), \
            PaperName$ = tbl(x$ <> "DMPAPER_A4_PLUS:", x$, "A4 Plus 210 x 330 mm"), \
            Widthmm = 210, \
            Lengthmm = 330, \
            WidthInches = 8.268, \
            LengthInches = 12.992
            break

        case 61
            WindowsName$ = "DMPAPER_A5_TRANSVERSE", \
            x$ = msg("DMPAPER_A5_TRANSVERSE"), \
            PaperName$ = tbl(x$ <> "DMPAPER_A5_TRANSVERSE:", x$, "A5 Transverse 148 x 210 mm"), \
            Widthmm = 148, \
            Lengthmm = 210, \
            WidthInches = 5.827, \
            LengthInches = 8.268
            break

        case 62
            WindowsName$ = "DMPAPER_B5_TRANSVERSE", \
            x$ = msg("DMPAPER_B5_TRANSVERSE"), \
            PaperName$ = tbl(x$ <> "DMPAPER_B5_TRANSVERSE:", x$, "B5 (JIS) Transverse 182 x 257 mm"), \
            Widthmm = 182, \
            Lengthmm = 257, \
            WidthInches = 7.165, \
            LengthInches = 10.118
            break

        case 63
            WindowsName$ = "DMPAPER_A3_EXTRA", \
            x$ = msg("DMPAPER_A3_EXTRA"), \
            PaperName$ = tbl(x$ <> "DMPAPER_A3_EXTRA:", x$, "A3 Extra 322 x 445 mm"), \
            Widthmm = 322, \
            Lengthmm = 445, \
            WidthInches = 12.677, \
            LengthInches = 17.52
            break

        case 64
            WindowsName$ = "DMPAPER_A5_EXTRA", \
            x$ = msg("DMPAPER_A5_EXTRA"), \
            PaperName$ = tbl(x$ <> "DMPAPER_A5_EXTRA:", x$, "A5 Extra 174 x 235 mm"), \
            Widthmm = 174, \
            Lengthmm = 235, \
            WidthInches = 6.85, \
            LengthInches = 9.252
            break

        case 65
            WindowsName$ = "DMPAPER_B5_EXTRA", \
            x$ = msg("DMPAPER_B5_EXTRA"), \
            PaperName$ = tbl(x$ <> "DMPAPER_B5_EXTRA:", x$, "B5 (ISO) Extra 201 x 276 mm"), \
            Widthmm = 201, \
            Lengthmm = 276, \
            WidthInches = 7.913, \
            LengthInches = 10.866
            break

        case 66
            WindowsName$ = "DMPAPER_A2", \
            x$ = msg("DMPAPER_A2"), \
            PaperName$ = tbl(x$ <> "DMPAPER_A2:", x$, "A2 420 x 594 mm"), \
            Widthmm = 420, \
            Lengthmm = 594, \
            WidthInches = 16.535, \
            LengthInches = 23.386
            break

        case 67
            WindowsName$ = "DMPAPER_A3_TRANSVERSE", \
            x$ = msg("DMPAPER_A3_TRANSVERSE"), \
            PaperName$ = tbl(x$ <> "DMPAPER_A3_TRANSVERSE:", x$, "A3 Transverse 297 x 420 mm"), \
            Widthmm = 297, \
            Lengthmm = 420, \
            WidthInches = 11.693, \
            LengthInches = 16.535
            break

        case 68
            WindowsName$ = "DMPAPER_A3_EXTRA_TRANSVERSE", \
            x$ = msg("DMPAPER_A3_EXTRA_TRANSVERSE"), \
            PaperName$ = tbl(x$ <> "DMPAPER_A3_EXTRA_TRANSVERSE:", x$, "A3 Extra Transverse 322 x 445 mm"), \
            Widthmm = 322, \
            Lengthmm = 445, \
            WidthInches = 12.677, \
            LengthInches = 17.52
            break

        case 69
            WindowsName$ = "DMPAPER_DBL_JAPANESE_POSTCARD", \
            x$ = msg("DMPAPER_DBL_JAPANESE_POSTCARD"), \
            PaperName$ = tbl(x$ <> "DMPAPER_DBL_JAPANESE_POSTCARD:", x$, "Japanese Double Postcard 200 x 148 mm"), \
            Widthmm = 200, \
            Lengthmm = 148, \
            WidthInches = 7.874, \
            LengthInches = 5.827
            break

        case 70
            WindowsName$ = "DMPAPER_A6", \
            x$ = msg("DMPAPER_A6"), \
            PaperName$ = tbl(x$ <> "DMPAPER_A6:", x$, "A6 105 x 148 mm"), \
            Widthmm = 105, \
            Lengthmm = 148, \
            WidthInches = 4.134, \
            LengthInches = 5.827
            break

        case 71
            WindowsName$ = "DMPAPER_JENV_KAKU2", \
            x$ = msg("DMPAPER_JENV_KAKU2"), \
            PaperName$ = tbl(x$ <> "DMPAPER_JENV_KAKU2:", x$, "Japanese Envelope Kaku #2 240 x 332 mm"), \
            Widthmm = 240, \
            Lengthmm = 332, \
            WidthInches = 9.449, \
            LengthInches = 13.071
            break

        case 72
            WindowsName$ = "DMPAPER_JENV_KAKU3", \
            x$ = msg("DMPAPER_JENV_KAKU3"), \
            PaperName$ = tbl(x$ <> "DMPAPER_JENV_KAKU3:", x$, "Japanese Envelope Kaku #3 216 x 227 mm"), \
            Widthmm = 216, \
            Lengthmm = 227, \
            WidthInches = 8.504, \
            LengthInches = 8.937
            break

        case 73
            WindowsName$ = "DMPAPER_JENV_CHOU3", \
            x$ = msg("DMPAPER_JENV_CHOU3"), \
            PaperName$ = tbl(x$ <> "DMPAPER_JENV_CHOU3:", x$, "Japanese Envelope Chou #3 120 x 235 mm"), \
            Widthmm = 120, \
            Lengthmm = 235, \
            WidthInches = 4.724, \
            LengthInches = 9.252
            break

        case 74
            WindowsName$ = "DMPAPER_JENV_CHOU4", \
            x$ = msg("DMPAPER_JENV_CHOU4"), \
            PaperName$ = tbl(x$ <> "DMPAPER_JENV_CHOU4:", x$, "Japanese Envelope Chou #4 90 x 205 mm"), \
            Widthmm = 90, \
            Lengthmm = 205, \
            WidthInches = 3.543, \
            LengthInches = 8.071
            break

        case 75
            WindowsName$ = "DMPAPER_LETTER_ROTATED", \
            x$ = msg("DMPAPER_LETTER_ROTATED"), \
            PaperName$ = tbl(x$ <> "DMPAPER_LETTER_ROTATED:", x$, "Letter Rotated 11 x 8-1/2 inches"), \
            WidthInches = 11, \
            LengthInches = 8.5, \
            Widthmm = 279.4, \
            Lengthmm = 215.9
            break

        case 76
            WindowsName$ = "DMPAPER_A3_ROTATED", \
            x$ = msg("DMPAPER_A3_ROTATED"), \
            PaperName$ = tbl(x$ <> "DMPAPER_A3_ROTATED:", x$, "A3 Rotated 420 x 297 mm"), \
            Widthmm = 420, \
            Lengthmm = 297, \
            WidthInches = 16.535, \
            LengthInches = 11.693
            break

        case 77
            WindowsName$ = "DMPAPER_A4_ROTATED", \
            x$ = msg("DMPAPER_A4_ROTATED"), \
            PaperName$ = tbl(x$ <> "DMPAPER_A4_ROTATED:", x$, "A4 Rotated 297 x 210 mm"), \
            Widthmm = 297, \
            Lengthmm = 210, \
            WidthInches = 11.693, \
            LengthInches = 8.268
            break

        case 78
            WindowsName$ = "DMPAPER_A5_ROTATED", \
            x$ = msg("DMPAPER_A5_ROTATED"), \
            PaperName$ = tbl(x$ <> "DMPAPER_A5_ROTATED:", x$, "A5 Rotated 210 x 148 mm"), \
            Widthmm = 210, \
            Lengthmm = 148, \
            WidthInches = 8.268, \
            LengthInches = 5.827
            break

        case 79
            WindowsName$ = "DMPAPER_B4_JIS_ROTATED", \
            x$ = msg("DMPAPER_B4_JIS_ROTATED"), \
            PaperName$ = tbl(x$ <> "DMPAPER_B4_JIS_ROTATED:", x$, "B4 (JIS) Rotated 364 x 257 mm"), \
            Widthmm = 364, \
            Lengthmm = 257, \
            WidthInches = 14.331, \
            LengthInches = 10.118
            break

        case 80
            WindowsName$ = "DMPAPER_B5_JIS_ROTATED", \
            x$ = msg("DMPAPER_B5_JIS_ROTATED"), \
            PaperName$ = tbl(x$ <> "DMPAPER_B5_JIS_ROTATED:", x$, "B5 (JIS) Rotated 257 x 182 mm"), \
            Widthmm = 257, \
            Lengthmm = 182, \
            WidthInches = 10.827, \
            LengthInches = 7.165
            break

        case 81
            WindowsName$ = "DMPAPER_JAPANESE_POSTCARD_ROTATED", \
            x$ = msg("DMPAPER_JAPANESE_POSTCARD_ROTATED"), \
            PaperName$ = tbl(x$ <> "DMPAPER_JAPANESE_POSTCARD_ROTATED:", x$, "Japanese Postcard Rotated 148 x 100 mm"), \
            Widthmm = 148, \
            Lengthmm = 100, \
            WidthInches = 5.827, \
            LengthInches = 3.937
            break

        case 82
            WindowsName$ = "DMPAPER_DBL_JAPANESE_POSTCARD_ROTATED", \
            x$ = msg("DMPAPER_DBL_JAPANESE_POSTCARD_ROTATED"), \
            PaperName$ = tbl(x$ <> "DMPAPER_DBL_JAPANESE_POSTCARD_ROTATED:", x$, "Double Japanese Postcard Rotated 148 x 200 mm"), \
            Widthmm = 148, \
            Lengthmm = 200, \
            WidthInches = 5.827, \
            LengthInches = 7.874
            break

        case 83
            WindowsName$ = "DMPAPER_A6_ROTATED", \
            x$ = msg("DMPAPER_A6_ROTATED"), \
            PaperName$ = tbl(x$ <> "DMPAPER_A6_ROTATED:", x$, "A6 Rotated 148 x 105 mm"), \
            Widthmm = 148, \
            Lengthmm = 105, \
            WidthInches = 5.827, \
            LengthInches = 4.134
            break

        case 84
            WindowsName$ = "DMPAPER_JENV_KAKU2_ROTATED", \
            x$ = msg("DMPAPER_JENV_KAKU2_ROTATED"), \
            PaperName$ = tbl(x$ <> "DMPAPER_JENV_KAKU2_ROTATED:", x$, "Japanese Envelope Kaku #2 Rotated 332 x 240 mm"), \
            Widthmm = 332, \
            Lengthmm = 240, \
            WidthInches = 13.071, \
            LengthInches = 9.449
            break

        case 85
            WindowsName$ = "DMPAPER_JENV_KAKU3_ROTATED", \
            x$ = msg("DMPAPER_JENV_KAKU3_ROTATED"), \
            PaperName$ = tbl(x$ <> "DMPAPER_JENV_KAKU3_ROTATED:", x$, "Japanese Envelope Kaku #3 Rotated 227 x 216 mm"), \
            Widthmm = 227, \
            Lengthmm = 216, \
            WidthInches = 8.937, \
            LengthInches = 8.504
            break

        case 86
            WindowsName$ = "DMPAPER_JENV_CHOU3_ROTATED", \
            x$ = msg("DMPAPER_JENV_CHOU3_ROTATED"), \
            PaperName$ = tbl(x$ <> "DMPAPER_JENV_CHOU3_ROTATED:", x$, "Japanese Envelope Chou #3 Rotated 235 x 120 mm"), \
            Widthmm = 235, \
            Lengthmm = 120, \
            WidthInches = 9.252, \
            LengthInches = 4.724
            break

        case 87
            WindowsName$ = "DMPAPER_JENV_CHOU4_ROTATED", \
            x$ = msg("DMPAPER_JENV_CHOU4_ROTATED"), \
            PaperName$ = tbl(x$ <> "DMPAPER_JENV_CHOU4_ROTATED:", x$, "Japanese Envelope Chou #4 Rotated 205 x 90"), \
            Widthmm = 205, \
            Lengthmm = 90, \
            WidthInches = 8.071, \
            LengthInches = 3.543
            break

        case 88
            WindowsName$ = "DMPAPER_B6_JIS", \
            x$ = msg("DMPAPER_B6_JIS"), \
            PaperName$ = tbl(x$ <> "DMPAPER_B6_JIS:", x$, "B6 (JIS) 128 x 182 mm"), \
            Widthmm = 128, \
            Lengthmm = 182, \
            WidthInches = 5.039, \
            LengthInches = 7.165
            break

        case 89
            WindowsName$ = "DMPAPER_B6_JIS_ROTATED", \
            x$ = msg("DMPAPER_B6_JIS_ROTATED"), \
            PaperName$ = tbl(x$ <> "DMPAPER_B6_JIS_ROTATED:", x$, "B6 (JIS) Rotated 182 x 128 mm"), \
            Widthmm = 182, \
            Lengthmm = 128, \
            WidthInches = 7.165, \
            LengthInches = 5.039
            break

        case 90
            WindowsName$ = "DMPAPER_12X11", \
            x$ = msg("DMPAPER_12X11"), \
            PaperName$ = tbl(x$ <> "DMPAPER_12X11:", x$, "12 x 11 inches"), \
            WidthInches = 12, \
            LengthInches = 11, \
            Widthmm = 304.8, \
            Lengthmm = 279.4
            break

        case 91
            WindowsName$ = "DMPAPER_JENV_YOU4", \
            x$ = msg("DMPAPER_JENV_YOU4"), \
            PaperName$ = tbl(x$ <> "DMPAPER_JENV_YOU4:", x$, "Japanese Envelope You #4 235 x 105 mm"), \
            Widthmm = 235, \
            Lengthmm = 105, \
            WidthInches = 9.252, \
            LengthInches = 4.134
            break

        case 92
            WindowsName$ = "DMPAPER_JENV_YOU4_ROTATED", \
            x$ = msg("DMPAPER_JENV_YOU4_ROTATED"), \
            PaperName$ = tbl(x$ <> "DMPAPER_JENV_YOU4_ROTATED:", x$, "Japanese Envelope You #4 Rotated 105 x 235 mm"), \
            Widthmm = 105, \
            Lengthmm = 235, \
            WidthInches = 4.134, \
            LengthInches = 9.252
            break

        case 93
            WindowsName$ = "DMPAPER_P16K", \
            x$ = msg("DMPAPER_P16K"), \
            PaperName$ = tbl(x$ <> "DMPAPER_P16K:", x$, "PRC 16K 146 x 215 mm"), \
            Widthmm = 146, \
            Lengthmm = 215, \
            WidthInches = 5.748, \
            LengthInches = 8.465
            break

        case 94
            WindowsName$ = "DMPAPER_P32K", \
            x$ = msg("DMPAPER_P32K"), \
            PaperName$ = tbl(x$ <> "DMPAPER_P32K:", x$, "PRC 32K 97 x 151 mm"), \
            Widthmm = 97, \
            Lengthmm = 151, \
            WidthInches = 3.819, \
            LengthInches = 5.945
            break

        case 95
            WindowsName$ = "DMPAPER_P32KBIG", \
            x$ = msg("DMPAPER_P32KBIG"), \
            PaperName$ = tbl(x$ <> "DMPAPER_P32KBIG:", x$, "PRC 32K(Big) 97 x 151 mm"), \
            Widthmm = 97, \
            Lengthmm = 151, \
            WidthInches = 3.819, \
            LengthInches = 5.945
            break

        case 96
            WindowsName$ = "DMPAPER_PENV_1", \
            x$ = msg("DMPAPER_PENV_1"), \
            PaperName$ = tbl(x$ <> "DMPAPER_PENV_1:", x$, "PRC Envelope #1 102 x 165 mm"), \
            Widthmm = 102, \
            Lengthmm = 165, \
            WidthInches = 4.016, \
            LengthInches = 6.496
            break

        case 97
            WindowsName$ = "DMPAPER_PENV_2", \
            x$ = msg("DMPAPER_PENV_2"), \
            PaperName$ = tbl(x$ <> "DMPAPER_PENV_2:", x$, "PRC Envelope #2 102 x 176 mm"), \
            Widthmm = 102, \
            Lengthmm = 176, \
            WidthInches = 4.016, \
            LengthInches = 6.929
            break

        case 98
            WindowsName$ = "DMPAPER_PENV_3", \
            x$ = msg("DMPAPER_PENV_3"), \
            PaperName$ = tbl(x$ <> "DMPAPER_PENV_3:", x$, "PRC Envelope #3 125 x 176 mm"), \
            Widthmm = 125, \
            Lengthmm = 176, \
            WidthInches = 4.921, \
            LengthInches = 6.929
            break

        case 99
            WindowsName$ = "DMPAPER_PENV_4", \
            x$ = msg("DMPAPER_PENV_4"), \
            PaperName$ = tbl(x$ <> "DMPAPER_PENV_4:", x$, "PRC Envelope #4 110 x 208 mm"), \
            Widthmm = 110, \
            Lengthmm = 208, \
            WidthInches = 4.331, \
            LengthInches = 8.189
            break

        case 100
            WindowsName$ = "DMPAPER_PENV_5", \
            x$ = msg("DMPAPER_PENV_5"), \
            PaperName$ = tbl(x$ <> "DMPAPER_PENV_5:", x$, "PRC Envelope #5 110 x 220 mm"), \
            Widthmm = 110, \
            Lengthmm = 220, \
            WidthInches = 4.331, \
            LengthInches = 8.661
            break

        case 101
            WindowsName$ = "DMPAPER_PENV_6", \
            x$ = msg("DMPAPER_PENV_6"), \
            PaperName$ = tbl(x$ <> "DMPAPER_PENV_6:", x$, "PRC Envelope #6 120 x 230 mm"), \
            Widthmm = 120, \
            Lengthmm = 230, \
            WidthInches = 4.724, \
            LengthInches = 9.055
            break

        case 102
            WindowsName$ = "DMPAPER_PENV_7", \
            x$ = msg("DMPAPER_PENV_7"), \
            PaperName$ = tbl(x$ <> "DMPAPER_PENV_7:", x$, "PRC Envelope #7 160 x 230 mm"), \
            Widthmm = 160, \
            Lengthmm = 230, \
            WidthInches = 6.299, \
            LengthInches = 9.055
            break

        case 103
            WindowsName$ = "DMPAPER_PENV_8", \
            x$ = msg("DMPAPER_PENV_8"), \
            PaperName$ = tbl(x$ <> "DMPAPER_PENV_8:", x$, "PRC Envelope #8 120 x 309 mm"), \
            Widthmm = 120, \
            Lengthmm = 309, \
            WidthInches = 4.724, \
            LengthInches = 12.165
            break

        case 104
            WindowsName$ = "DMPAPER_PENV_9", \
            x$ = msg("DMPAPER_PENV_9"), \
            PaperName$ = tbl(x$ <> "DMPAPER_PENV_9:", x$, "PRC Envelope #9 229 x 324 mm"), \
            Widthmm = 229, \
            Lengthmm = 324, \
            WidthInches = 9.016, \
            LengthInches = 12.756
            break

        case 105
            WindowsName$ = "DMPAPER_PENV_10", \
            x$ = msg("DMPAPER_PENV_10"), \
            PaperName$ = tbl(x$ <> "DMPAPER_PENV_10:", x$, "PRC Envelope #10 324 x 458 mm"), \
            Widthmm = 324, \
            Lengthmm = 458, \
            WidthInches = 12.756, \
            LengthInches = 18.032
            break

        case 106
            WindowsName$ = "DMPAPER_P16K_ROTATED", \
            x$ = msg("DMPAPER_P16K_ROTATED"), \
            PaperName$ = tbl(x$ <> "DMPAPER_P16K_ROTATED:", x$, "PRC 16K Rotated 215 x 146 mm"), \
            Widthmm = 215, \
            Lengthmm = 146, \
            WidthInches = 8.465, \
            LengthInches = 5.748
            break

        case 107
            WindowsName$ = "DMPAPER_P32K_ROTATED", \
            x$ = msg("DMPAPER_P32K_ROTATED"), \
            PaperName$ = tbl(x$ <> "DMPAPER_P32K_ROTATED:", x$, "PRC 32K Rotated 151 x 97 mm"), \
            Widthmm = 151, \
            Lengthmm = 97, \
            WidthInches = 5.945, \
            LengthInches = 3.819
            break

        case 108
            WindowsName$ = "DMPAPER_P32KBIG_ROTATED", \
            x$ = msg("DMPAPER_P32KBIG_ROTATED"), \
            PaperName$ = tbl(x$ <> "DMPAPER_P32KBIG_ROTATED:", x$, "PRC 32K(Big) Rotated 151 x 97 mm"), \
            Widthmm = 151, \
            Lengthmm = 97, \
            WidthInches = 5.945, \
            LengthInches = 3.819
            break

        case 109
            WindowsName$ = "DMPAPER_PENV_1_ROTATED", \
            x$ = msg("DMPAPER_PENV_1_ROTATED"), \
            PaperName$ = tbl(x$ <> "DMPAPER_PENV_1_ROTATED:", x$, "PRC Envelope #1 Rotated 165 x 102 mm"), \
            Widthmm = 165, \
            Lengthmm = 102, \
            WidthInches = 6.496, \
            LengthInches = 4.016
            break

        case 110
            WindowsName$ = "DMPAPER_PENV_2_ROTATED", \
            x$ = msg("DMPAPER_PENV_2_ROTATED"), \
            PaperName$ = tbl(x$ <> "DMPAPER_PENV_2_ROTATED:", x$, "PRC Envelope #2 Rotated 176 x 102 mm"), \
            Widthmm = 176, \
            Lengthmm = 102, \
            WidthInches = 6.929, \
            LengthInches = 4.016
            break

        case 111
            WindowsName$ = "DMPAPER_PENV_3_ROTATED", \
            x$ = msg("DMPAPER_PENV_3_ROTATED"), \
            PaperName$ = tbl(x$ <> "DMPAPER_PENV_3_ROTATED:", x$, "PRC Envelope #3 Rotated 176 x 125 mm"), \
            Widthmm = 176, \
            Lengthmm = 125, \
            WidthInches = 6.929, \
            LengthInches = 4.921
            break

        case 112
            WindowsName$ = "DMPAPER_PENV_4_ROTATED", \
            x$ = msg("DMPAPER_PENV_4_ROTATED"), \
            PaperName$ = tbl(x$ <> "DMPAPER_PENV_4_ROTATED:", x$, "PRC Envelope #4 Rotated 208 x 110 mm"), \
            Widthmm = 208, \
            Lengthmm = 110, \
            WidthInches = 8.189, \
            LengthInches = 4.331
            break

        case 113
            WindowsName$ = "DMPAPER_PENV_5_ROTATED", \
            x$ = msg("DMPAPER_PENV_5_ROTATED"), \
            PaperName$ = tbl(x$ <> "DMPAPER_PENV_5_ROTATED:", x$, "PRC Envelope #5 Rotated 220 x 110 mm"), \
            Widthmm = 220, \
            Lengthmm = 110, \
            WidthInches = 8.661, \
            LengthInches = 4.331
            break

        case 114
            WindowsName$ = "DMPAPER_PENV_6_ROTATED", \
            x$ = msg("DMPAPER_PENV_6_ROTATED"), \
            PaperName$ = tbl(x$ <> "DMPAPER_PENV_6_ROTATED:", x$, "PRC Envelope #6 Rotated 230 x 120 mm"), \
            Widthmm = 230, \
            Lengthmm = 120, \
            WidthInches = 9.055, \
            LengthInches = 4.724
            break

        case 115
            WindowsName$ = "DMPAPER_PENV_7_ROTATED", \
            x$ = msg("DMPAPER_PENV_7_ROTATED"), \
            PaperName$ = tbl(x$ <> "DMPAPER_PENV_7_ROTATED:", x$, "PRC Envelope #7 Rotated 230 x 160 mm"), \
            Widthmm = 230, \
            Lengthmm = 160, \
            WidthInches = 9.055, \
            LengthInches = 6.299
            break

        case 116
            WindowsName$ = "DMPAPER_PENV_8_ROTATED", \
            x$ = msg("DMPAPER_PENV_8_ROTATED"), \
            PaperName$ = tbl(x$ <> "DMPAPER_PENV_8_ROTATED:", x$, "PRC Envelope #8 Rotated 309 x 120 mm"), \
            Widthmm = 309, \
            Lengthmm = 120, \
            WidthInches = 12.165, \
            LengthInches = 4.724
            break

        case 117
            WindowsName$ = "DMPAPER_PENV_9_ROTATED", \
            x$ = msg("DMPAPER_PENV_9_ROTATED"), \
            PaperName$ = tbl(x$ <> "DMPAPER_PENV_9_ROTATED:", x$, "PRC Envelope #9 Rotated 324 x 229 mm"), \
            Widthmm = 324, \
            Lengthmm = 229, \
            WidthInches = 12.756, \
            LengthInches = 9.016
            break

        case 118
            WindowsName$ = "DMPAPER_PENV_10_ROTATED", \
            x$ = msg("DMPAPER_PENV_10_ROTATED"), \
            PaperName$ = tbl(x$ <> "DMPAPER_PENV_10_ROTATED:", x$, "PRC Envelope #10 Rotated 458 x 324 mm"), \
            Widthmm = 458, \
            Lengthmm = 324, \
            WidthInches = 18.032, \
            LengthInches = 17.756
            break

        case 256
            WindowsName$ = "DMPAPER_USER", \
            x$ = msg("DMPAPER_USER"), \
            PaperName$ = tbl(x$ <> "DMPAPER_USER:", x$, "Custom Size"), \
            WidthInches = 0, \
            LengthInches = 0, \
            Widthmm = 0, \
            Lengthmm = 0
            break

        default
            WindowsName$ = "DMPAPER_UNDEFINED_"+str(Value%), \
            PaperName$ = "<Error>", \
            WidthInches = 0, \
            LengthInches = 0, \
            Widthmm = 0, \
            Lengthmm = 0
            break
    esac

    if PaperName$ = "<Error>" \
        then PaperName$ = ""; return 0 \
        else return 1
!
!
GetPaperNames:
    enter PaperName$

    last = _obj'DMPAPER_LAST, \
    PaperName$ = ""

    for x = 1 to last;
        r = _obj'GetPaperSize(x, n$);
        if r and n$ > "" \
            then PaperName$ += n$ + sep \
        fi;
    next x

    if len(PaperName$) \
        then return 1 \
        else return 0
