简体   繁体   English

在asp.net应用程序中显示pdf文档的最佳方法

[英]Best way to display pdf document in asp.net application

I'm looking for the best way to display pdf document on a website. 我正在寻找在网站上显示pdf文档的最佳方式。 Surely I need to convert it to jpeg or gif for the browser to handle it. 当然我需要将其转换为jpeg或gif以供浏览器处理。 I read few posts but most refer to GhostScript and its pdf2image. 我读了几篇文章,但大多数都是指GhostScript及其pdf2image。 But that solution calls for starting a process that would save a copy of pdf doc to the file system and then would have to be loaded back into memory for displaying. 但是该解决方案要求启动一个将pdf doc副本保存到文件系统的进程,然后必须将其加载回内存以进行显示。 Frankly I find it a bit clumsy. 坦率地说,我发现它有点笨拙。 For those of you who have done it, what library you used and if you could attach a link to some examples, I'd greatly appreciate it. 对于那些已经完成它的人,您使用的库以及如果您可以附加一些示例的链接,我将非常感激。 I'm developick a web application that helps manage manufacturing process and is accessed fron android tablets. 我正在开发一个有助于管理制造过程的Web应用程序,并且可以从Android平板电脑访问。 Company has a stockpile of documentation in pdf files that is to be delivered to production managers. 公司有一份pdf文件库存文件,将交付给生产经理。 I'd love the solution to be akin Crystal Report Viewer contron but II understand that I have to stick to pdf to image conversion. 我喜欢这个解决方案是类似于Crystal Report Viewer的控制器,但我知道我必须坚持使用pdf进行图像转换。 Please give me some advise here. 请在这里给我一些建议。

My advice is don't over think this. 我的建议是不要过度思考。

You can simply add a link to the PDF file, which will open on a new tab. 您只需添加PDF文件的链接,该文件将在新选项卡上打开。

You can take a look at http://mozilla.github.io/pdf.js/ which will allow you to render a PDF on the client side. 您可以查看http://mozilla.github.io/pdf.js/ ,它将允许您在客户端呈现PDF。

Or if you decide to go with a Ghostscript, you can take a look at http://ghostscriptnet.codeplex.com 或者,如果您决定使用Ghostscript,可以查看http://ghostscriptnet.codeplex.com

By all accounts the PDF Focus .NET library seems to be the best solution. 从各方面来看,PDF Focus .NET库似乎是最好的解决方案。 A wrd of advice is to add a cleanup method to the page unload to delete all temporary files that were used to feed source into image controls when displaying pictures on a website. 一个建议是向页面卸载添加清理方法,以删除在网站上显示图片时用于将源提供到图像控件的所有临时文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM