?
Solved

Printing (LETTER Size) in vb.net

Posted on 2004-10-19
3
Medium Priority
?
1,200 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 2000 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

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

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

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

649 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