Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
0
Answer
How Can I print from winForm to XPS printer without dialog?
Nava Amo
10y
1.1k
1
Reply
Hello!
I try to print to XPS printer (it's not my default printer), but the program opens me a dialog.
Can I skip the dialog?
This is the code: pSettings = new PrinterSettings();
pSettings.PrintFileName = "test.xps";
RawPrinterHelper.SendStringToPrinter(pSettings.PrinterName, toSend);
spcn = new StandardPrintController(); printDocument1.PrinterSettings.PrinterName = "Microsoft XPS Document Writer"; printDocument1.PrintController = spcn;
printDocument1.PrintPage += new PrintPageEventHandler(printDocument1_PrintPage); printDocument1.Print();
thanks!
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
need to come red color for error message c#(MVC 2)
.net