469,592 Members | 1,914 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,592 developers. It's quick & easy.

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
Jul 21 '05 #1
0 1199

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by JC Mugs | last post: by
reply views Thread by Pedro Feio | last post: by
2 posts views Thread by John Smith | last post: by
1 post views Thread by bafidi | last post: by
reply views Thread by Just Me | last post: by
reply views Thread by Madern | last post: by
reply views Thread by Madern | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.