What is XPS files and how it is being used

醉酒当歌 提交于 2019-12-05 07:31:23

Even i faced the same problem while running as a Windows Application.

The solution to that is :

The calling thread must be in STA mode. Most project created by Visual Studio is set to MTA by default.

What you can do is to run your code inside STA thread.

I tried in: Visual Studio 2010, Windows XP Srv Pack 3 64 Bit, And .Net Framework 4.0

Good Luck...

Accept this as Answer if it solves your issue

Your code is working, I just tested on my environment (VS 2010, Windows 7 64bit).

As input file I used a google page printed with the built-in Microsoft XPS Document Writer.

So the issue is with the XPS document you are testing.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!