I've stored an invoice from the Internet as XPS for later printing. Now printing with the XPSViewer.exe fails with an exception because it demands permission for UnmanagedCode.
Instead trying to find a fix for the application I've written a small program to print XPS:
Instead trying to find a fix for the application I've written a small program to print XPS:
PrintDialog dlg = new PrintDialog();
if (dlg.ShowDialog() == true)
{
XpsDocument doc = new XpsDocument(fileName, System.IO.FileAccess.Read);
dlg.PrintDocument(doc.GetFixedDocumentSequence().DocumentPaginator, "Test");
}
It's really easy to work with XPS. XpsDocument is part of .NET 3.5 in the assembly ReachFramework, namespace System.Windows.Xps.Packaging.
Christian
Great article. Some stuff on here i never even knew about.
Posted by: Christian Louboutin Outlet | 04/25/2011 at 11:32 AM
Thank you for your willingness to share your article, really good.
Posted by: Asics Running | 04/28/2011 at 09:35 AM
Such a good writing, or by I saw for the first time. I'm quite happy, you are a good writer.
Posted by: Ken Griffey Shoes | 05/05/2011 at 11:48 AM
Readability is quite high, I like it very much.
Posted by: Griffey Shoes | 05/10/2011 at 04:02 AM
I have to state, you chose your words well. The ideas you wrote on your encounters are well placed. This is an incredible blog!I have to state, you chose your words well. The ideas you wrote on your encounters are well placed. This is an incredible blog!
Posted by: Air Jordans For Cheap | 08/04/2011 at 11:52 AM
What a fun pattern! It's great to hear from you and see what you've sent up to. All of the projects look great! You make it so simple to this.Thanks!
Posted by: Moncler Online | 09/11/2011 at 02:57 AM
Thank you for sharing your small program to print XPS files. Like your invoice, I am sure that many people find this difficulty when saving documents for later printing such as bank statements or else online tickets for airlines or events. With the increased portability, a person may be working on an electronic device which does not have a printer attached to it, and neither has a printer in the vicinity. Hence, saving for later printing without losing the document would be a must. As you said, there is the problem with the XPS files, but at least, with the knowledge of people like yourself, there is a way to go around this difficulty. Great job!
Posted by: Vista Print Coupon | 07/31/2012 at 04:28 PM