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

مشاهدة النسخة كاملة : Printing Envelopes from Manual Feed



C# Programming
04-01-2012, 01:26 AM
Hi there,

Really stumped with being able to Print an envelope from my C# WinForms application.

At the moment we print from Word with the document size/type set up as a C5 or a DL envelope. When printed the printer will request a C5 or DL envelope to be placed into the manual document feeder before printing.

I want the application to be able to do the same but at the moment I am having no luck. Here is the code I am using:

Code:
/* aPD is a PrintDocument object */ aPD.DefaultPageSettings.Margins = new System.Drawing.Printing.Margins(0, 0, 0, 0); if (radSizeDL.Checked) { aPD.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize("DL Envelope", 220, 110); aPD.DefaultPageSettings.PaperSize.PaperName = System.Drawing.Printing.PaperKind.DLEnvelope.ToString(); } else { aPD.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize("C5 Envelope", 229, 162); aPD.DefaultPageSettings.PaperSize.PaperName = System.Drawing.Printing.PaperKind.C5Envelope.ToString(); } aPD.DefaultPageSettings.Landscape = true; aPD.OriginAtMargins = true; aPD.PrinterSettings.Copies = Convert.ToInt16(numCopies.Value); aPD.Print();
I am quite happy to upload the code for anyone to see if they can help me?

Please help!

Thanks.