Print XPS with PrintTicket, OutputColor PagesPerSheet not working
I have a .xps file generated from build-in Microsoft xps writer printer, I want to print this to a real printer but with modified attributes such as: duplex, grayscale, n-up etc.
I followed examples from MSDN and I can print .xps fine, but the problem is I can only set few attributes of the job. By setting PrintTicket with PrintQueue, job printed correctly with modified copies and duplex settings, but will not convert to grayscale or honor any n-up settings.
It seems I am not alone, from this form , by using event handler of WritingPrintTicketRequired, XPS files PrintTicket has been successfully changed with grayscale, n-up settings, but by using PrintQueue.AddJob() call will not print them in grayscale or n-up setting.
However, if I use PrintDialog and manually select attributes then it would print as expected. If I try to set PrintQueue and PrintTicket property in PrintDialog then it won't honor some of the attributes.
My goal is is programmatically print xps file with attributes. The question is how can I make PrintQueue fully honor PrintTicket?
FYI: the xps file was generated as color and 开发者_StackOverflow中文版I can see color images in .xps package.
EDIT: it turns out is the printer driver somehow does not honor print settings,even printer capabilities show it support monochrome, veryfied by changing to another driver. However, specify grayscale in print ticket is different than selecting grayscale in print dialog UI: grayscale in print ticket would output monochrome image and in spool file, it is specified to render as colour but the image it self is converted. While the later would generating a more realistic grayscale image.
精彩评论