I'm creating a simple WPF print dialog box to setup a label printer. I want it to be very simple and so I've choosen not to use the standard WPF printdialog.
All is going well accept for one thing, paper sizes.
Having selected a printer from one combobox, a second combobox is populated with the paper sizes available from that device. I'm currently using selectedPrinter.GetPrintCapabilities.PageMediaSizeCapability and setting that as itemssource of the combobox.
However, my main issues with this are:
It seems to only get a subset of the available paper sizes (compared to the normal print dialog)
No way to add custom sizes since PageMediaSize is not inheritable and the constructor only allows you to use the PageMediaSizeName Enum
and
The only name I can display is the Enum text by binding the diplaypath to PageMediaSizeName, which is not particularly user friendly.
What I have also found is that if I dump selectedPrinter.GetPrintCapabilitiesAsXml to a file and look at that, I get everything I need; all the availble the paper sizes of the printer each with sizes and importantly a display name element.
My question is, am I missing something with selectedPrinter.GetPrintCapabilities or do I need to create a parser for selectedPrinter.GetPrintCapabilitiesAsXml and use this info instead?