将任何文件另存为.jpg扩展名 [英] save any file as .jpg extension

查看:120
本文介绍了将任何文件另存为.jpg扩展名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi ..,
我们能否将上传为a.jpg文件的任何文件保存,即是否可以将任何文档的首页转换为.jpg并使用c#保存在文件夹中(如果您有任何代码,请帮助我
)
我想在用户下载文档之前显示我的文档的预览,并且我希望该预览是jpg图像,以便我们可以在没有太多时间和带宽的情况下显示预览.

hi..,
can we save any file uploaded as a.jpg file i.e.., can we convert first page of any document in to .jpg and save in a folder using c# if u have any code plz help me

i want to show preview of my document before the user download it and i want that preview to be a jpg image so that we can show the preview with out much time and bandwidth

推荐答案

任何文件"和文档的概念是矛盾的:某些文件将不是文档.

同样,许多文档格式没有固定的位图呈现.例如,Windows Word文档的外观将取决于应用程序窗口的大小,查看选项,缩放和其他因素.同样,首页"的概念也取决于这些因素.例如,"Web布局"不显示页面."但是,我知道您需要将此位图作为文档的预览".如果这样,则可以为每种文档类型选择某种固定的呈现方式. />
现在,还有另一个问题:任何文档"听起来都像任何文档类型/格式的任何文档",因为您没有指定所需的类型.至少可以这样说,这听起来有点不现实.您需要以某种方式抑制食欲,以寻求全面的解决方案.

—SA
"Any file" and the notion of a document are contradicting: some files won''t be documents.

Also, many document formats does not have any fixed bitmap rendering. For example, a particular look of a Windows Word document will depend on the size of the application windows, view options, zoom and other factors. Also, the notion of "first page" also depends on those factors. For example, "Web layout" does not show pages". However, I understand that you need this bitmap as a "preview" of a document. If so, one can select some arbitrary fixed way of rendering for each document type.

Now, there is another problem: "any document" sounds like "any document of any document type/format", as you did not specify required types. This sound a bit unrealistic, to say the least. You need to curb you appetite for a comprehensive solution somehow.

—SA


如果要将网页转换为图像,请参考此
http://stackoverflow.com/questions/701680/how- do-i-save-a-web-page-to-image [ http://stackoverflow.com/questions/41665/bmp-to-jpg- png-in-c-sharp [ ^ ]
If you want to convert a web page to an image, refer this
http://stackoverflow.com/questions/701680/how-do-i-save-a-web-page-to-image[^]
and for any image to jpg refer this
http://stackoverflow.com/questions/41665/bmp-to-jpg-png-in-c-sharp[^]


这篇关于将任何文件另存为.jpg扩展名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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