472,341 Members | 1,936 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,341 software developers and data experts.

Setting the PaperSize

Hi,

I'm having a weird problem setting up the paper size in a C# Windows Forms
Application.
The code I'm using is something like this:

PrintDocument pd = new PrintDocument();

pd.DefaultPageSettings.Margins.Left = 0;
pd.DefaultPageSettings.Margins.Right = 0;
pd.DefaultPageSettings.Margins.Top = 0;
pd.DefaultPageSettings.Margins.Bottom = 0;

PaperSize pkCustomSize1 = new PaperSize("First custom size", 827, 100);
pd.DefaultPageSettings.PaperSize = pkCustomSize1; //** This line works...
pd.PrinterSettings.DefaultPageSettings.PaperSize = pkCustomSize1; // This
doesn't...
What I get after all this, is just an A4 page that is only written on top...
:-(

How do I tell my application which size I want the paper to be?

Thanks in advance,
Pedro Feio
Nov 15 '05 #1
0 1267

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Pedro Feio | last post by:
Hi, I'm having a weird problem setting up the paper size in a C# Windows Forms Application. The code I'm using is something like this: ...
1
by: JC Mugs | last post by:
Does anyone know how to set user defined paper sizes for and Epson LQ570E Printer under Windows XP Prof? The driver does not allow for user defined...
2
by: John Smith | last post by:
Hey folks, I'm trying to print from a c# windows application using System.Drawing.Printing. My problem is that it doesn't matter what I put in...
5
by: Fred Nelson | last post by:
Hi: I'm trying to write a program that will print envelopes using a HP Laserjet 4 that has three trays. In the future this program will work...
1
by: bafidi | last post by:
i want to write a code and make the papersize A but this code is wrong what is the true on PrintDocument1.DefaultPageSettings.papersize=A4
0
by: Just Me | last post by:
I want to save and then be able to restore the printer paper size. Something like: WriteLine(lFileNum,...
0
by: Madern | last post by:
Good Morning, I'm developing a code that needs to deal with different printer user formats which have to be created on a network driver printer...
0
by: Madern | last post by:
Good Morning, I'm developing a code that needs to deal with different printer user formats which have to be created on a network driver printer...
0
by: Brad Pears | last post by:
I have a vb.net 2005 application where the user can select to preview an image. The users are CAD designers and typically have their default printer...
2
by: Steve | last post by:
Hi All Using VB.net 2008, windows forms application on Windows XP SP2 I need to set the paper size when printing to an 80mm Epson docket...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.