我想在特定目录中打印我的文件 .xps。我该怎么做?这是我的代码:
printDocumentSempre.PrinterSettings.PrinterName = "Microsoft XPS Document Writer";
printDocumentSempre.PrintController = new StandardPrintController();
printDocumentSempre.PrinterSettings.PrintToFile = true;
printDocumentSempre.PrinterSettings.PrintFileName = DateTime.Now.Ticks.ToString() + ".xps";
PaperSize papersize = new PaperSize("Dimensione fattura", 310, 800);
printDocumentSempre.DefaultPageSettings.PaperSize = papersize;
printDocumentSempre.Print();