المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : I have a problem with paper size at printing a page! [modified]



C# Programming
01-01-2010, 09:40 AM
Hello again,
my problem is: I have a printPreviewDialog control and I want to print: a bitmap (dimensions: 650x500, as a background), and some dynamic text (added afther the bitmap, to be visible).
My application is working perfect, but I experience a wierd thing: I want to set my printPreviewDialog to print on A4 paper size.

I've configure this as below:
PrintDocument pd = new PrintDocument();
pd.DocumentName = "Doc1";
pd.PrintPage += new PrintPageEventHandler(pd_PrintPage);
pd.DefaultPageSettings.PaperSize = new PaperSize("PaperA4", 826, 1169);

printPreviewDialog1.Document = pd;

On pd_PrintPage method I've write the code of what I want to print.
Now the wierd thing: when I start the app and open the printPreviewDialog, it seems ok! Paper size = A4, all is right!
But when printing the paper size is Letter!!!!!!! Only 90% of my print document is printed! It seems the page I want to print is to big for A4 size!

Why is that? I'm missing something? How can I right configure this for A4 paper size?

Cheer's,
Alex Manolescu.

modified on Thursday, December 31, 2009 6:31 AM