G
Guest
I have got difficulty in enumerating papersizes of a network printer using
the PrinterDoc.PrinterSettings.PaperSizes
PrintDocument printDoc = new PrintDocument();
PaperSize pkSize;
printDoc.PrinterSettings.PrinterName = ddlMyPrinters.SelectedItem.Text ;
for (int i = 0; i < printDoc.PrinterSettings.PaperSizes.Count; i++)
{
pkSize = printDoc.PrinterSettings.PaperSizes;
string myPaperSize = pkSize.PaperName ;
ddlPaperSizes.Items.Add(myPaperSize);
}
I able to enumerate the networkprinters and get the printernames. (Before
enumeration, I have impersonate the current user. when enumerating the
papersizes, the PaperSizes.Count is coming Zero. -- Can somebody help me
where I am doing the mistake.
the PrinterDoc.PrinterSettings.PaperSizes
PrintDocument printDoc = new PrintDocument();
PaperSize pkSize;
printDoc.PrinterSettings.PrinterName = ddlMyPrinters.SelectedItem.Text ;
for (int i = 0; i < printDoc.PrinterSettings.PaperSizes.Count; i++)
{
pkSize = printDoc.PrinterSettings.PaperSizes;
string myPaperSize = pkSize.PaperName ;
ddlPaperSizes.Items.Add(myPaperSize);
}
I able to enumerate the networkprinters and get the printernames. (Before
enumeration, I have impersonate the current user. when enumerating the
papersizes, the PaperSizes.Count is coming Zero. -- Can somebody help me
where I am doing the mistake.