如何在C#中的Window APplication中将xls转换为pdf和将文档转换为pdf [英] How to Convert xls to pdf and Docs to pdf in Window APplication in C#

查看:182
本文介绍了如何在C#中的Window APplication中将xls转换为pdf和将文档转换为pdf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在C#

解决方案

在Window APplication中将xls转换为pdf,将文档转换为pdf

检查这些..
将xls转换为pdf:
将Excel转换为pdf [将MS Excel文档从C#转换为PDF [ ConvertExcelToPDF [将xls转换为pdf usin c# [如何在C#中将Word文档转换为pdf [ ^ ]
在c#中将文档转换为pdf [如何在c#中将Word doc转换为c# [ http://en.wikipedia.org/wiki/IText [ http://itextpdf.com/ [ ^ ],
http://sourceforge.net/projects/itextsharp/ [ http://www.microsoft.com/en-us/download/details.aspx? id = 30425 [ ^ ].

这样,您可以支持基于XML的新Office格式(例如.DOCX,.XLSX),ECMA-376标准:
http://en.wikipedia.org/wiki/Microsoft_Office_XML_formats [ http://en.wikipedia.org/wiki/Office_Open_XML [无需互操作即可将Office文档转换为PDF [需要一个相当独特的WPF文本编辑器控件 [ ^ ],
我如何显示单词Windows应用程序中使用c#.net [在不使用Interop.word dll的情况下读取文字文件...不想在IIS中安装文字. [< ^ ].

这是另一个选项: http://npoi.codeplex.com/ [ http://support.microsoft.com/default.aspx?scid = kb; EN-US; q257757#kb2 [使用Open XML创建基本的Excel工作簿 [ ^ ].

您也可以使用Office Interop,但是不建议这样做,尤其是在服务器设置中.顺便说一句,请参阅有关主题的这些Microsoft文章:
http://support.microsoft.com/default.aspx?scid=kb; EN-US; q257757#kb2 [ ^ ],
http://support.microsoft.com/kb/257757/zh-CN [ ^ ].

—SA


How to Convert xls to pdf and Docs to pdf in Window APplication in C#

解决方案

Check these..
xls to pdf:
Convert a Excel to a pdf[^]
Convert a MS Excel document into PDF from C#[^]
ConvertExcelToPDF [^]
convert xls to pdf usin c#[^]

Docs to pdf:
How to convert word document to pdf in C#[^]
convert doc to pdf in c#[^]
How to convert Word doc to PDF in c#[^]


To generate PDF, I would recommend using iText, or its .NET port, iTextSharp:
http://en.wikipedia.org/wiki/IText[^],
http://itextpdf.com/[^],
http://sourceforge.net/projects/itextsharp/[^].

In included the reference to Java iText site as well, because most documentation is there. If you understand C#, it would not be difficult to understand Java-bases API documentation.

For parsing Office documents, I would recommend using Open XML SDK:

http://www.microsoft.com/en-us/download/details.aspx?id=30425[^].

This way, you can support new XML-based Office formats (such as .DOCX, .XLSX), ECMA-376 standard:
http://en.wikipedia.org/wiki/Microsoft_Office_XML_formats[^],
http://en.wikipedia.org/wiki/Office_Open_XML[^].

This way, you can work without Office installed. Also, the documents are supported by 3rd-party software. Please see my past answers:
Convert Office-Documents to PDF without interop[^],
Need a rather unique WPF text editor control[^],
Hi how can i display word file in windows application using c#.net[^],
Read a word file without using Interop.word dll...Do not want to install word in IIS..[^].

This is another option: http://npoi.codeplex.com/[^].

See also: http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757#kb2[^].

See also this CodeProject article: Creating basic Excel workbook with Open XML[^].

You can also use Office Interop, but this is less recommended, especially in server settings. By the way, see these Microsoft article on the topic:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757#kb2[^],
http://support.microsoft.com/kb/257757/en-us[^].

—SA


这篇关于如何在C#中的Window APplication中将xls转换为pdf和将文档转换为pdf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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