如何在浏览器中查看pdf文件? [英] how to view pdf file in browser?

查看:488
本文介绍了如何在浏览器中查看pdf文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hiiii ..



如何在浏览器中查看pdf文件?

hiiii..

how to view pdf file in browser?

推荐答案

有一些很好的浏览器插件用于此目的。 (我不认为Adobe的那个是其中之一,但也可以使用:-)。)首先,我建议您只依靠客户端软件。这将是合理的。即使浏览器不支持PDF(很容易发生),所有浏览器都会建议保存PDF文件或打开一些默认查看器。事件如果没有可用的查看者,用户将能够保存文件并在以后关注查看者。事件对用户来说不是一个很大的负担,因为这样的观众很容易访问。



当然,你不能假设PDF会在浏览器中显示在所有情况下。如果你真的想在所有情况下展示它,你需要开发 PDF到HTML的一些映射并实时创建HTML内容,一个是服务器端,而你的ASP .NET代码正在准备HTTP响应。这是一项非常困难且相当重要的工作。首先,映射创建的问题是模糊的。为什么?因为HTML和PDF具有非常不同的概念:HTML通常是流动的,但PDF是完全僵化的;这是一种电子纸,非常像打印输出。此外,与HTML相比,PDF几乎是非结构化的(非常像打印输出)。总的来说,这是可行的,但我不会鼓励你进入这个。



-SA
There are some nice browsers' plug-ins for this purpose. (I don't think that Adobe's one is one of them, but also usable :-).) So, first of all, I would suggest you simply rely on client-side software on this. This would be more than reasonable. Even if browser does not support PDF (which easily can happen), all browsers will suggest to either save the PDF file or open with some default viewer. Event if no viewers are available, the user will be able to save the file and take care about the viewers later. Event this would not be a great burden for the user, because such viewers are easily accessible.

Of course, you cannot assume that the PDF will be shown in the browser in all cases. If you really want to show it in all cases, you would need to develop some mapping of PDF to HTML and implement creation of the HTML content from PDF on the fly, one the server side, while your ASP.NET code is preparing the HTTP response. This is a pretty difficult and pretty big work. First of all, the problem of creation of mapping would be ambiguous. Why? Because HTML and PDF have very different concepts: HTML is generally fluid, but PDF is totally rigid; this is a kind of "electronic paper", pretty much like a printout. Besides, PDF is pretty much unstructured (pretty much like printout), in comparison with HTML. Overall, this is doable, but I won't encourage you in going into this.

—SA

这在很多情况下对我有用。祝你好运。



必须安装Adobe Reader。



打开Adobe Reader,转到:'编辑'> '偏好'> '一般'> 选择默认PDF处理程序,在下拉列表中,按版本选择正确的读者处理程序(应该只有一个,它可能已被选中,无论如何都要重新选择)。



软件将实现此更改,然后请求重新启动。
This has worked for me in a number of instances. Good luck.

Must have Adobe Reader installed.

Open Adobe Reader, go to: 'Edit' > 'Preferences' > 'General' > "Select Default PDF Handler", in the drop-down, select the correct Reader Handler by version (should only be one, it may already be selected, reselect anyway).

The software will implement this change and then request a reboot.


http://www.aspdotnet-suresh.com/2012/11/aspnet-open-pdf-file-in-web-browser.html [< a href =http://www.aspdotnet-suresh.com/2012/11/aspnet-open-pdf-file-in-web-browser.html\"target =_ blanktitle =New Window> ^ ]

http://www.c-sharpcorner.com/UploadFile/5089e0/how-to-open-pdf-files-in-web-brower-using-Asp-Net/ [ ^ ]

使用带C#的ASP.NET在新的浏览器选项卡中打开PDF文件 [< a href =http://www.codeproject.com/Tips/382965/Open-PDF-file-in-new-browser-tab-using-ASP-NET-wit\"target =_ blanktitle =新窗口> ^ ]

http://dotnetcode143.blogspot.in/2012/05/open-pdf-file-in-new-browser-tab-using.html [ ^ ]



-KR
http://www.aspdotnet-suresh.com/2012/11/aspnet-open-pdf-file-in-web-browser.html[^]
http://www.c-sharpcorner.com/UploadFile/5089e0/how-to-open-pdf-files-in-web-brower-using-Asp-Net/[^]
Open PDF file in new browser tab using ASP.NET with C#[^]
http://dotnetcode143.blogspot.in/2012/05/open-pdf-file-in-new-browser-tab-using.html[^]

-KR


这篇关于如何在浏览器中查看pdf文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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