Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2006

Tip: Looking for answers? Try searching our database.

Measurement Unit problem with Printing.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Streamline - 02 Feb 2006 17:41 GMT
Hi,

I have a problem where documents sent to the print spooler with a custom
page size are ignoring the regional settings for the Measurement Unit.  I
have my Regional Settings set to "English (United States)" and confirmed that
the Measurement Unit is "U.S".  When I print my 4"w x 2"h label (using a
custom paper size I set in my code as 400w x 200h (tenths of an inch)), it
converts to tenths of a millimeter, resulting in a page size of 1.47"w x
0.79"h.

I have tried checking the System.Globalization.RegionInfo.IsMetric in my
code, and it returns False, as expected.

Anyone have any idea why this is happening, and how I can correct the problem?

Thanks very much.

Alex
Bob Powell [MVP] - 02 Feb 2006 18:43 GMT
AFAIK The printer sizes are always returned in 100ths of an inch. Thats why
they are 800 * 1100 for a "standard" page.

To get the true dimensions of the printer page you need to do a bit of math
with the print page size and the DPI reported by the Graphics object.

Signature

Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

> Hi,
>
[quoted text clipped - 16 lines]
>
> Alex
Streamline - 02 Feb 2006 19:40 GMT
Yes, I understand that part.  The paper size seems to work fine on most of
our systems, however, we have a couple of systems where it seems to be
interpeting the page size values as 10ths of a millimeter instead of 100ths
of an inch, which you stated should always be in 100ths of an inch.

As a test, I've used the PrinterUnitConvert method to convert the page size
values from 100ths of an inch to 10ths of a millimeter, and pass in the
converted values, and the page size is then correct on the problem systems.

I would be fine with converting as necessary, except I can't find a way to
determine which measurement unit I should convert to.  
System.Globalization.RegionInfo.IsMetric is returning false on the problem
systems, yet it is still interpreting the page size values as 10ths of a
millimeter.

I have also tried getting the graphics object from the pagesettings object,
and testing the GraphicsUnit member, which returns "Display", which I believe
means 100ths of an inch.

I would really appreciate any further assistance with this issue.

Thanks again!

> AFAIK The printer sizes are always returned in 100ths of an inch. Thats why
> they are 800 * 1100 for a "standard" page.
[quoted text clipped - 22 lines]
> >
> > Alex

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.