Article View: borland.public.cppbuilder.nativeapi
Article #11441Re: From DEVMODE to paper size
From: Alan Bellingham
Date: Wed, 11 Feb 2004 17:09
Date: Wed, 11 Feb 2004 17:09
176 lines
9468 bytes
9468 bytes
Martin Golm <golm@gmx.de> wrote: >How can I calculate the paper size from a DEVMODE struct that >PageSetupDlg() returns? >The problem is, DEVMODE.dmPaperSize is set to 1 (or 9) and >DEVMODE.dmFormName is set to "Letter" (or "A4"), but neither >DEVMODE.dmPaperLength and DEVMODE.dmPaperWidth are set. And I don't know >from where to get these values. Keep a table. MSDN tells you the relevant dimensions - so if you get something like DMPAPER_DBL_JAPANESE_POSTCARD_ROTATED, then look up in your table and get the size 148- by 200-millimeters. The following is from the 2003 MSDN, in case you can't find it elsewhere: ------------------->8-------------------------------------------------- dmPaperSize For printer devices only, selects the size of the paper to print on. This member can be set to zero if the length and width of the paper are both set by the dmPaperLength and dmPaperWidth members. Otherwise, the dmPaperSize member can be set to one of the following predefined values. Value Meaning DMPAPER_LETTER Letter, 8 1/2- by 11-inches DMPAPER_LEGAL Legal, 8 1/2- by 14-inches DMPAPER_10X14 10- by 14-inch sheet DMPAPER_11X17 11- by 17-inch sheet DMPAPER_12X11 Windows 98/Me, Windows NT 4.0 and later: 12- by 11-inch sheet DMPAPER_A3 A3 sheet, 297- by 420-millimeters DMPAPER_A3_ROTATED Windows 98/Me, Windows NT 4.0 and later: A3 rotated sheet, 420- by 297-millimeters DMPAPER_A4 A4 sheet, 210- by 297-millimeters DMPAPER_A4_ROTATED Windows 98/Me, Windows NT 4.0 and later: A4 rotated sheet, 297- by 210-millimeters DMPAPER_A4SMALL A4 small sheet, 210- by 297-millimeters DMPAPER_A5 A5 sheet, 148- by 210-millimeters DMPAPER_A5_ROTATED Windows 98/Me, Windows NT 4.0 and later: A5 rotated sheet, 210- by 148-millimeters DMPAPER_A6 Windows 98/Me, Windows NT 4.0 and later: A6 sheet, 105- by 148-millimeters DMPAPER_A6_ROTATED Windows 98/Me, Windows NT 4.0 and later: A6 rotated sheet, 148- by 105-millimeters DMPAPER_B4 B4 sheet, 250- by 354-millimeters DMPAPER_B4_JIS_ROTATED Windows 98/Me, Windows NT 4.0 and later: B4 (JIS) rotated sheet, 364- by 257-millimeters DMPAPER_B5 B5 sheet, 182- by 257-millimeter paper DMPAPER_B5_JIS_ROTATED Windows 98/Me, Windows NT 4.0 and later: B5 (JIS) rotated sheet, 257- by 182-millimeters DMPAPER_B6_JIS Windows 98/Me, Windows NT 4.0 and later: B6 (JIS) sheet, 128- by 182-millimeters DMPAPER_B6_JIS_ROTATED Windows 98/Me, Windows NT 4.0 and later: B6 (JIS) rotated sheet, 182- by 128-millimeters DMPAPER_CSHEET C Sheet, 17- by 22-inches DMPAPER_DBL_JAPANESE_POSTCARD Windows 98/Me, Windows NT 4.0 and later: Double Japanese Postcard, 200- by 148-millimeters DMPAPER_DBL_JAPANESE_POSTCARD_ROTATED Windows 98/Me, Windows NT 4.0 and later: Double Japanese Postcard Rotated, 148- by 200-millimeters DMPAPER_DSHEET D Sheet, 22- by 34-inches DMPAPER_ENV_9 #9 Envelope, 3 7/8- by 8 7/8-inches DMPAPER_ENV_10 #10 Envelope, 4 1/8- by 9 1/2-inches DMPAPER_ENV_11 #11 Envelope, 4 1/2- by 10 3/8-inches DMPAPER_ENV_12 #12 Envelope, 4 3/4- by 11-inches DMPAPER_ENV_14 #14 Envelope, 5- by 11 1/2-inches DMPAPER_ENV_C5 C5 Envelope, 162- by 229-millimeters DMPAPER_ENV_C3 C3 Envelope, 324- by 458-millimeters DMPAPER_ENV_C4 C4 Envelope, 229- by 324-millimeters DMPAPER_ENV_C6 C6 Envelope, 114- by 162-millimeters DMPAPER_ENV_C65 C65 Envelope, 114- by 229-millimeters DMPAPER_ENV_B4 B4 Envelope, 250- by 353-millimeters DMPAPER_ENV_B5 B5 Envelope, 176- by 250-millimeters DMPAPER_ENV_B6 B6 Envelope, 176- by 125-millimeters DMPAPER_ENV_DL DL Envelope, 110- by 220-millimeters DMPAPER_ENV_ITALY Italy Envelope, 110- by 230-millimeters DMPAPER_ENV_MONARCH Monarch Envelope, 3 7/8- by 7 1/2-inches DMPAPER_ENV_PERSONAL 6 3/4 Envelope, 3 5/8- by 6 1/2-inches DMPAPER_ESHEET E Sheet, 34- by 44-inches DMPAPER_EXECUTIVE Executive, 7 1/4- by 10 1/2-inches DMPAPER_FANFOLD_US US Std Fanfold, 14 7/8- by 11-inches DMPAPER_FANFOLD_STD_GERMAN German Std Fanfold, 8 1/2- by 12-inches DMPAPER_FANFOLD_LGL_GERMAN German Legal Fanfold, 8 �- by 13-inches DMPAPER_FOLIO Folio, 8 1/2- by 13-inch paper DMPAPER_JAPANESE_POSTCARD_ROTATED Windows 98/Me, Windows NT 4.0 and later: Japanese Postcard Rotated, 148- by 100-millimeters DMPAPER_JENV_CHOU3 Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Chou #3 DMPAPER_JENV_CHOU3_ROTATED Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Chou #3 Rotated DMPAPER_JENV_CHOU4 Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Chou #4 DMPAPER_JENV_CHOU4_ROTATED Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Chou #4 Rotated DMPAPER_JENV_KAKU2 Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Kaku #2 DMPAPER_JENV_KAKU2_ROTATED Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Kaku #2 Rotated DMPAPER_JENV_KAKU3 Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Kaku #3 DMPAPER_JENV_KAKU3_ROTATED Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Kaku #3 Rotated DMPAPER_JENV_YOU4 Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope You #4 DMPAPER_JENV_YOU4_ROTATED Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope You #4 Rotated DMPAPER_LAST Windows 2000/XP: DMPAPER_PENV_10_ROTATED DMPAPER_LEDGER Ledger, 17- by 11-inches DMPAPER_LETTER_ROTATED Letter Rotated 11 by 8 1/2 11 inches DMPAPER_LETTERSMALL Letter Small, 8 1/2- by 11-inches DMPAPER_NOTE Note, 8 1/2- by 11-inches DMPAPER_P16K Windows 98/Me, Windows NT 4.0 and later: PRC 16K, 146- by 215-millimeters DMPAPER_P16K_ROTATED Windows 98/Me, Windows NT 4.0 and later: PRC 16K Rotated, 215- by 146-millimeters DMPAPER_P32K Windows 98/Me, Windows NT 4.0 and later: PRC 32K, 97- by 151-millimeters DMPAPER_P32K_ROTATED Windows 98/Me, Windows NT 4.0 and later: PRC 32K Rotated, 151- by 97-millimeters DMPAPER_P32KBIG Windows 98/Me, Windows NT 4.0 and later: PRC 32K(Big) 97- by 151-millimeters DMPAPER_P32KBIG_ROTATED Windows 98/Me, Windows NT 4.0 and later: PRC 32K(Big) Rotated, 151- by 97-millimeters DMPAPER_PENV_1 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #1, 102- by 165-millimeters DMPAPER_PENV_1_ROTATED Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #1 Rotated, 165- by 102-millimeters DMPAPER_PENV_2 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #2, 102- by 176-millimeters DMPAPER_PENV_2_ROTATED Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #2 Rotated, 176- by 102-millimeters DMPAPER_PENV_3 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #3, 125- by 176-millimeters DMPAPER_PENV_3_ROTATED Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #3 Rotated, 176- by 125-millimeters DMPAPER_PENV_4 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #4, 110- by 208-millimeters DMPAPER_PENV_4_ROTATED Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #4 Rotated, 208- by 110-millimeters DMPAPER_PENV_5 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #5, 110- by 220-millimeters DMPAPER_PENV_5_ROTATED Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #5 Rotated, 220- by 110-millimeters DMPAPER_PENV_6 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #6, 120- by 230-millimeters DMPAPER_PENV_6_ROTATED Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #6 Rotated, 230- by 120-millimeters DMPAPER_PENV_7 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #7, 160- by 230-millimeters DMPAPER_PENV_7_ROTATED Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #7 Rotated, 230- by 160-millimeters DMPAPER_PENV_8 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #8, 120- by 309-millimeters DMPAPER_PENV_8_ROTATED Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #8 Rotated, 309- by 120-millimeters DMPAPER_PENV_9 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #9, 229- by 324-millimeters DMPAPER_PENV_9_ROTATED Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #9 Rotated, 324- by 229-millimeters DMPAPER_PENV_10 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #10, 324- by 458-millimeters DMPAPER_PENV_10_ROTATED Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #10 Rotated, 458- by 324-millimeters DMPAPER_QUARTO Quarto, 215- by 275-millimeter paper DMPAPER_STATEMENT Statement, 5 1/2- by 8 1/2-inches DMPAPER_TABLOID Tabloid, 11- by 17-inches ------------------->8-------------------------------------------------- Alan Bellingham -- ACCU Conference 2004 - http://https://www.accu.org/conference/
Technical Details
Message-ID:
<d0ok201ac0058vu6cbb6egjbbkrcgfim4c@4ax.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<402A55FD.FC92BCD0@gmx.de>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10cc67,88ac6a209519f1c8 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-02-11 09:10:44 PST From: Alan Bellingham <alanb@episys.com> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: From DEVMODE to paper size Date: Wed, 11 Feb 2004 17:09:05 +0000 Reply-To: alanb@episys.com Message-ID: <d0ok201ac0058vu6cbb6egjbbkrcgfim4c@4ax.com> References: <402A55FD.FC92BCD0@gmx.de> X-Newsreader: Forte Agent 2.0/32.640 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit NNTP-Posting-Host: 193.129.251.130 X-Trace: newsgroups.borland.com 1076519345 193.129.251.130 (11 Feb 2004 09:09:05 -0800) Lines: 176 Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail