Windows 8 blows error on c# process for printing pdf file, how?

前端 未结 1 1274
小蘑菇
小蘑菇 2020-12-21 13:43

The following code at least works perfectly printing a pdf file in Windows 7, but is blowing an error in Windows 8:

                Process process = new Pro         


        
相关标签:
1条回答
  • 2020-12-21 14:26

    The error message tells you all you need to know. There is nothing defined for the printto verb on the .pdf file extension. You'll need to configure your file associations to remedy that if you want this approach to work.

    The way you are attempting to do this is pretty brittle, relying as it does on the vagueries of a third party PDF viewer. If you control all the machines on which the application runs, you can configure the PDF viewer as you like. Otherwise you can expect to deal with a lot of customer support. A more robust solution would be to build the PDF printing capability into your application using one of the many libraries that offer such capabilities.

    0 讨论(0)
提交回复
热议问题