.NET图形库,用于在浏览器中显示图像(pdf,.docx和任何其他格式的图像) [英] .NET graphic libraries to display images (pdf, .docx and any other format of image) in the browser

查看:61
本文介绍了.NET图形库,用于在浏览器中显示图像(pdf,.docx和任何其他格式的图像)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个ASP .NET MVC应用程序,用户可以在其中将文件上传到存储库.这些文件可以是pdf,doc,任何类型的图像等等.

当用户选择要导入的文件时,我想在浏览器中显示该文件,以便他们可以在上传之前查看其内容.

我知道我可以使用某种IFrame来显示pdf,但我正在寻找一些特定的类或.net库来实现此功能.

我只需要一个北方.

解决方案

这是一个非常困难的问题.有一些库可以提供帮助.例如,可以使用 ghostscript 将PDF文件渲染为图像. Word和Excel文件可能会转换为带有许多库的PDF或图像. AFAIK都不擅长于此,因此我不推荐一个.

您可以使MSO自动化以执行到PDF的转换,但是对于服务器代码来说绝对不安全.另一种可能性是将源文档转换为SWF文件(例如 flexpaper )并在Flash中显示.有一些很棒的库,但是它将限制您支持的客户端. Sharepoint也支持提供某些这种功能.其他人使用 OpenOffice来转换 MSO文档,但也会降低质量. >

我真的不能建议任何具体的方向,因为它很大程度上取决于您/您的公司愿意花费什么以及期望的结果.祝你好运.

I am developing a ASP .NET MVC application where users are able to upload files to a repository. Those files could be pdf, doc, any type of image and so on.

When the user select a file to be imported I would like to display this file in the browser so they can review its contents before the upload.

I know I could use some sort of IFrame to display pdf but I am looking for some specific class or .net libraries to implement this feature.

I just need a north.

解决方案

This is an extremely difficult problem. There are some libraries that can help. For instance PDF files might be rendered to images with ghostscript. Word and Excel files might be converted to PDF or image with a number of libraries. None of them, AFAIK, are very good at it so I can not recommend one.

You could automate MSO to perform the conversion to PDF, but that is decidedly not safe for server code. Another possibility is convert source documents to SWF files (like flexpaper) and display in flash. There are some great libraries out there, but it will limit your supported clients. Sharepoint has support for providing some of this capability as well. Others have used OpenOffice to convert MSO documents but also at a loss of quality.

I can't really advise any specific direction as it is highly dependent on what you/your company is willing to spend and the desired results. Good luck.

这篇关于.NET图形库,用于在浏览器中显示图像(pdf,.docx和任何其他格式的图像)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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