Solved

Printing (LETTER Size) in vb.net

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

Suggested Solutions

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

912 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

20 Experts available now in Live!

Get 1:1 Help Now