Solved

Printing (LETTER Size) in vb.net

Posted on 2004-10-19
3
1,056 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

706 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now