日期:2014-05-17 浏览次数:20420 次
private void Print3()
{
const string printerName="GP-5890XIII";
if (m_streams == null || m_streams.Count == 0)
return;
PrintDocument printDoc = new PrintDocument();
printDoc.PrinterSettings.PrinterName = printerName;
printDoc.DefaultPageSettings.Landscape = false;
// printDoc.PrinterSettings.DefaultPageSettings.PaperSize = printDoc.PrinterSettings.PaperSizes[0];
foreach (PaperSize ps in printDoc.PrinterSettings.PaperSizes)
{
string myTempID = ps.PaperName;
if (myTempID == "Gprinter 58(48) x 299 mm")
{
printDoc.PrinterSettings.DefaultPageSettings.PaperSize = ps;
printDoc.DefaultPageSettings.PaperSize = ps;
}
}
if (!printDoc.PrinterSettings.IsValid)
{
string msg = string.Format("Can't find printer \"{0}\".", printerName);
return;