?
Solved

c# printer settings problems

Posted on 2008-10-15
5
Medium Priority
?
1,497 Views
Last Modified: 2013-12-17
Hi guys,
i've developed an application to print a set of images/strings, i need to be able to print to a number of different paper sizes including A6...however, every time i just goes to A4.
what am i doing wrong?
0
Comment
Question by:zell71
[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
  • 2
  • 2
5 Comments
 
LVL 15

Assisted Solution

by:angus_young_acdc
angus_young_acdc earned 800 total points
ID: 22719350
0
 
LVL 6

Author Comment

by:zell71
ID: 22719407
thanks angus_young_acdc
hmm these links (1 & 2) do mention how to set up the print settings, how i'm a little confused on how to execute the paper size.
for example, ideally i would have a combo box with A4, A6...selecting either and hitting print would then perform the print to the paper size.
link 2 seems close, but as i said..not sure how i actually execute the selected paper size.
0
 
LVL 15

Expert Comment

by:angus_young_acdc
ID: 22719430
Within link one:
    e.Graphics.MeasureString(_text.Substring(RemoveZeros(curChar)), PrinterFont, new SizeF(printWidth, printHeight), format, out chars, out lines);  
 
    //Print the page  
    e.Graphics.DrawString(_text.Substring(RemoveZeros(curChar)), PrinterFont, Brushes.Black, printArea, format);  

And your printWidth and printHeight would be set as whatever the size of the combo box was.  EG the pseudo code:
if ComboBox value == A4
printHeight = 200;
printWidth = 75;
0
 
LVL 6

Author Comment

by:zell71
ID: 22719509
erm doesn't this just set the print area not the papersize?
 
0
 
LVL 26

Accepted Solution

by:
Anurag Thakur earned 1200 total points
ID: 22720583
use the code like this
the following line configures page size to A4 similarly you can set it to something else
printDocument.DefaultPageSettings.PaperSize= new System.Drawing.Printing.PaperSize("PaperA4",826,1169);
this i found from following link
http://www.tek-tips.com/viewthread.cfm?qid=357725


to find what all page sizes are supported by the printer you can refer to the following link
http://www.java2s.com/Tutorial/CSharp/0280__Development/PrintersettingsDisplaythelistofvalidpapersizes.htm
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

801 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