From: Carlos Rocha on 3 Jul 2010 20:08 Hi, I need to transform PrintingDevice:PaperWidth to twips. I'm getting 2100 (for A4) so in my case it is mesured in 10ths of mm. Does it return always a metric value, or is dependent on some OS definition? if so, how can I know if PaperWidth is mesured using Imperial or Metric system? Thanks for any hint -- Carlos Rocha
From: Ronny on 6 Jul 2010 08:07 Info from : http://msdn.microsoft.com/en-us/library/ff561927(VS.85).aspx ---------- 1.Use the GetLocaleInfo function (defined in the Microsoft Windows SDK documentation) to retrieve the default system locale. Use LOCALE_SYSTEM_DEFAULT for the first parameter, Locale, and LOCALE_ICOUNTRY for the second parameter, LCType. 2.Use the default system locale obtained from GetLocaleInfo to determine metric or non-metric paper size. â¦Non-metric if default system locale is: â CTRY_UNITED_STATES, or â CTRY_CANADA, or â Greater than or equal to 50, but less than 60 and not CTRY_BRAZIL, or â Greater than or equal to 500, but less than 600 or metric otherwise. --------- Ronny. On 4 jul, 02:08, Carlos Rocha <carlos.deletethis.ro...(a)doossier.com> wrote: >  Hi, > > I need to transform PrintingDevice:PaperWidth to twips. I'm getting 2100 > (for A4) so in my case it is mesured in 10ths of mm. Does it return > always a metric value, or is dependent on some OS definition? if so, how > can I know if PaperWidth is mesured using Imperial or Metric system? > > Thanks for any hint > > -- > Carlos Rocha
From: Carlos Rocha on 6 Jul 2010 09:16 Hi Ronny, This is a surprise as in the meanwhile I've read somewhere that printers always return paper size in tenths of mm. I'll check it further, thanks. > Info from : http://msdn.microsoft.com/en-us/library/ff561927(VS.85).aspx > > ---------- > 1.Use the GetLocaleInfo function (defined in the Microsoft Windows SDK > documentation) to retrieve the default system locale. Use > LOCALE_SYSTEM_DEFAULT for the first parameter, Locale, and > LOCALE_ICOUNTRY for the second parameter, LCType. > > 2.Use the default system locale obtained from GetLocaleInfo to > determine metric or non-metric paper size. > ◦Non-metric if default system locale is: > ■CTRY_UNITED_STATES, or > ■CTRY_CANADA, or > ■Greater than or equal to 50, but less than 60 and not CTRY_BRAZIL, or > ■Greater than or equal to 500, but less than 600 > > or metric otherwise. > --------- > > Ronny. > > On 4 jul, 02:08, Carlos Rocha<carlos.deletethis.ro...(a)doossier.com> > wrote: >> Hi, >> >> I need to transform PrintingDevice:PaperWidth to twips. I'm getting 2100 >> (for A4) so in my case it is mesured in 10ths of mm. Does it return >> always a metric value, or is dependent on some OS definition? if so, how >> can I know if PaperWidth is mesured using Imperial or Metric system? >> >> Thanks for any hint >> >> -- >> Carlos Rocha -- Carlos Rocha
From: Ronny on 6 Jul 2010 11:34 Carlos, Yes, you are right, it's in 1/10 millimeter. --- DEVMODE ---- ex. : dmPaperLength, dwPaperWidth, etc.... For printer devices only, overrides the length of the paper specified by the dmPaperSize member, either for custom paper sizes or for devices such as dot-matrix printers that can print on a page of arbitrary length. These values, along with all other values in this structure that specify a physical length, are in tenths of a millimeter. ----- But I (mis)understood that you wanted to know if the measured millimeters came from a printer in a country where a metric or non- metric/imperial format is preferred. Ronny. On 6 jul, 15:16, Carlos Rocha <carlos.deletethis.ro...(a)doossier.com> wrote: >  Hi Ronny, > > This is a surprise as in the meanwhile I've read somewhere that printers > always return paper size in tenths of mm. I'll check it further, thanks. > > > > > > > Info from :http://msdn.microsoft.com/en-us/library/ff561927(VS.85).aspx > > > ---------- > > 1.Use the GetLocaleInfo function (defined in the Microsoft Windows SDK > > documentation) to retrieve the default system locale. Use > > LOCALE_SYSTEM_DEFAULT for the first parameter, Locale, and > > LOCALE_ICOUNTRY for the second parameter, LCType. > > > 2.Use the default system locale obtained from GetLocaleInfo to > > determine metric or non-metric paper size. > > â¦Non-metric if default system locale is: > > â CTRY_UNITED_STATES, or > > â CTRY_CANADA, or > > â Greater than or equal to 50, but less than 60 and not CTRY_BRAZIL, or > > â Greater than or equal to 500, but less than 600 > > > or metric otherwise. > > --------- > > > Ronny. > > > On 4 jul, 02:08, Carlos Rocha<carlos.deletethis.ro...(a)doossier.com> > > wrote: > >>   Hi, > > >> I need to transform PrintingDevice:PaperWidth to twips. I'm getting 2100 > >> (for A4) so in my case it is mesured in 10ths of mm. Does it return > >> always a metric value, or is dependent on some OS definition? if so, how > >> can I know if PaperWidth is mesured using Imperial or Metric system? > > >> Thanks for any hint > > >> -- > >> Carlos Rocha > > -- > Carlos Rocha- Tekst uit oorspronkelijk bericht niet weergeven - > > - Tekst uit oorspronkelijk bericht weergeven -
|
Pages: 1 Prev: Help Using Graphics4VO Next: raw SQL, bBrowser and Orderby |