Twelve Core Processors in 2010
Twitter

XPS Printing

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:

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

Comments

Feed You can follow this conversation by subscribing to the comment feed for this post.

Christian Louboutin Outlet

Great article. Some stuff on here i never even knew about.

 Asics Running

Thank you for your willingness to share your article, really good.

Ken Griffey Shoes

Such a good writing, or by I saw for the first time. I'm quite happy, you are a good writer.

Griffey Shoes

Readability is quite high, I like it very much.

Air Jordans For Cheap

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!

Moncler Online

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!

Vista Print Coupon

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!

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Your Information

(Name and email address are required. Email address will not be displayed with the comment.)