Solved

Printing (LETTER Size) in vb.net

Posted on 2004-10-19
3
1,179 Views
Last Modified: 2008-01-09
I have a very picky laser printer (minolta 2300dl) that i need to always print letter size to in order to avoid customer interaction.  My current vb.net app appears to be printing a "custom" papersize by default, which my laser printer translates to "legal govt" and then asks for user interaction.  How do i set the .defaultpagesettings.papersize.kind to paperkind.letter permenantly?  everything i've tried doesn't seem to work.  i even tried   .defaultpagesettings.papersize = new papersize("myletter",850,1100) but the laser printer errors out saying illegal size ...

any ideas?

Thanks,
Nick
0
Comment
Question by:NickUA
3 Comments
 
LVL 48

Expert Comment

by:Mikal613
ID: 12352320
0
 
LVL 1

Author Comment

by:NickUA
ID: 12353166
that doesn't help at all, i found that article on google as well.  1) i'm using all WinXP, i don't care if it works in nt/2000, this is a closed environment program.. that is a bug and workaround for NT/2000.  2) that code is in C#, not VB.Net (i could translate it but don't need to).  3) i don't want to do a custom size, i want to do the size "Letter" surely somewhere there is an article or someone has run into this problem somewhere.

Thanks,
Nick
0
 
LVL 9

Accepted Solution

by:
Lacutah earned 500 total points
ID: 12364865
Use the paper sizes provided by the printer itself to set the paper size to Letter.

For example, in the sub New() of the Print Document class you've created, add the following code:
dim ps as Printing.PaperSize
for each ps in PrintDocument.PrinterSettings.PaperSizes
   'See if it's the letter size...
   if ps.PaperName.ToLower.IndexOf("letter") >= 0 then
       'Found letter size!  Store it to a class-wide variable
        m_PS = ps
        exit for
   end if
next

In the PrintDocument Class QueryPageSettings Event:
e.PageSettings.PaperSize = m_PS
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question