How to enumerate printer page sizes

I'm creating a new print command for our application using WPF. I'm also not using the standard WPF PrintDialog, putting up my own UI instead. I have a dropdown box that lists available printers, and I want to populate a dropdown with paper sizes for the selected printer. I'm using the following:

PrintCapabilities printCapablities = pq.GetPrintCapabilities();
foreach (PageMediaSize pms in printCapablities.PageMediaSizeCapability)
{
cb.Items.Add(pms.PageMediaSizeName.ToString());
}

However this only lists a small subset of the paper sizes available as shown by the Printer Preferences dialog. Does anyone know how to get a full listing of paper sizes? I have to say using WPF printing seems excruciatingly difficult unless you just give up and use PrintDialog, but in that case the whole WPF print namespace seems a total waste of time! I hope I'm missing something...

Thanks for any help!
Jeff

[938 byte] By [JeffreyJ] at [2008-1-4]

Visual Studio Orcas

Site Classified