如何在二级屏幕或扩展屏幕中打开PDF阅读器 [英] How to open PDF reader in secondary screen or extended screen

查看:1331
本文介绍了如何在二级屏幕或扩展屏幕中打开PDF阅读器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我正在使用Asp.net应用程序,我需要在辅助或扩展屏幕上打开pdf文件。我正在使用Process类在adobe reader中打开PDF文件,它运行正常。但问题是我需要在扩展屏幕或辅助屏幕上打开adobe阅读器。



我尝试过:



我尝试过Win32 API的WindowHandling,但我没有得到理想的输出。

Hi i am working on Asp.net application, Where i need to open pdf file on secondary or extended screen. I am using Process class to open PDF file in adobe reader and it is working perfectly. But the problem is i need to open that adobe reader in extended screen or secondary screen.

What I have tried:

I have tried with WindowHandling of Win32 API but i am not getting desired output.

推荐答案

相信我,你的代码是完美地工作。



您的代码在服务器上运行。它将打开服务器上的文件,没有人会看到它。



它可能出现到在Visual Studio中调试代码时工作。但这仅仅是因为,在特定情况下,服务器和客户端是同一台计算机。



一旦将代码部署到真实服务器,您的文件将停止开放。一段时间后,您的服务器将停止网格,因为它试图打开另一个无法看到或关闭的PDF文件。



在客户端上打开文件的方法是将其写入具有相应标题的响应:

Trust me, your code is NOT "working perfectly".

Your code is running on the server. It will open the file on the server, where nobody will ever see it.

It might appear to work when you debug the code in Visual Studio. But that's only because, in that specific instance, the server and the client are the same computer.

As soon as you deploy your code to a real server, your files will stop opening. Some time later, your server will grid to a halt as it tries to open yet another PDF file that nobody will ever be able to see or close.

The only way to open a file on the client is to write it to the response with the appropriate headers:
Response.ContentType = "application/pdf";
Response.TransmitFile(PATH_TO_YOUR_PDF_FILE);
Response.End();



在您提出要求之前,没有办法控制客户端收到文件时会发生什么。这包括监视其PDF软件的开放状态。


An no, before you ask, there is no way to control what happens to the file when the client receives it. And that includes which monitor their PDF software opens on.


这篇关于如何在二级屏幕或扩展屏幕中打开PDF阅读器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆