user834850
user834850

Reputation:

To change PrintDocument DefaultPageSettings.PaperSize to Custom values and to keep them

I'm doing the next:

docToPrint.DefaultPageSettings.PaperSize = 
                    new System.Drawing.Printing.PaperSize("Custom", (int)Math.Round(DocWidth / 0.254), (int)Math.Round(DocHeight / 0.254));

It converts from mm to inches. It's ok. When the PrinterPreview Dialog is shown first time it shows the Custom page size. But when I open pageSetupDialog - it drops all previous and forgets about custom settings.

Generaly my question is Topic.Text + "how?";

Thanks

UPDATE: I FOUND THE SOLUTION. AS I HAVE REPUTATION<100 = have to wait 24 hrs to submit the ANSWER.

That was not easy to understand.

Upvotes: 2

Views: 3611

Answers (1)

user834850
user834850

Reputation:

The answer is - do this on BeginPrint event.

Upvotes: 1

Related Questions